mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
34 lines
760 B
Plaintext
34 lines
760 B
Plaintext
:: Create a private key-file for a random (or specified) moon
|
|
::
|
|
:::: /hoon/moon/hood/gen
|
|
::
|
|
/- *sole
|
|
/+ *generators
|
|
::
|
|
::::
|
|
::
|
|
:- %say
|
|
|= $: [now=@da eny=@uvJ bec=beak]
|
|
[mon=@p ~]
|
|
=rift
|
|
==
|
|
:- %helm-moon
|
|
^- (unit [=ship =udiff:point:jael])
|
|
=* our p.bec
|
|
=/ ran (clan:title our)
|
|
?: ?=([?(%earl %pawn)] ran)
|
|
%- %- slog :_ ~
|
|
leaf+"can't manage a moon from a {?:(?=(%earl ran) "moon" "comet")}"
|
|
~
|
|
=/ seg=ship (sein:title our now mon)
|
|
?. =(our seg)
|
|
%- %- slog :_ ~
|
|
:- %leaf
|
|
"can't create keys for {(scow %p mon)}, which belongs to {(scow %p seg)}"
|
|
~
|
|
=/ =^rift
|
|
?. =(*^rift rift)
|
|
rift
|
|
+(.^(^rift j+/(scot %p our)/rift/(scot %da now)/(scot %p mon)))
|
|
`[mon *id:block:jael %rift rift]
|