1
1
mirror of https://github.com/urbit/shrub.git synced 2024-12-26 13:31:36 +03:00
shrub/pkg/arvo/gen/hood/moon-breach.hoon
2020-12-08 01:47:06 +01:00

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]