save (most) womb pokes via .urb/put

This commit is contained in:
Anton Dyudin 2016-04-29 16:18:59 -07:00
parent dd0abaeb45
commit fa28a0fbfb
8 changed files with 83 additions and 11 deletions

View File

@ -108,6 +108,7 @@
++ peek-x-womb peek-x:(womb hid (able %womb)) ++ peek-x-womb peek-x:(womb hid (able %womb))
++ peer-scry-x-womb (wrap peer-scry-x):from-womb ++ peer-scry-x-womb (wrap peer-scry-x):from-womb
++ poke-dill-belt (wrap poke-dill-belt):from-drum ++ poke-dill-belt (wrap poke-dill-belt):from-drum
++ poke-drum-put (wrap poke-put):from-drum
++ poke-drum-link (wrap poke-link):from-drum ++ poke-drum-link (wrap poke-link):from-drum
++ poke-drum-unlink (wrap poke-unlink):from-drum ++ poke-drum-unlink (wrap poke-unlink):from-drum
++ poke-drum-exit (wrap poke-exit):from-drum ++ poke-drum-exit (wrap poke-exit):from-drum
@ -152,6 +153,7 @@
++ poke-womb-manage (wrap poke-manage):from-womb ++ poke-womb-manage (wrap poke-manage):from-womb
++ poke-womb-release (wrap poke-release):from-womb ++ poke-womb-release (wrap poke-release):from-womb
++ poke-womb-reinvite (wrap poke-reinvite):from-womb ++ poke-womb-reinvite (wrap poke-reinvite):from-womb
++ poke-womb-replay-log (wrap poke-replay-log):from-womb
++ poke-write-sec-atom (wrap poke-sec-atom):from-write ++ poke-write-sec-atom (wrap poke-sec-atom):from-write
++ poke-write-paste (wrap poke-paste):from-write ++ poke-write-paste (wrap poke-paste):from-write
++ poke-write-comment (wrap poke-comment):from-write ++ poke-write-comment (wrap poke-comment):from-write

View File

@ -8,7 +8,7 @@
/+ womb /+ womb
:- %say :- %say
|= $: {now/@da eny/@uvI bec/beak} |= $: {now/@da eny/@uvI bec/beak}
{{who/@ta $~} ref/(unit (each ship mail:womb)) sta/@} {{who/@t $~} ref/(unit (each ship mail:womb)) sta/@}
== ==
:- %womb-invite :- %womb-invite
^- {reference invite}:womb ^- {reference invite}:womb

View File

@ -7,7 +7,7 @@
!: !:
:- %say :- %say
|= $: {now/@da eny/@uvI bec/beak} |= $: {now/@da eny/@uvI bec/beak}
{{pas/@pG who/@ta $~} $~} {{pas/@pG who/@t $~} $~}
== ==
:- %womb-reinvite :- %womb-reinvite
[pas who 3 0 "You have been inivted to Urbit" "This is a re-invite of 3 planets"] [pas who 3 0 "You have been inivted to Urbit" "This is a re-invite of 3 planets"]

View File

@ -0,0 +1,13 @@
::
:::: /hoon/reinvite/hood/gen
::
/? 310
/+ womb
::
::::
!:
:- %say
|= $: {now/@da eny/@uvI bec/beak}
{log/(list {@uvI transaction:womb}) $~}
==
[%womb-replay-log log]

View File

@ -8,7 +8,7 @@
!: !:
:- %say :- %say
|= $: {now/@da eny/@uvI bec/beak} |= $: {now/@da eny/@uvI bec/beak}
{{pas/@pG who/@ta $~} $~} {{pas/@pG who/@t $~} $~}
== ==
:- %womb-reinvite :- %womb-reinvite
=+ [him=(scot %p p.bec) cas=(scot %da now) key=(scot %p pas)] =+ [him=(scot %p p.bec) cas=(scot %da now) key=(scot %p pas)]

View File

