hood save/load mechanism

This commit is contained in:
Anton Dyudin 2016-04-18 15:15:35 -07:00
parent 42926b7bb4
commit dbeed2d723
4 changed files with 43 additions and 0 deletions

View File

@ -72,6 +72,12 @@
~? ?=(^ saw) [%kiln-overload-lame u.saw]
[~ +>]
::
++ poke-hood-load
|= dat/hood-part
?> =(our src)
~& loaded+-.dat
[~ %_(+> lac (~(put by lac) -.dat dat))]
::
++ coup-drum-phat (wrap take-coup-phat):from-drum
++ coup-helm-hi (wrap coup-hi):from-helm
++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum
@ -136,6 +142,7 @@
++ poke-kiln-unmount (wrap poke-unmount):from-kiln
++ poke-kiln-unsync (wrap poke-unsync):from-kiln
++ poke-womb-invite (wrap poke-invite):from-womb
++ poke-womb-save (wrap poke-save):from-womb
++ poke-womb-obey (wrap poke-obey):from-womb
++ poke-womb-claim (wrap poke-claim):from-womb
++ poke-womb-do-claim (wrap poke-do-claim):from-womb

16
gen/hood/load.hoon Normal file
View File

@ -0,0 +1,16 @@
::
:::: /hoon/load/hood/gen
::
/? 310
/+ womb
::
::::
!:
:- %say
|= $: {now/@da eny/@uvI byk/beak}
{{dap/term $~} $~}
==
^- {$hood-load ?(part:womb)}
?+ dap ~|(unknown-backup+dap !!)
$womb [%hood-load .^(part:womb %cx (tope byk /womb-part/bak/hood/app))]
==

14
gen/hood/save.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/save/hood/gen
::
/? 310
::
::::
!:
:- %say
|= $: {now/@da eny/@uvI byk/beak}
{{dap/term $~} $~}
==
?+ dap ~|(unknown-backup+dap !!)
$womb [%womb-save (tope byk /womb-part/bak/hood/app)]
==

View File

@ -110,6 +110,7 @@
|% :: arvo structures
++ card ::
$% {$flog wire flog} ::
{$info wire @p @tas nori} :: fs write (backup)
:: {$wait $~} :: delay acknowledgment
{$poke wire pear} :: app RPC
{$next wire p/ring} :: update private key
@ -503,6 +504,11 @@
?> =(our src) :: me only
.(boss who)
::
++ poke-save :: write backup
|= pax/path
=< abet
(emit %info /backup [our (foal pax [%womb-part !>(`part`+:abet)])])
::
++ poke-rekey :: extend will
|= $~
=< abet