Steps toward one-step bootstrap.

This commit is contained in:
C. Guy Yarvin 2016-04-10 19:23:29 -07:00
parent dcfd3c9b6b
commit 902fbdf95d
6 changed files with 99 additions and 18 deletions

View File

@ -113,6 +113,7 @@
++ poke-helm-send-ask (wrap poke-send-ask):from-helm
++ poke-helm-verb (wrap poke-verb):from-helm
++ poke-helm-begin (wrap poke-begin):from-helm
++ poke-helm-spawn (wrap poke-spawn):from-helm
++ poke-hood-sync (wrap poke-sync):from-kiln
++ poke-hood-init-sync (wrap poke-init-sync):from-kiln
++ poke-kiln-cp (wrap poke-cp):from-kiln

View File

@ -683,6 +683,8 @@
::
++ sen :: current crypto
^- {p/life q/acru}
?. ?=(^ law.saf)
~|(%send-cold !!)
?~(val.saf !! [p.i.val.saf r.i.val.saf])
::
++ sev :: crypto by life
@ -718,7 +720,13 @@
?:((lth her 256) ~ $(her (sein her)))
-- :: --as:go
::
++ ha !: :: adopt new license
++ la :: hierarchy
|= our/@p
%- flop
|- ^- (list ship)
?:((lth our 256) ~ =+(seg=(sein our) [seg $(our seg)]))
::
++ ha !: :: new ship by mace
|= {our/ship mac/mace wil/will}
^- town
?> !=(~ mac)
@ -731,10 +739,7 @@
urb
%+ ~(put by urb.ton)
our
:* %- flop
|- ^- (list ship)
?:((lth our 256) ~ =+(seg=(sein our) [seg $(our seg)]))
::
:* (la our)
(turn mac |=({p/life q/ring} [p q (weur q)]))
wil
~
@ -742,6 +747,33 @@
==
==
::
++ hi :: new ship by code
|= {our/ship mac/mace key/code}
^- town
%_ ton
urb
%+ ~(put by urb.ton)
our
^- sufi
:* (la our)
(turn mac |=({p/life q/ring} [p q (weur q)]))
~
~
^- (map ship dore)
:_ [~ ~]
:- (sein our)
^- dore
:* *road
~
=+ had=(shaf %hand key)
:* `[had key]
~
[[had key] ~ ~]
==
==
==
==
::
++ su :: install safe
|= new/_as
^- town
@ -989,12 +1021,12 @@
==
++ come :: come:am
|= {ges/(unit @t) wid/@ bur/@ fak/?} :: instantiate pawn
^- {p/{p/ship q/@uvG} q/fort}
^- {p/ship q/fort}
=+ loy=(bruw wid bur)
=+ rig=sec:ex:loy
=+ our=`@p`fig:ex:loy
=+ syp=[[0 ~ our now] [%en %pawn ges] pub:ex:loy]
:- [our pac:ex:loy]
:- our
%_ fox
ton
%^ ~(ha go ton.fox)
@ -1014,12 +1046,36 @@
=+ mac=`mace`[[0 sec:ex:loy] ~]
=+ syp=`step`[`bray`[0 ~ our now] [%en %czar ~] pub:ex:loy]
=+ ded=`deed`[(sign:as:loy *@ (shaf %self (sham syp))) syp fak]
=+ buq=`buck`[mac [ded ~]]
=: ton.fox (~(ha go ton.fox) our buq)
=: ton.fox (~(ha go ton.fox) our mac [ded ~])
zac.fox (~(put by zac.fox) our *corn)
fak.ton.fox fak
==
[[[%beer our pac:ex:loy] ~] fox]
[[[%beer our] ~] fox]
::
++ dude :: dude:am
|= {our/ship key/code fak/?} ::
^- {p/(list boon) q/fort}
~& [%dude +<]
=+ loy=(bruw 2.048 (shax (mix now any.ton.fox)))
=. any.ton.fox (shax any.ton.fox)
=+ mac=`mace`[[0 sec:ex:loy] ~]
=+ ^= gec
^- gcos
=+ rac=(clan our)
?- rac
$czar [%czar ~]
$king [%king (scot %p our)]
$duke [%duke %punk %white (scot %p our)]
$earl [%earl (scot %p our)]
$pawn [%pawn ~]
==
=+ syp=`step`[`bray`[0 ~ our now] [%en gec] pub:ex:loy]
=+ ded=`deed`[0 syp fak]
=: ton.fox (~(hi go ton.fox) our mac key)
zac.fox (~(put by zac.fox) our *corn)
fak.ton.fox fak
==
[[[%bier our ded] ~] fox]
::
++ gnaw :: gnaw:am
|= {kay/cape ryn/lane pac/rock} :: process packet
@ -1058,7 +1114,7 @@
=: ton.fox (~(ha go ton.fox) our buq)
zac.fox (~(put by zac.fox) our *corn)
==
[[[%beer our pac:ex:q:sen:(need (~(us go ton.fox) our))] ~] fox]
[[[%beer our] ~] fox]
::
++ kick :: kick:am
|= hen/duct :: refresh net
@ -1214,7 +1270,7 @@
=+ [mag=`hand`(end 7 1 msg) bod=(rsh 7 1 msg)]
=+ dey=(kuch:diz mag)
?~ dey
:: ~& [%bad-key her mag]
~& [%bad-key her mag]
+>.$ :: ignore unknown key
=. puz (bilk:puz now)
=^ key diz u.dey
@ -1637,13 +1693,24 @@
?- -.bon
$beer
:_ fox(zac (~(put by zac.fox) p.bon `corn`[hen ~ ~ ~]))
:* [hen [%slip %c %init p.bon]]
:~ [hen [%slip %c %init p.bon]]
[hen [%give %init p.bon]]
[hen [%slip %a %kick now]]
[hen [%slip %e %init p.bon]]
[hen [%slip %g %init p.bon]]
[hen [%slip %d %init p.bon]] :: must be after gall
~
==
$bier
:_ fox(zac (~(put by zac.fox) p.bon `corn`[hen ~ ~ ~]))
:~ [hen [%slip %c %init p.bon]]
[hen [%give %init p.bon]]
[hen [%slip %a %kick now]]
[hen [%slip %e %init p.bon]]
[hen [%slip %g %init p.bon]]
[hen [%slip %d %init p.bon]] :: must be after gall
:+ hen
%pass
[~ %g %deal [p.bon (sein p.bon)] %hood %poke %boot !>(`deed`q.bon)]
==
::
$cake
@ -1788,6 +1855,7 @@
q.kyz
[hen %pass pax %g %deal p.kyz %hood %poke %will !>(wyl)]~
?: ?=($funk -.kyz)
~& [%ames-install-ticket +.kyz]
=+ gus=(need (~(us go ton.fox) p.kyz))
=. ton.fox (~(su go ton.fox) (taxi:gus q.kyz r.kyz))
[~ +>.$]
@ -1797,6 +1865,9 @@
=+ ^= fuy
^- {p/(list boon) q/fort}
?- -.kyz
$born
(~(dude am [now fox]) p.kyz q.kyz r.kyz)
::
$barn
[~ fox(gad hen)]
$cash

View File

@ -1185,6 +1185,7 @@
$deal `%g
$exec `%f
$flog `%d
$funk `%a
$drop `%c
$info `%c
$merg `%c