@ -186,6 +186,10 @@
++ poke-exit :: ++ poke-exit ::
|=($~ se-abet:(se-blit-all `dill-blit`[%qit ~])) :: XX specific? |=($~ se-abet:(se-blit-all `dill-blit`[%qit ~])) :: XX specific?
:: ::
++ poke-put ::
|= {pax/path txt/@}
se-abet:(se-blit-all [%sav pax txt]) :: XX specific?
::
++ reap-phat :: ++ reap-phat ::
|= {way/wire saw/(unit tang)} |= {way/wire saw/(unit tang)}
=< se-abet =< se-view =< se-abet =< se-view

View File

@ -47,7 +47,7 @@
(managed (trel (foil moon) (foil planet) (foil star))):: (managed (trel (foil moon) (foil planet) (foil star)))::
:: :: :: ::
++ passcode @pG :: 64-bit passcode ++ passcode @pG :: 64-bit passcode
++ mail @ta :: email address ++ mail @t :: email address
++ balance :: invitation balance ++ balance :: invitation balance
$: planets/@ud :: planet count $: planets/@ud :: planet count
stars/@ud :: star count stars/@ud :: star count
@ -112,14 +112,15 @@
{$info wire @p @tas nori} :: fs write (backup) {$info wire @p @tas nori} :: fs write (backup)
:: {$wait $~} :: delay acknowledgment :: {$wait $~} :: delay acknowledgment
{$diff gilt} :: subscription response {$diff gilt} :: subscription response
{$poke wire pear} :: app RPC {$poke wire dock pear} :: app RPC
{$next wire p/ring} :: update private key {$next wire p/ring} :: update private key
{$tick wire p/@pG q/@p} :: save ticket {$tick wire p/@pG q/@p} :: save ticket
{$knew wire p/ship q/will} :: learn will (old pki) {$knew wire p/ship q/will} :: learn will (old pki)
== :: == ::
++ pear :: ++ pear ::
$? {{ship $gmail} {$email mail tape}} :: send email $% {$email mail tape} :: send email
{{ship $hood} {$womb-do-claim mail @p}} :: issue ship {$womb-do-claim mail @p} :: issue ship
{$drum-put path @t} :: log transaction
== :: == ::
++ gilt :: scry result ++ gilt :: scry result
$% {$ships (list ship)} :: $% {$ships (list ship)} ::
@ -129,6 +130,14 @@
{$womb-stat-all (map ship stat)} :: {$womb-stat-all (map ship stat)} ::
== ==
++ move (pair bone card) :: user-level move ++ move (pair bone card) :: user-level move
::
++ transaction :: logged poke
$% {$report her/@p wyl/will}
{$release gal/@ud sta/@ud}
{$claim aut/passcode her/@p}
{$invite ref/reference inv/invite}
{$reinvite aut/passcode inv/invite}
==
-- --
|% |%
++ ames-grab :: XX better ames scry ++ ames-grab :: XX better ames scry
@ -235,12 +244,17 @@
:: :: :: :: :: ::
:::: :: :: :::: :: ::
!: :: :: !: :: ::
=+ replay=|
|= {bowl part} :: main womb work |= {bowl part} :: main womb work
|_ moz/(list move) |_ moz/(list move)
++ abet :: resolve ++ abet :: resolve
^- (quip move *part) ^- (quip move *part)
[(flop moz) +>+<+] [(flop moz) +>+<+]
:: ::
++ teba :: install resolved
|= a/(quip move *part) ^+ +>
+>(moz (flop -.a), +>+<+ +.a)
::
++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card ++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card
++ emil :: return cards ++ emil :: return cards
|= (list card) |= (list card)
@ -525,12 +539,36 @@
:: ::
++ email :: send email ++ email :: send email
|= {wir/wire adr/mail msg/tape} ^+ +> |= {wir/wire adr/mail msg/tape} ^+ +>
?: replay +> :: dont's send email in replay mode
(emit %poke [%mail wir] [our %gmail] %email adr msg) (emit %poke [%mail wir] [our %gmail] %email adr msg)
::~&([%email-stub adr msg] +>) ::~&([%email-stub adr msg] +>)
:: ::
++ log-transaction :: logged poke
|= a/transaction ^+ +>
?: replay +>
(emit %poke /log [our %hood] %drum-put /womb-events/(scot %da now)/hoon (crip <eny a>))
::
++ poke-replay-log :: rerun transactions
=. replay &
|= a/(list {eny/@uvI pok/transaction})
?~ a abet
=. eny eny.i.a
%_ $
a t.a
+>
?- -.pok.i.a
$claim (teba (poke-claim +.pok.i.a))
$invite (teba (poke-invite +.pok.i.a))
$report (teba (poke-report +.pok.i.a))
$release (teba (poke-release +.pok.i.a))
$reinvite (teba (poke-reinvite +.pok.i.a))
==
==
::
++ poke-invite :: create invitation ++ poke-invite :: create invitation
|= {ref/reference inv/invite} |= {ref/reference inv/invite}
=< abet =< abet
=. log-transaction (log-transaction %invite +<)
=. hotel =. hotel
?~ ref hotel ?~ ref hotel
?~ sta.inv hotel ?~ sta.inv hotel
@ -543,17 +581,18 @@
|= {hiz/(list mail) inv/invite} ^+ +> |= {hiz/(list mail) inv/invite} ^+ +>
?> |(=(our src) =([~ src] boss)) :: priveledged ?> |(=(our src) =([~ src] boss)) :: priveledged
=+ pas=`passcode`(shaf %pass eny) =+ pas=`passcode`(shaf %pass eny)
=. bureau ?: (~(has by bureau) pas)
:: ?< (~(has by bureau) pas) :: somewhat unlikely ~|([%duplicate-passcode pas who.inv replay=replay] !!)
(~(put by bureau) pas [pla.inv sta.inv who.inv hiz]) =. bureau (~(put by bureau) pas [pla.inv sta.inv who.inv hiz])
(email /invite who.inv "{intro.wel.inv}: {<pas>}") (email /invite who.inv "{intro.wel.inv}: {<pas>}")
:: ::
:: ++ coup-invite :: invite sent :: ++ coup-invite :: invite sent
:: ::
++ poke-reinvite :: split invitation ++ poke-reinvite :: split invitation
|= {aut/passcode inv/invite} :: further invite |= {aut/passcode inv/invite} :: further invite
?> =(src src) ::
=< abet =< abet
=. log-transaction (log-transaction %reinvite +<)
?> =(src src) :: self-authenticated
=+ ~|(%bad-passcode bal=(~(got by bureau) aut)) =+ ~|(%bad-passcode bal=(~(got by bureau) aut))
=. stars.bal (sub stars.bal sta.inv) =. stars.bal (sub stars.bal sta.inv)
=. planets.bal (sub planets.bal pla.inv) =. planets.bal (sub planets.bal pla.inv)
@ -581,6 +620,7 @@
++ poke-report :: report will ++ poke-report :: report will
|= {her/@p wyl/will} :: |= {her/@p wyl/will} ::
=< abet =< abet
=. log-transaction (log-transaction %report +<)
?> =(src src) :: self-authenticated ?> =(src src) :: self-authenticated
(emit %knew /report her wyl) (emit %knew /report her wyl)
:: ::
@ -605,6 +645,7 @@
++ poke-claim :: claim plot, req ticket ++ poke-claim :: claim plot, req ticket
|= {aut/passcode her/@p} |= {aut/passcode her/@p}
=< abet =< abet
=. log-transaction (log-transaction %claim +<)
?> =(src src) ?> =(src src)
=+ ~|(%bad-passcode bal=(~(got by bureau) aut)) =+ ~|(%bad-passcode bal=(~(got by bureau) aut))
=; claimed =; claimed
@ -646,6 +687,7 @@
++ poke-release :: release to subdivide ++ poke-release :: release to subdivide
|= {gal/@ud sta/@ud} :: |= {gal/@ud sta/@ud} ::
=< abet ^+ +> =< abet ^+ +>
=. log-transaction (log-transaction %release +<)
?> =(our src) :: privileged ?> =(our src) :: privileged
=. +> =. +>
?~ gal +> ?~ gal +>

11
mar/drum-put.hoon Normal file
View File

@ -0,0 +1,11 @@
::
:::: /hoon/do-claim/womb/mar
::
/? 310
|_ {path @}
::
++ grab :: convert from
|%
++ noun {path @} :: clam from %noun
--
--