View File

@ -1,5 +1,5 @@
:: ::
:::: /hoon/hoon ::
:::: /hoon/hoon ::
:: ::
=> %150 =>
:: ::

View File

@ -2392,7 +2392,8 @@
== ::
++ boat (map (pair bone wire) (trel bean ship path)) :: outgoing subs
++ boon :: fort output
$% {$beer p/ship q/@uvG} :: gained ownership
$% {$beer p/ship} :: gained ownership
{$bier p/ship q/deed} :: unsigned deed
{$cake p/sock q/soap r/coop s/duct} :: e2e message result
{$coke p/sock q/soap r/cape s/duct} :: message result
{$mead p/lane q/rock} :: accept packet
@ -2795,10 +2796,11 @@
{$woot p/ship q/coop} :: e2e reaction message
== ::
++ kiss-ames :: in request ->$
$% {$barn $~} :: new unix process
$% {$born p/@p q/@pG r/?} :: ticket birth
{$barn $~} :: new unix process
{$crud p/@tas q/(list tank)} :: error with trace
{$cash p/@p q/buck} :: civil license
{$funk p/@p q/@p r/@} :: local symticket
{$funk p/@p q/@p r/@} :: symtix from/to/key
{$hear p/lane q/@} :: receive packet
{$hole p/lane q/@} :: packet failed
{$junk p/@} :: entropy

View File

@ -53,6 +53,7 @@
$% {$cash wire p/@p q/buck} ::
{$conf wire dock $load ship term} ::
{$flog wire flog} ::
{$funk wire @p @p @} ::
{$serv wire ?(desk beam)} ::
{$poke wire dock pear} ::
{$wont wire sock path *} :: send message
@ -83,6 +84,11 @@
%- emit(bur `[his [0 sec:ex:loy]~])
[%wont /helm/ticket [our (sein his)] /a/ta his tic ges pub:ex:loy]
::
++ poke-spawn
|= {him/ship key/@pG} =< abet
%- emit
[%funk ~ our him (shax key)]
::
++ poke-init :: initialize
|= him/ship =< abet
(emit %flog /helm %crud %hax-init leaf+(scow %p him) ~)