diff --git a/pkg/arvo/lib/desk-jam.hoon b/pkg/arvo/lib/desk-jam.hoon index 442c22408..e1f7b2968 100644 --- a/pkg/arvo/lib/desk-jam.hoon +++ b/pkg/arvo/lib/desk-jam.hoon @@ -3,8 +3,8 @@ ++ jam-desk |= [our=ship =desk now=@da] ~> %slog.0^leaf/"jamming desk {}" - =+ .^(=rang:clay %cx /(scot %p our)//(scot %da now)) - =+ .^(=tako:clay %cs /(scot %p our)/[desk]/(scot %da now)) + =+ .^(=rang:clay %cx /(scot %p our)//(scot %da now)/rang) + =+ .^(=tako:clay %cs /(scot %p our)/[desk]/(scot %da now)/tako/~) %- jam %- ?:(=(%base desk) remove-misc-dirs same) %- ~(run by q:(~(got by hut.rang) tako)) diff --git a/pkg/arvo/lib/test/ames-gall.hoon b/pkg/arvo/lib/test/ames-gall.hoon index ac556b47c..6f0af1a12 100644 --- a/pkg/arvo/lib/test/ames-gall.hoon +++ b/pkg/arvo/lib/test/ames-gall.hoon @@ -1,5 +1,5 @@ /+ *test, test-pub, test-sub -/= ames-raw /sys/vane/ames +/= ames-raw /sys/vane/ames /= gall-raw /sys/vane/gall :: =/ ames-bunt (ames-raw ~zod) @@ -187,7 +187,8 @@ ++ load-agent |= [=ship =gall-gate =dude:gall =agent:gall] =^ * gall-gate - (gall-call gall-gate ~[/jolt] [%jolt %base dude] *roof) + %+ gall-call gall-gate + [~[/load] load/[[dude [ship %base da+~1111.1.1] agent]~] *roof] =^ * gall-gate =/ =sign-arvo :+ %clay %writ @@ -195,7 +196,7 @@ %: gall-take gall-gate /sys/cor/[dude]/(scot %p ship)/base/(scot %da ~1111.1.1) - ~[/jolt] + ~[/load] sign-arvo *roof == diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index 8527f3994..529db8070 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1315,6 +1315,9 @@ :: so we can apply configurations on a per-site basis :: [%set-config =http-config] + :: sessions: valid authentication cookie strings + :: + [%sessions ses=(set @t)] :: response: response to an event from earth :: [%response =http-event:http] diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index b9c677a53..bb2c2bd57 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -964,8 +964,14 @@ %- mean %- flop =/ lyn p.hair =/ col q.hair + ^- (list tank) :~ leaf+"syntax error at [{} {}] in {}" - leaf+(trip (snag (dec lyn) (to-wain:format (crip tex)))) + :: + =/ =wain (to-wain:format (crip tex)) + ?: (gth lyn (lent wain)) + '<>' + (snag (dec lyn) wain) + :: leaf+(runt [(dec col) '-'] "^") == :: diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 9aabcda8a..e19f48d60 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -958,6 +958,7 @@ (session-cookie-string session &) :: =; out=[moves=(list move) server-state] + =. moves.out [give-session-tokens moves.out] :: if we didn't have any cookies previously, start the expiry timer :: ?. first-session out @@ -1032,7 +1033,7 @@ ?~ channels =^ moz state (handle-response response) - [(weld moves moz) state] + [[give-session-tokens (weld moves moz)] state] =^ moz state (discard-channel:by-channel i.channels |) $(moves (weld moves moz), channels t.channels) @@ -2116,6 +2117,13 @@ (cury cat 3) ?~ ext.request-line '' (cat 3 '.' u.ext.request-line) + :: +give-session-tokens: send valid session tokens to unix + :: + ++ give-session-tokens + ^- move + :- outgoing-duct.state + =* ses sessions.authentication-state.state + [%give %sessions (~(run in ~(key by ses)) (cury scot %uv))] -- :: ++ forwarded-params @@ -2295,12 +2303,15 @@ =. outgoing-duct.server-state.ax duct :: :_ http-server-gate - ;: weld - :: hand back default configuration for now + :* :: hand back default configuration for now + :: + [duct %give %set-config http-config.server-state.ax] + :: provide a list of valid auth tokens + :: + =< give-session-tokens + (per-server-event [eny duct now rof] server-state.ax) :: - [duct %give %set-config http-config.server-state.ax]~ - :: - closed-connections + closed-connections == :: ?: ?=(%code-changed -.task) @@ -2574,6 +2585,8 @@ :: ^- [(list move) _http-server-gate] :_ http-server-gate + :- =< give-session-tokens + (per-server-event [eny duct now rof] server-state.ax) ?: =(~ sessions) ~ =; next-expiry=@da [duct %pass /sessions/expire %b %wait next-expiry]~ diff --git a/pkg/arvo/ted/eval.hoon b/pkg/arvo/ted/eval.hoon new file mode 100644 index 000000000..0e2eb861d --- /dev/null +++ b/pkg/arvo/ted/eval.hoon @@ -0,0 +1,35 @@ +/- spider +/+ strandio +=, strand=strand:spider +=> +|% ++$ deps (list path) ++$ inpt $@(cord (pair cord deps)) +-- +^- thread:spider +|= raw=vase +=/ m (strand ,vase) +^- form:m +=+ !<(arg=(unit inpt) raw) +?~ arg + (strand-fail:strand %no-input ~) +?@ u.arg + ?~ u.arg + (strand-fail:strand %no-command ~) + (eval-hoon:strandio (ream u.arg) ~) +?~ p.u.arg + (strand-fail:strand %no-command ~) +;< =beak bind:m get-beak:strandio +=/ paz=(list path) q.u.arg +=/ bez=(list beam) ~ +|- +?~ paz + (eval-hoon:strandio (ream p.u.arg) bez) +=/ bem + %+ fall + (de-beam i.paz) + [beak i.paz] +;< has=? bind:m (check-for-file:strandio bem) +?. has + (strand-fail:strand %no-file >bem< ~) +$(paz t.paz, bez [bem bez]) diff --git a/pkg/arvo/ted/khan-eval.hoon b/pkg/arvo/ted/khan-eval.hoon new file mode 100644 index 000000000..fddc71378 --- /dev/null +++ b/pkg/arvo/ted/khan-eval.hoon @@ -0,0 +1,64 @@ +/- spider +/+ strandio +=, strand=strand:spider +=> +|% ++$ deps (list path) ++$ inpt $@(cord (pair cord deps)) +-- +^- thread:spider +|= raw=vase +=/ m (strand ,vase) +^- form:m +=+ !<(arg=(unit inpt) raw) +?~ arg + (strand-fail:strand %no-input ~) +=/ com + ?@ u.arg + u.arg + p.u.arg +?~ com + (strand-fail:strand %no-command ~) +;< =beak bind:m get-beak:strandio +=/ paz=(list path) + ?@ u.arg + ~ + q.u.arg +=/ bez=(list beam) + :~ + [beak /sur/spider/hoon] + [beak /lib/strandio/hoon] + == +=/ =shed:khan + |- + ?~ paz + ;< vax=vase + bind:m + (eval-hoon:strandio (ream com) bez) + !<(shed:khan vax) + =/ bem + %+ fall + (de-beam i.paz) + [beak i.paz] + ;< has=? bind:m (check-for-file:strandio bem) + ?. has + (strand-fail:strand %no-file >bem< ~) + $(paz t.paz, bez [bem bez]) +=/ wir /test/wire +:: TODO: if we're building the thread against user-provided dependencies, can +:: TODO: we always use the default beak here? +;< ~ bind:m (send-thread:strandio beak shed wir) +;< [wer=wire sig=sign-arvo] bind:m take-sign-arvo:strandio +?> =(wir wer) +?> ?=(%khan -.sig) +?> ?=(%arow +<.sig) +=/ vow ,.+>.sig +?- -.vow + %& (pure:m q.p.vow) + %| (strand-fail:strand %child-failed +.vow) +== +:: tests: +:: success +:: -khan-eval '=/ m (strand ,vase) ;< ~ bind:m (poke [~zod %hood] %helm-hi !>(\'\')) (pure:m !>(\'success\'))' +:: failure +:: -khan-eval '=/ m (strand ,vase) ;< vax=vase bind:m (eval-hoon [%zpzp ~] ~) (pure:m !>(\'success\'))' diff --git a/pkg/base-dev/lib/mip.hoon b/pkg/base-dev/lib/mip.hoon new file mode 100644 index 000000000..322a4c85f --- /dev/null +++ b/pkg/base-dev/lib/mip.hoon @@ -0,0 +1,55 @@ +|% +++ mip :: map of maps + |$ [kex key value] + (map kex (map key value)) +:: +++ bi :: mip engine + =| a=(map * (map)) + |@ + ++ del + |* [b=* c=*] + =+ d=(~(gut by a) b ~) + =+ e=(~(del by d) c) + ?~ e + (~(del by a) b) + (~(put by a) b e) + :: + ++ get + |* [b=* c=*] + => .(b `_?>(?=(^ a) p.n.a)`b, c `_?>(?=(^ a) ?>(?=(^ q.n.a) p.n.q.n.a))`c) + ^- (unit _?>(?=(^ a) ?>(?=(^ q.n.a) q.n.q.n.a))) + (~(get by (~(gut by a) b ~)) c) + :: + ++ got + |* [b=* c=*] + (need (get b c)) + :: + ++ gut + |* [b=* c=* d=*] + (~(gut by (~(gut by a) b ~)) c d) + :: + ++ has + |* [b=* c=*] + !=(~ (get b c)) + :: + ++ key + |* b=* + ~(key by (~(gut by a) b ~)) + :: + ++ put + |* [b=* c=* d=*] + %+ ~(put by a) b + %. [c d] + %~ put by + (~(gut by a) b ~) + :: + ++ tap + ::NOTE naive turn-based implementation find-errors ): + =< $ + =+ b=`_?>(?=(^ a) *(list [x=_p.n.a _?>(?=(^ q.n.a) [y=p v=q]:n.q.n.a)]))`~ + |. ^+ b + ?~ a + b + $(a r.a, b (welp (turn ~(tap by q.n.a) (lead p.n.a)) $(a l.a))) + -- +-- diff --git a/pkg/base-dev/lib/sss.hoon b/pkg/base-dev/lib/sss.hoon new file mode 100644 index 000000000..a1a4a4b24 --- /dev/null +++ b/pkg/base-dev/lib/sss.hoon @@ -0,0 +1,248 @@ +/- *sss +/+ *mip +:: +|% +++ mk-subs :: Create sub-map. + |* [=(lake) paths=mold] + -:+6:(da lake paths) +:: +++ mk-pubs :: Create pub-map. + |* [=(lake) paths=mold] + -:+6:(du lake paths) +:: +++ mk-mar :: Create mar. + |* =(lake) + |_ =(response:poke lake *) + ++ grow + |% + ++ noun response + -- + ++ grab + |% + ++ noun (response:poke lake *) + -- + ++ grad %noun + -- +++ fled :: Like +sped but head is a path. + |= vax=vase + ^- vase + :_ q.vax + %- ~(play ut p.vax) + =- [%wtgr [%wtts - [%& 2]~] [%$ 1]] + =/ pax ~| %path-none ;;(path -.q.vax) + |- ^- spec + ?~ pax [%base %null] + [%bccl ~[[%leaf %ta -.pax] $(pax +.pax)]] +:: +++ zoom |= =noun ~| %need-path $/sss/;;(path noun) +:: +++ da :: Manage subscriptions. + |* [=(lake) paths=mold] + => + |% + +$ flow [=aeon fail=_| =rock:lake] + -- + |_ [sub=(map [ship dude paths] flow) =bowl:gall result-type=type on-rock-type=type] + ++ surf pine :: Subscribe to [ship dude path]. + ++ read :: See current subscribed states. + ^- (map [ship dude paths] [fail=? rock:lake]) + %- ~(run by sub) + |= =flow + [fail rock]:flow + :: :: Check poke-acks for errors. + :: :: If an %sss-on-rock poke nacks, + ++ chit :: that state is flagged as failed. + |= [[aeon=term ship=term dude=term path=paths] =sign:agent:gall] + ^+ sub + ?> ?=(%poke-ack -.sign) + ?~ p.sign sub + %+ ~(jab by sub) [(slav %p ship) dude path] + |= =flow + ?> =(aeon.flow (slav %ud aeon)) + flow(fail &) + :: :: Check if we're still interested + :: :: in a wave. If no, no-op. + :: :: If yes, scry. + ++ behn :: (See https://gist.github.com/belisarius222/7f8452bfea9b199c0ed717ab1778f35b) + |= [ship=term =dude aeon=term path=paths] + ^- (list card:agent:gall) + =/ ship (slav %p ship) + =/ aeon (slav %ud aeon) + ?: (lte aeon aeon:(~(got by sub) ship dude path)) ~ + ~[(scry `aeon ship dude path)] + :: + ++ apply :: Handle response from publisher. + |= res=(response:poke lake paths) + ^- (quip card:agent:gall _sub) + ?- type.res + %yore + :_ sub :_ ~ + (pine src.bowl dude.res path.res) + :: + %nigh + :_ sub :_ ~ + (behn-s25 [dude aeon path]:res) + :: + %scry + =* current [src.bowl dude.res path.res] + =/ [wave=(unit wave:lake) =flow] + =/ old=flow (~(gut by sub) current *flow) + ?- what.res + %rock ?> (gte aeon.res aeon.old) + `[aeon.res | rock.res] + %wave ~| [%weird-wave res=res old=old] + ?> =(aeon.res +(aeon.old)) + [`wave.res [aeon.res | (wash:lake rock.old wave.res)]] + == + :_ (~(put by sub) current flow) + %- flop + :~ (scry `+(aeon.res) src.bowl dude.res path.res) + :* %pass (zoom on-rock/(scot %ud aeon.flow)^(scot %p src.bowl)^dude.res^path.res) + %agent [our dap]:bowl + %poke %sss-on-rock on-rock-type ^- from + [path.res src.bowl dude.res rock.flow wave] + == == + == + :: + :: Non-public facing arms below + :: + +$ from (on-rock:poke lake paths) + +$ into (response:poke lake paths) + +$ result (request:poke paths) + ++ behn-s25 + |= [=dude =aeon path=noun] + ^- card:agent:gall + :* %pass (zoom behn/(scot %p src.bowl)^dude^(scot %ud aeon)^path) + %arvo %b %wait (add ~s25 now.bowl) + == + ++ pine |= [ship dude paths] (scry ~ +<) + ++ scry + |= [when=(unit aeon) who=ship which=dude where=paths] + ^- card:agent:gall + =/ when ?~ when %~ (scot %ud u.when) + :* %pass (zoom request/scry/(scot %p who)^which^when^where) + %agent [who which] + %poke %sss-to-pub :- result-type ^- result + [where which ^when] + == + -- +++ du :: Manage publications. + |* [=(lake) paths=mold] + => + |% + +$ rule [rocks=_1 waves=_5] :: Retention policy + +$ tide + $: rok=((mop aeon rock:lake) gte) + wav=((mop aeon wave:lake) lte) + rul=rule + mem=(mip aeon [ship dude] @da) + == + -- + |_ [pub=(map paths tide) =bowl:gall result-type=type] + +* rok ((on aeon rock:lake) gte) + wav ((on aeon wave:lake) lte) + :: + ++ rule :: Set new retention policy. + |= [path=paths =^rule] + ^+ pub + %+ ~(jab by pub) path + |= =tide + (form tide(rul rule)) + :: + ++ wipe :: Create new rock and wipe rest. + |= path=paths + ^+ pub + %+ ~(jab by pub) path + |= =tide + %* . (form tide(rul [0 1])) + rul rul.tide + wav ~ + == + ++ give :: Give a wave on a path. + |= [path=paths =wave:lake] + ^- (quip card:agent:gall _pub) + ?~ ;;((soft ^path) path) ~| %need-path !! + =/ =tide (~(gut by pub) path *tide) + =/ next=aeon + .+ %+ max + (fall (bind (pry:rok rok.tide) head) 0) + (fall (bind (ram:wav wav.tide) head) 0) + :: + :_ %+ ~(put by pub) path + =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok) + =. wav.tide (put:wav wav.tide next wave) + =. mem.tide (~(del by mem.tide) next) + ?. =(next (add aeon.last waves.rul.tide)) tide + (form tide) + :: + %+ murn ~(tap by (~(gut by mem.tide) next ~)) + |= [[=ship =dude] =@da] + ?: (lth da now.bowl) ~ + `(send scry/wave/wave ship dude next path) + ++ read :: See current published states. + ^- (map paths rock:lake) + %- ~(run by pub) + |= =tide + =< rock + =/ snap=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok) + %+ roll (tap:wav (lot:wav wav.tide `aeon.snap ~)) + |= [[=aeon =wave:lake] =_snap] + ?. =(aeon +(aeon.snap)) snap + [aeon (wash:lake rock.snap wave)] + :: + ++ apply :: Handle request from subscriber. + |= req=(request:poke paths) + ^- (quip card:agent:gall _pub) + =/ =tide (~(gut by pub) path.req *tide) + ?~ when.req + =/ last (fall (pry:rok rok.tide) *[=key =val]:rok) + :_ pub :_ ~ + (send scry/rock/val.last src.bowl dude.req key.last path.req) + ?^ dat=(get:wav wav.tide u.when.req) + :_ pub :_ ~ + (send scry/wave/u.dat src.bowl [dude u.when path]:req) + ?. (gth u.when.req key::(fall (ram:wav wav.tide) [key=+(u.when.req) **])) + :_ pub :_ ~ + (send yore/~ src.bowl [dude u.when path]:req) + :- ~[(send nigh/~ src.bowl [dude u.when path]:req)] + %+ ~(put by pub) path.req + %= tide mem + %^ ~(put bi mem.tide) u.when.req [src.bowl dude.req] + (add ~s25 now.bowl) + == + :: + :: Non-public facing arms below + :: + +$ into (request:poke paths) + +$ result (response:poke lake paths) + ++ send + |= [payload=_|3:*(response:poke lake paths) =ship =dude =aeon path=paths] + ^- card:agent:gall + =* mark (cat 3 %sss- name:lake) + :* %pass (zoom response/scry/(scot %p ship)^dude^(scot %ud aeon)^path) + %agent [ship dude] + %poke mark result-type ^- (response:poke lake paths) + [path dap.bowl aeon payload] + == + ++ form + |= =tide + ^+ tide + =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok) + =/ max-wave (fall (bind (ram:wav wav.tide) head) 0) + =. rok.tide + %+ gas:rok +<-:gas:rok + %- tab:rok :_ [~ +(rocks.rul.tide)] + ?: ?| =(waves.rul.tide 0) + (lth max-wave (add aeon.max-rock waves.rul.tide)) + == + rok.tide + %+ put:rok rok.tide + %+ roll (tab:wav wav.tide `aeon.max-rock max-wave) + |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock] + ~| %aeon-awry + ?> =(now +(prev)) + [now (wash:lake rock wave)] + ~| %rock-zero + tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~)) + -- +-- diff --git a/pkg/base-dev/lib/strandio.hoon b/pkg/base-dev/lib/strandio.hoon index 38e3c05d5..1ac0c3122 100644 --- a/pkg/base-dev/lib/strandio.hoon +++ b/pkg/base-dev/lib/strandio.hoon @@ -73,7 +73,9 @@ ^- form:m |= tin=strand-input:strand ?+ in.tin `[%skip ~] - ~ `[%wait ~] + ~ + `[%wait ~] + :: [~ %poke @ *] ?. =(mark p.cage.u.in.tin) `[%skip ~] @@ -87,7 +89,9 @@ ^- form:m |= tin=strand-input:strand ?+ in.tin `[%skip ~] - ~ `[%wait ~] + ~ + `[%wait ~] + :: [~ %sign *] `[%done [wire sign-arvo]:u.in.tin] == @@ -473,6 +477,18 @@ (pure:m ~) ?> =(%vase p.r.u.riot) (pure:m (some !<(vase q.r.u.riot))) +:: +++ build-file-hard + |= [[=ship =desk =case] =spur] + =* arg +< + =/ m (strand ,vase) + ^- form:m + ;< =riot:clay + bind:m + (warp ship desk ~ %sing %a case spur) + ?> ?=(^ riot) + ?> ?=(%vase p.r.u.riot) + (pure:m !<(vase q.r.u.riot)) :: +build-mark: build a mark definition to a $dais :: ++ build-mark @@ -585,6 +601,23 @@ (poke [who %hood] %helm-hi !>(~)) (pure:m ~) :: +++ eval-hoon + |= [gen=hoon bez=(list beam)] + =/ m (strand ,vase) + ^- form:m + =/ sut=vase !>(..zuse) + |- + ?~ bez + (pure:m (slap sut gen)) + ;< vax=vase bind:m (build-file-hard i.bez) + $(bez t.bez, sut (slop vax sut)) +:: +++ send-thread + |= [=bear:khan =shed:khan =wire] + =/ m (strand ,~) + ^- form:m + (send-raw-card %pass wire %arvo %k %lard bear shed) +:: :: Queue on skip, try next on fail %ignore :: ++ main-loop diff --git a/pkg/base-dev/sur/sss.hoon b/pkg/base-dev/sur/sss.hoon new file mode 100644 index 000000000..9533719d7 --- /dev/null +++ b/pkg/base-dev/sur/sss.hoon @@ -0,0 +1,36 @@ +|% +++ lake + |$ [rock wave] + $_ ^? + |% + ++ name *term + +$ rock ^rock + +$ wave ^wave + ++ wash |~ [rock wave] *rock + -- ++$ aeon @ud ++$ dude dude:agent:gall ++$ what ?(%rock %wave) +++ poke + |% + ++ request + |* paths=mold + $: path=paths + =dude + when=(unit aeon) + == + ++ response + |* [=(lake) paths=mold] + $: path=paths + =dude + =aeon + $% [type=?(%nigh %yore) ~] + $: type=%scry + $% [what=%rock =rock:lake] + [what=%wave =wave:lake] + == == == == + ++ on-rock + |* [=(lake) paths=mold] + ,[path=paths src=ship from=dude =rock:lake wave=(unit wave:lake)] + -- +-- diff --git a/tests/sys/grq.hoon b/tests/sys/grq.hoon index 424889b51..c2a45bb0d 100644 --- a/tests/sys/grq.hoon +++ b/tests/sys/grq.hoon @@ -1,505 +1,519 @@ :: test gall subscription nonce incrementation and ames flow killing :: -:: /+ *test, v=test-ames-gall -:: |% -:: ++ test-watch -:: %- run-chain -:: |. :- %| -:: =+ nec-bud:v -:: :: uncomment to turn on verbose debug output -:: ::=^ * ames.nec -:: :: (ames-call:v ames.nec ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) -:: ::=^ * ames.bud -:: :: (ames-call:v ames.bud ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) -:: :: poke %sub to tell it to subscribe -:: =/ =task:gall [%deal [~nec ~nec] %sub %poke watch+!>(~bud)] -:: =^ t1 gall.nec -:: %: gall-check-call:v gall.nec -:: [~1111.1.1 0xdead.beef *roof] -:: [~[/foo] task] -:: :~ :- ~[/foo] [%give %unto %poke-ack ~] -:: :- ~[/init] -:: :* %pass /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: [%g %deal [~nec ~bud] %pub %watch /foo] -:: == == -:: == -:: :- t1 |. :- %| -:: :: handle gall passing the %watch to itself, which passes to ames -:: =^ t2 gall.nec -:: %: gall-check-call:v gall.nec -:: [~1111.1.1 0xdead.beef *roof] -:: :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%deal [~nec ~bud] %pub %watch /foo] -:: :~ :- ~[/init] [%pass /sys/lag %a %heed ~bud] -:: :- ~[/init] [%pass /sys/era %j %public-keys (sy ~bud ~)] -:: :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%pass /sys/way/~bud/pub %a %plea ~bud %g /ge/pub [%0 %s /foo]] -:: == -:: == -:: :- t2 |. :- %| -:: :: subscriber ames handles %plea from gall, gives a packet to vere -:: =^ t3 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.1 0xdead.beef *roof] -:: :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%plea ~bud %g /ge/pub [%0 %s /foo]] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~bud] -:: 0xae59.5b29.277b.22c1.20b7.a8db.9086.46df.31bd.f9bc. -:: 2633.7300.17d4.f5fc.8be5.8bfe.5c9d.36d9.2ea1.7cb3. -:: 8a00.0200.0132.8fd4.f000 -:: == -:: :- ~[/ames] [%pass /pump/~bud/0 %b %wait ~1111.1.1..00.00.01] -:: == -:: == -:: :- t3 |. :- %| -:: :: publisher ames hears %watch, passes to gall -:: =^ t4 ames.bud -:: %: ames-check-call:v ames.bud -:: [~1111.1.2 0xbeef.dead *roof] -:: :- ~[//unix] -:: :* %hear [%& ~nec] -:: 0xae59.5b29.277b.22c1.20b7.a8db.9086.46df.31bd.f9bc. -:: 2633.7300.17d4.f5fc.8be5.8bfe.5c9d.36d9.2ea1.7cb3. -:: 8a00.0200.0132.8fd4.f000 -:: == -:: :~ :- ~[//unix] [%pass /qos %d %flog %text "; ~nec is your neighbor"] -:: :- ~[//unix] -:: [%pass /bone/~nec/0/1 %g %plea ~nec %g /ge/pub [%0 %s /foo]] -:: == -:: == -:: :- t4 |. :- %| -:: :: publisher gall hears %watch from ames, passes to itself -:: =^ t5 gall.bud -:: %: gall-check-call:v gall.bud -:: [~1111.1.2 0xbeef.dead *roof] -:: :- ~[/bone/~nec/0/1 //unix] -:: [%plea ~nec %g /ge/pub [%0 %s /foo]] -:: :~ :- ~[/init] [%pass /sys/lag %a %heed ~nec] -:: :- ~[/init] [%pass /sys/era %j %public-keys (sy ~nec ~)] -:: :- ~[/bone/~nec/0/1 //unix] -:: [%pass /sys/req/~nec/pub %g %deal [~nec ~bud] %pub %watch /foo] -:: == -:: == -:: :- t5 |. :- %| -:: :: publisher gall runs %pub with %watch, gives ack to itself -:: =^ t6 gall.bud -:: %: gall-check-call:v gall.bud -:: [~1111.1.2 0xbeef.dead *roof] -:: :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] -:: [%deal [~nec ~bud] %pub %watch /foo] -:: :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] -:: [%give %unto %watch-ack ~] -:: == -:: == -:: :- t6 |. :- %| -:: :: gall gives ack to ames -:: =^ t7 gall.bud -:: %: gall-check-take:v gall.bud -:: [~1111.1.2 0xbeef.dead *roof] -:: :+ /sys/req/~nec/pub ~[/bone/~nec/0/1 //unix] -:: [%gall %unto %watch-ack ~] -:: :~ :- ~[/bone/~nec/0/1 //unix] [%give %done ~] -:: == -:: == -:: :- t7 |. :- %| -:: :: publisher ames hears ack from gall, sends over the network -:: =^ t8 ames.bud -:: %: ames-check-take:v ames.bud -:: [~1111.1.2 0xbeef.dead *roof] -:: :+ /bone/~nec/0/1 ~[//unix] -:: [%gall %done ~] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~nec] -:: 0x2.0219.8100.0485.5530.3c88.9068.3cc6.484e. -:: 2d9d.076e.6d00.0100.0223.9ae9.5000 -:: == == -:: == -:: :- t8 |. :- %| -:: :: subscriber ames hears watch-ack packet, gives to gall -:: =^ t9 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.3 0xdead.beef *roof] -:: :- ~[//unix] -:: :* %hear [%& ~bud] -:: 0x2.0219.8100.0485.5530.3c88.9068.3cc6.484e. -:: 2d9d.076e.6d00.0100.0223.9ae9.5000 -:: == -:: :~ :- ~[//unix] [%pass /qos %d %flog %text "; ~bud is your neighbor"] -:: :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%give %done ~] -:: :- ~[/ames] [%pass /pump/~bud/0 %b %rest ~1111.1.1..00.00.01] -:: == -:: == -:: :- t9 |. :- %| -:: :: gall gives %done to itself -:: =^ t10 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.3 0xdead.beef *roof] -:: :+ /sys/way/~bud/pub -:: ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%ames %done ~] -:: :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%give %unto %watch-ack ~] -:: == -:: == -:: :- t10 |. :- %| -:: :: gall gives watch-ack to itself -:: =^ t11 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.3 0xdead.beef *roof] -:: :+ /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: ~[/init] -:: [%gall %unto %watch-ack ~] -:: ~ -:: == -:: :- t11 |. :- %| -:: :: start the clog and kick process; give clog to publisher gall -:: =^ t12 gall.bud -:: %: gall-check-take:v gall.bud -:: [~1111.1.4 0xbeef.dead *roof] -:: :+ /sys/lag ~[/init] -:: [%ames %clog ~nec] -:: :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] -:: [%give %unto %kick ~] -:: == -:: == -:: :- t12 |. :- %| -:: :: gall gives %kick %boon to ames -:: =^ t13 gall.bud -:: %: gall-check-take:v gall.bud -:: [~1111.1.4 0xbeef.dead *roof] -:: :+ /sys/req/~nec/pub ~[/bone/~nec/0/1 //unix] -:: [%gall %unto %kick ~] -:: :~ :- ~[/bone/~nec/0/1 //unix] [%give %boon %x ~] -:: == -:: == -:: :- t13 |. :- %| -:: :: ames gives kick over the network -:: =^ t14 ames.bud -:: %: ames-check-take:v ames.bud -:: [~1111.1.4 0xbeef.dead *roof] -:: :+ /bone/~nec/0/1 ~[//unix] -:: [%gall %boon %x ~] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~nec] -:: 0xa1fc.cd35.c730.9a00.07e0.90a2.f87c.3657.935e. -:: 4ca0.801d.3ddc.d400.0100.0223.bc18.1000 -:: == -:: :- ~[/ames] [%pass /pump/~nec/1 %b %wait ~1111.1.4..00.00.01] -:: == -:: == -:: :- t14 |. :- %| -:: :: subscriber ames receives kick, gives to gall and gives ack to unix -:: =^ t15 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :- ~[//unix] -:: :* %hear [%& ~bud] -:: 0xa1fc.cd35.c730.9a00.07e0.90a2.f87c.3657.935e. -:: 4ca0.801d.3ddc.d400.0100.0223.bc18.1000 -:: == -:: :~ :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%give %boon %x ~] -:: :- ~[//unix] -:: :* %give %send [%& ~bud] -:: 0xfe.e208.da00.0491.bf7f.9594.2ddc.0948. -:: 9de0.3906.b678.6e00.0200.0132.e55d.5000 -:: == == -:: == -:: :- t15 |. :- %| -:: :: subscriber gall receives kick %boon from ames, gives to self -:: =^ t16 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :+ /sys/way/~bud/pub -:: ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%ames %boon %x ~] -:: :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%give %unto %kick ~] -:: :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] -:: [%pass /sys/way/~bud/pub %a %cork ~bud] -:: == -:: == -:: :: subscriber gall receives %kick from itself -:: =^ t17 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :+ /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: ~[/init] -:: [%gall %unto %kick ~] -:: :~ :- ~[/init] -:: :* %pass /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: [%g %deal [~nec ~bud] %pub %watch /foo] -:: == == -:: == -:: :- t17 |. :- %| -:: :: gall receives %deal %watch from itself, passes to ames -:: =^ t18 gall.nec -:: %: gall-check-call:v gall.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud /init] -:: [%deal [~nec ~bud] %pub %watch /foo] -:: :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud /init] -:: [%pass /sys/way/~bud/pub %a %plea ~bud %g /ge/pub [%0 %s /foo]] -:: == -:: == -:: :- t18 |. :- %| -:: :: subscriber ames sends new %watch -:: =^ t19 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: /init -:: == -:: [%plea ~bud %g /ge/pub [%0 %s /foo]] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~bud] -:: 0xfe.9174.6d7c.e042.4ea7.cf3c.08da.3acf.68ec.3bd1.1f2c.abfe.f500. -:: 1897.c42e.a3ec.2159.86d6.e2f1.b344.9d06.b600.0200.0132.ebe7.8800 -:: == -:: :- ~[/ames] [%pass /pump/~bud/4 %b %wait ~1111.1.5..00.00.01] -:: == -:: == -:: :- t19 |. :- %| -:: :: subscriber ames sends %cork -:: =^ t20 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.5 0xdead.beef *roof] -:: :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%cork ~bud] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~bud] -:: 0xb.130c.ab37.ca24.49cd.aecb.23ba.70f1.6f1c.4d00.124e.c9a5. -:: 3413.3843.d81c.47c4.7040.6e62.3700.0200.0132.e1ab.9000 -:: == -:: :- ~[/ames] [%pass /pump/~bud/0 %b %wait ~1111.1.5..00.02.00] -:: == -:: == -:: :: publisher ames hears %kick ack -:: :- t20 |. :- %| -:: =^ t21 ames.bud -:: %: ames-check-call:v ames.bud -:: [~1111.1.6 0xbeef.dead *roof] -:: :- ~[//unix] -:: :* %hear [%& ~nec] -:: 0xfe.e208.da00.0491.bf7f.9594.2ddc.0948. -:: 9de0.3906.b678.6e00.0200.0132.e55d.5000 -:: == -:: :~ :- ~[/ames] [%pass /pump/~nec/1 %b %rest ~1111.1.4..00.00.01] -:: == -:: == -:: :: publisher ames hears new %watch -:: :- t21 |. :- %| -:: =^ t22 ames.bud -:: %: ames-check-call:v ames.bud -:: [~1111.1.7 0xbeef.dead *roof] -:: :- ~[//unix] -:: :* %hear [%& ~nec] -:: 0xfe.9174.6d7c.e042.4ea7.cf3c.08da.3acf.68ec.3bd1.1f2c.abfe.f500. -:: 1897.c42e.a3ec.2159.86d6.e2f1.b344.9d06.b600.0200.0132.ebe7.8800 -:: == -:: :~ :- ~[//unix] -:: [%pass /bone/~nec/0/5 %g %plea ~nec %g /ge/pub [%0 %s /foo]] -:: == -:: == -:: :: publisher gall hears new %watch, passes to self -:: :- t22 |. :- %| -:: =^ t23 gall.bud -:: %: gall-check-call:v gall.bud -:: [~1111.1.7 0xbeef.dead *roof] -:: :- ~[/bone/~nec/0/5 //unix] -:: [%plea ~nec %g /ge/pub [%0 %s /foo]] -:: :~ :- ~[/bone/~nec/0/5 //unix] -:: [%pass /sys/req/~nec/pub %g %deal [~nec ~bud] %pub %watch /foo] -:: == -:: == -:: :: publisher gall runs :pub's +on-watch, gives ack to self -:: :- t23 |. :- %| -:: =^ t24 gall.bud -:: %: gall-check-call:v gall.bud -:: [~1111.1.7 0xbeef.dead *roof] -:: :- ~[/sys/req/~nec/pub /bone/~nec/0/5 //unix] -:: [%deal [~nec ~bud] %pub %watch /foo] -:: :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/5 //unix] -:: [%give %unto %watch-ack ~] -:: == -:: == -:: :: publisher gall hears %watch-ack, gives to ames -:: :- t24 |. :- %| -:: =^ t25 gall.bud -:: %: gall-check-take:v gall.bud -:: [~1111.1.7 0xbeef.dead *roof] -:: :+ /sys/req/~nec/pub ~[/bone/~nec/0/5 //unix] -:: [%gall %unto %watch-ack ~] -:: :~ :- ~[/bone/~nec/0/5 //unix] [%give %done ~] -:: == -:: == -:: :: publisher ames hears done from gall, sends over the network -:: :- t25 |. :- %| -:: =^ t26 ames.bud -:: %: ames-check-take:v ames.bud -:: [~1111.1.7 0xbeef.dead *roof] -:: :+ /bone/~nec/0/5 ~[//unix] -:: [%gall %done ~] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~nec] -:: 0x5f5.c27c.c400.0587.8b0d.0a5d.eb8e.39fa. -:: 49f4.4848.bfa6.f600.0100.0223.c98c.8800 -:: == == -:: == -:: :: publisher ames hears %cork, passes to itself -:: :- t26 |. :- %| -:: =^ t27 ames.bud -:: %: ames-check-call:v ames.bud -:: [~1111.1.8 0xbeef.dead *roof] -:: :- ~[//unix] -:: :* %hear [%& ~nec] -:: 0xb.130c.ab37.ca24.49cd.aecb.23ba.70f1.6f1c.4d00.124e.c9a5. -:: 3413.3843.d81c.47c4.7040.6e62.3700.0200.0132.e1ab.9000 -:: == -:: :~ :- ~[//unix] [%pass /bone/~nec/0/1 %a %plea ~nec [%a /close ~]] -:: == -:: == -:: :- t27 |. :- %| -:: :: publisher ames hear cork plea from self, give %done to self -:: =^ t28 ames.bud -:: %: ames-check-call:v ames.bud -:: [~1111.1.8 0xbeef.dead *roof] -:: :- ~[/bone/~nec/0/1 //unix] -:: [%plea ~nec [%a /close ~]] -:: :~ :- ~[/bone/~nec/0/1 //unix] [%give %done ~] -:: == -:: == -:: :: publisher ames hears cork done from self, sends ack packet -:: :- t28 |. :- %| -:: =^ t29 ames.bud -:: %: ames-check-take:v ames.bud -:: [~1111.1.8 0xbeef.dead *roof] -:: :+ /bone/~nec/0/1 -:: ~[//unix] -:: [%ames %done ~] -:: :~ :- ~[//unix] -:: :* %give %send [%& ~nec] -:: 0x5f.f966.8e00.0449.bdec.9006.c7e5.1237. -:: 1d87.53fe.d7bb.ad00.0100.0223.c6a8.5800 -:: == == -:: == -:: :: subscriber ames hears %watch-ack, gives to gall -:: :- t29 |. :- %| -:: =^ t30 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.9 0xdead.beef *roof] -:: :- ~[//unix] -:: :* %hear [%& ~bud] -:: 0x5f5.c27c.c400.0587.8b0d.0a5d.eb8e.39fa. -:: 49f4.4848.bfa6.f600.0100.0223.c98c.8800 -:: == -:: :~ :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: /init -:: == -:: [%give %done ~] -:: :- ~[/ames] [%pass /pump/~bud/4 %b %rest ~1111.1.5..00.00.01] -:: == -:: == -:: :: subscriber gall hears new %watch-ack from ames, gives to self -:: :- t30 |. :- %| -:: =^ t31 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.9 0xdead.beef *roof] -:: :+ /sys/way/~bud/pub -:: :~ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: /init -:: == -:: [%ames %done ~] -:: :~ :- :~ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: /init -:: == -:: [%give %unto %watch-ack ~] -:: == -:: == -:: :: subscriber gall hears new %watch-ack from self, tells :sub -:: :- t31 |. :- %| -:: =^ t32 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.9 0xdead.beef *roof] -:: :+ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud -:: ~[/init] -:: [%gall %unto %watch-ack ~] -:: ~ -:: == -:: :: subscriber ames hears %cork ack -:: :- t32 |. :- %| -:: =^ t33 ames.nec -:: %: ames-check-call:v ames.nec -:: [~1111.1.10 0xdead.beef *roof] -:: :- ~[//unix] -:: :* %hear [%& ~bud] -:: 0x5f.f966.8e00.0449.bdec.9006.c7e5.1237. -:: 1d87.53fe.d7bb.ad00.0100.0223.c6a8.5800 -:: == -:: :~ :- :~ /sys/way/~bud/pub -:: /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%give %done ~] -:: :- ~[/ames] [%pass /pump/~bud/0 %b %rest ~1111.1.5..00.02.00] -:: == -:: == -:: :: subscriber gall hears %cork ack from ames -:: :- t33 |. :- %| -:: =^ t34 gall.nec -:: %: gall-check-take:v gall.nec -:: [~1111.1.10 0xdead.beef *roof] -:: :+ /sys/way/~bud/pub -:: :~ /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud -:: /init -:: == -:: [%ames %done ~] -:: ~ -:: == -:: :- t34 |. :- %& -:: ;: weld -:: %+ expect-eq -:: !> (sy 0 ~) -:: !> =< corked -:: %: ames-scry-peer:v -:: ames.nec -:: [~1111.1.10 0xdead.beef *roof] -:: [~nec ~bud] -:: == -:: :: -:: %+ expect-eq -:: !> (sy 1 ~) -:: !> =< corked -:: %: ames-scry-peer:v -:: ames.bud -:: [~1111.1.8 0xbeef.dead *roof] -:: [~bud ~nec] -:: == -:: :: -:: %+ expect-eq -:: !> 2 -:: !> %: gall-scry-nonce:v -:: gall.nec -:: [~1111.1.10 0xdead.beef *roof] -:: ~nec %sub -:: [~bud %pub /sub-foo/~bud] -:: == -:: == -:: -- -~ +/+ *test, v=test-ames-gall +|% +++ test-watch + %- run-chain + |. :- %| + =+ nec-bud:v + :: uncomment to turn on verbose debug output + ::=^ * ames.nec + :: (ames-call:v ames.nec ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) + ::=^ * ames.bud + :: (ames-call:v ames.bud ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof) + :: poke %sub to tell it to subscribe + ~& > 'poke %sub to tell it to subscribe' + =/ =task:gall [%deal [~nec ~nec] %sub %poke watch+!>(~bud)] + =^ t1 gall.nec + %: gall-check-call:v gall.nec + [~1111.1.1 0xdead.beef *roof] + [~[/foo] task] + :~ :- ~[/foo] [%give %unto %poke-ack ~] + :- ~[/init] + :* %pass /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + [%g %deal [~nec ~bud] %pub %watch /foo] + == == + == + :- t1 |. :- %| + :: handle gall passing the %watch to itself, which passes to ames + ~& > 'handle gall passing the %watch to itself, which passes to ames' + =^ t2 gall.nec + %: gall-check-call:v gall.nec + [~1111.1.1 0xdead.beef *roof] + :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%deal [~nec ~bud] %pub %watch /foo] + :~ :- ~[/init] [%pass /sys/lag %a %heed ~bud] + :- ~[/init] [%pass /sys/era %j %public-keys (sy ~bud ~)] + :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%pass /sys/way/~bud/pub %a %plea ~bud %g /ge/pub [%0 %s /foo]] + == + == + :- t2 |. :- %| + :: subscriber ames handles %plea from gall, gives a packet to vere + ~& > 'subscriber ames handles %plea from gall, gives a packet to vere' + =^ t3 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.1 0xdead.beef *roof] + :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + /init + == + [%plea ~bud %g /ge/pub [%0 %s /foo]] + :~ :- ~[//unix] + :* %give %send [%& ~bud] + 0xae59.5b29.277b.22c1.20b7.a8db.9086.46df.31bd.f9bc. + 2633.7300.17d4.f5fc.8be5.8bfe.5c9d.36d9.2ea1.7cb3. + 8a00.0200.0132.8fd4.f000 + == + :- ~[/ames] [%pass /pump/~bud/0 %b %wait ~1111.1.1..00.00.01] + == + == + :- t3 |. :- %| + :: publisher ames hears %watch, passes to gall + ~& > 'publisher ames hears %watch, passes to gall' + =^ t4 ames.bud + %: ames-check-call:v ames.bud + [~1111.1.2 0xbeef.dead *roof] + :- ~[//unix] + :* %hear [%& ~nec] + 0xae59.5b29.277b.22c1.20b7.a8db.9086.46df.31bd.f9bc. + 2633.7300.17d4.f5fc.8be5.8bfe.5c9d.36d9.2ea1.7cb3. + 8a00.0200.0132.8fd4.f000 + == + :~ :- ~[//unix] [%pass /qos %d %flog %text "; ~nec is your neighbor"] + :- ~[//unix] + [%pass /bone/~nec/0/1 %g %plea ~nec %g /ge/pub [%0 %s /foo]] + == + == + :- t4 |. :- %| + :: publisher gall hears %watch from ames, passes to itself + ~& > 'publisher gall hears %watch from ames, passes to itself' + =^ t5 gall.bud + %: gall-check-call:v gall.bud + [~1111.1.2 0xbeef.dead *roof] + :- ~[/bone/~nec/0/1 //unix] + [%plea ~nec %g /ge/pub [%0 %s /foo]] + :~ :- ~[/init] [%pass /sys/lag %a %heed ~nec] + :- ~[/init] [%pass /sys/era %j %public-keys (sy ~nec ~)] + :- ~[/bone/~nec/0/1 //unix] + [%pass /sys/req/~nec/pub %g %deal [~nec ~bud] %pub %watch /foo] + == + == + :- t5 |. :- %| + :: publisher gall runs %pub with %watch, gives ack to itself + ~& > 'publisher gall runs %pub with %watch, gives ack to itself' + =^ t6 gall.bud + %: gall-check-call:v gall.bud + [~1111.1.2 0xbeef.dead *roof] + :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] + [%deal [~nec ~bud] %pub %watch /foo] + :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] + [%give %unto %watch-ack ~] + == + == + :- t6 |. :- %| + :: gall gives ack to ames + ~& > 'gall gives ack to ames' + =^ t7 gall.bud + %: gall-check-take:v gall.bud + [~1111.1.2 0xbeef.dead *roof] + :+ /sys/req/~nec/pub ~[/bone/~nec/0/1 //unix] + [%gall %unto %watch-ack ~] + :~ :- ~[/bone/~nec/0/1 //unix] [%give %done ~] + == + == + :- t7 |. :- %| + :: publisher ames hears ack from gall, sends over the network + ~& > 'publisher ames hears ack from gall, sends over the network' + =^ t8 ames.bud + %: ames-check-take:v ames.bud + [~1111.1.2 0xbeef.dead *roof] + :+ /bone/~nec/0/1 ~[//unix] + [%gall %done ~] + :~ :- ~[//unix] + :* %give %send [%& ~nec] + 0x2.0219.8100.0485.5530.3c88.9068.3cc6.484e. + 2d9d.076e.6d00.0100.0223.9ae9.5000 + == == + == + :- t8 |. :- %| + :: subscriber ames hears watch-ack packet, gives to gall + ~& > 'subscriber ames hears watch-ack packet, gives to gall' + =^ t9 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.3 0xdead.beef *roof] + :- ~[//unix] + :* %hear [%& ~bud] + 0x2.0219.8100.0485.5530.3c88.9068.3cc6.484e. + 2d9d.076e.6d00.0100.0223.9ae9.5000 + == + :~ :- ~[//unix] [%pass /qos %d %flog %text "; ~bud is your neighbor"] + :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + /init + == + [%give %done ~] + :- ~[/ames] [%pass /pump/~bud/0 %b %rest ~1111.1.1..00.00.01] + == + == + :- t9 |. :- %| + :: gall gives %done to itself + ~& > 'gall gives %done to itself' + =^ t10 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.3 0xdead.beef *roof] + :+ /sys/way/~bud/pub + ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%ames %done ~] + :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%give %unto %watch-ack ~] + == + == + :- t10 |. :- %| + :: gall gives watch-ack to itself + ~& > 'gall gives watch-ack to itself' + =^ t11 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.3 0xdead.beef *roof] + :+ /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + ~[/init] + [%gall %unto %watch-ack ~] + ~ + == + :- t11 |. :- %| + :: start the clog and kick process; give clog to publisher gall + ~& > 'start the clog and kick process; give clog to publisher gall' + =^ t12 gall.bud + %: gall-check-take:v gall.bud + [~1111.1.4 0xbeef.dead *roof] + :+ /sys/lag ~[/init] + [%ames %clog ~nec] + :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/1 //unix] + [%give %unto %kick ~] + == + == + :- t12 |. :- %| + :: gall gives %kick %boon to ames + ~& > 'gall gives %kick %boon to ames' + =^ t13 gall.bud + %: gall-check-take:v gall.bud + [~1111.1.4 0xbeef.dead *roof] + :+ /sys/req/~nec/pub ~[/bone/~nec/0/1 //unix] + [%gall %unto %kick ~] + :~ :- ~[/bone/~nec/0/1 //unix] [%give %boon %x ~] + == + == + :- t13 |. :- %| + :: ames gives kick over the network + ~& > 'ames gives kick over the network' + =^ t14 ames.bud + %: ames-check-take:v ames.bud + [~1111.1.4 0xbeef.dead *roof] + :+ /bone/~nec/0/1 ~[//unix] + [%gall %boon %x ~] + :~ :- ~[//unix] + :* %give %send [%& ~nec] + 0xa1fc.cd35.c730.9a00.07e0.90a2.f87c.3657.935e. + 4ca0.801d.3ddc.d400.0100.0223.bc18.1000 + == + :- ~[/ames] [%pass /pump/~nec/1 %b %wait ~1111.1.4..00.00.01] + == + == + :- t14 |. :- %| + :: subscriber ames receives kick, gives to gall and gives ack to unix + ~& > 'subscriber ames receives kick, gives to gall and gives ack to unix' + =^ t15 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.5 0xdead.beef *roof] + :- ~[//unix] + :* %hear [%& ~bud] + 0xa1fc.cd35.c730.9a00.07e0.90a2.f87c.3657.935e. + 4ca0.801d.3ddc.d400.0100.0223.bc18.1000 + == + :~ :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + /init + == + [%give %boon %x ~] + :- ~[//unix] + :* %give %send [%& ~bud] + 0xfe.e208.da00.0491.bf7f.9594.2ddc.0948. + 9de0.3906.b678.6e00.0200.0132.e55d.5000 + == == + == + :- t15 |. :- %| + :: subscriber gall receives kick %boon from ames, gives to self + ~& > 'subscriber gall receives kick %boon from ames, gives to self' + =^ t16 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.5 0xdead.beef *roof] + :+ /sys/way/~bud/pub + ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%ames %boon %x ~] + :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%give %unto %kick ~] + :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud /init] + [%pass /sys/way/~bud/pub %a %cork ~bud] + == + == + :: subscriber gall receives %kick from itself + ~& > 'subscriber gall receives %kick from itself' + =^ t17 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.5 0xdead.beef *roof] + :+ /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + ~[/init] + [%gall %unto %kick ~] + :~ :- ~[/init] + :* %pass /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + [%g %deal [~nec ~bud] %pub %watch /foo] + == == + == + :- t17 |. :- %| + :: gall receives %deal %watch from itself, passes to ames + ~& > 'gall receives %deal %watch from itself, passes to ames' + =^ t18 gall.nec + %: gall-check-call:v gall.nec + [~1111.1.5 0xdead.beef *roof] + :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud /init] + [%deal [~nec ~bud] %pub %watch /foo] + :~ :- ~[/use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud /init] + [%pass /sys/way/~bud/pub %a %plea ~bud %g /ge/pub [%0 %s /foo]] + == + == + :- t18 |. :- %| + :: subscriber ames sends new %watch + ~& > 'subscriber ames sends new %watch' + =^ t19 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.5 0xdead.beef *roof] + :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + /init + == + [%plea ~bud %g /ge/pub [%0 %s /foo]] + :~ :- ~[//unix] + :* %give %send [%& ~bud] + 0xfe.9174.6d7c.e042.4ea7.cf3c.08da.3acf.68ec.3bd1.1f2c.abfe.f500. + 1897.c42e.a3ec.2159.86d6.e2f1.b344.9d06.b600.0200.0132.ebe7.8800 + == + :- ~[/ames] [%pass /pump/~bud/4 %b %wait ~1111.1.5..00.00.01] + == + == + :- t19 |. :- %| + :: subscriber ames sends %cork + ~& > 'subscriber ames sends %cork' + =^ t20 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.5 0xdead.beef *roof] + :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/1/sub-foo/~bud + /init + == + [%cork ~bud] + :~ :- ~[//unix] + :* %give %send [%& ~bud] + 0xb.130c.ab37.ca24.49cd.aecb.23ba.70f1.6f1c.4d00.124e.c9a5. + 3413.3843.d81c.47c4.7040.6e62.3700.0200.0132.e1ab.9000 + == + :- ~[/ames] [%pass /pump/~bud/0 %b %wait ~1111.1.5..00.02.00] + == + == + :: publisher ames hears %kick ack + ~& > 'publisher ames hears %kick ack' + :- t20 |. :- %| + =^ t21 ames.bud + %: ames-check-call:v ames.bud + [~1111.1.6 0xbeef.dead *roof] + :- ~[//unix] + :* %hear [%& ~nec] + 0xfe.e208.da00.0491.bf7f.9594.2ddc.0948. + 9de0.3906.b678.6e00.0200.0132.e55d.5000 + == + :~ :- ~[/ames] [%pass /pump/~nec/1 %b %rest ~1111.1.4..00.00.01] + == + == + :: publisher ames hears new %watch + ~& > 'publisher ames hears new %watch' + :- t21 |. :- %| + =^ t22 ames.bud + %: ames-check-call:v ames.bud + [~1111.1.7 0xbeef.dead *roof] + :- ~[//unix] + :* %hear [%& ~nec] + 0xfe.9174.6d7c.e042.4ea7.cf3c.08da.3acf.68ec.3bd1.1f2c.abfe.f500. + 1897.c42e.a3ec.2159.86d6.e2f1.b344.9d06.b600.0200.0132.ebe7.8800 + == + :~ :- ~[//unix] + [%pass /bone/~nec/0/5 %g %plea ~nec %g /ge/pub [%0 %s /foo]] + == + == + :: publisher gall hears new %watch, passes to self + ~& > 'publisher gall hears new %watch, passes to self' + :- t22 |. :- %| + =^ t23 gall.bud + %: gall-check-call:v gall.bud + [~1111.1.7 0xbeef.dead *roof] + :- ~[/bone/~nec/0/5 //unix] + [%plea ~nec %g /ge/pub [%0 %s /foo]] + :~ :- ~[/bone/~nec/0/5 //unix] + [%pass /sys/req/~nec/pub %g %deal [~nec ~bud] %pub %watch /foo] + == + == + :: publisher gall runs :pub's +on-watch, gives ack to self + ~& > 'publisher gall runs :pub\'s +on-watch, gives ack to self' + :- t23 |. :- %| + =^ t24 gall.bud + %: gall-check-call:v gall.bud + [~1111.1.7 0xbeef.dead *roof] + :- ~[/sys/req/~nec/pub /bone/~nec/0/5 //unix] + [%deal [~nec ~bud] %pub %watch /foo] + :~ :- ~[/sys/req/~nec/pub /bone/~nec/0/5 //unix] + [%give %unto %watch-ack ~] + == + == + :: publisher gall hears %watch-ack, gives to ames + ~& > 'publisher gall hears %watch-ack, gives to ames' + :- t24 |. :- %| + =^ t25 gall.bud + %: gall-check-take:v gall.bud + [~1111.1.7 0xbeef.dead *roof] + :+ /sys/req/~nec/pub ~[/bone/~nec/0/5 //unix] + [%gall %unto %watch-ack ~] + :~ :- ~[/bone/~nec/0/5 //unix] [%give %done ~] + == + == + :: publisher ames hears done from gall, sends over the network + ~& > 'publisher ames hears done from gall, sends over the network' + :- t25 |. :- %| + =^ t26 ames.bud + %: ames-check-take:v ames.bud + [~1111.1.7 0xbeef.dead *roof] + :+ /bone/~nec/0/5 ~[//unix] + [%gall %done ~] + :~ :- ~[//unix] + :* %give %send [%& ~nec] + 0x5f5.c27c.c400.0587.8b0d.0a5d.eb8e.39fa. + 49f4.4848.bfa6.f600.0100.0223.c98c.8800 + == == + == + :: publisher ames hears %cork, passes to itself + ~& > 'publisher ames hears %cork, passes to itself' + :- t26 |. :- %| + =^ t27 ames.bud + %: ames-check-call:v ames.bud + [~1111.1.8 0xbeef.dead *roof] + :- ~[//unix] + :* %hear [%& ~nec] + 0xb.130c.ab37.ca24.49cd.aecb.23ba.70f1.6f1c.4d00.124e.c9a5. + 3413.3843.d81c.47c4.7040.6e62.3700.0200.0132.e1ab.9000 + == + :~ :- ~[//unix] [%pass /bone/~nec/0/1 %a %plea ~nec [%a /close ~]] + == + == + :- t27 |. :- %| + :: publisher ames hear cork plea from self, give %done to self + ~& > 'publisher ames hear cork plea from self, give %done to self' + =^ t28 ames.bud + %: ames-check-call:v ames.bud + [~1111.1.8 0xbeef.dead *roof] + :- ~[/bone/~nec/0/1 //unix] + [%plea ~nec [%a /close ~]] + :~ :- ~[/bone/~nec/0/1 //unix] [%give %done ~] + == + == + :: publisher ames hears cork done from self, sends ack packet + ~& > 'publisher ames hears cork done from self, sends ack packet' + :- t28 |. :- %| + =^ t29 ames.bud + %: ames-check-take:v ames.bud + [~1111.1.8 0xbeef.dead *roof] + :+ /bone/~nec/0/1 + ~[//unix] + [%ames %done ~] + :~ :- ~[//unix] + :* %give %send [%& ~nec] + 0x5f.f966.8e00.0449.bdec.9006.c7e5.1237. + 1d87.53fe.d7bb.ad00.0100.0223.c6a8.5800 + == == + == + :: subscriber ames hears %watch-ack, gives to gall + ~& > 'subscriber ames hears %watch-ack, gives to gall' + :- t29 |. :- %| + =^ t30 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.9 0xdead.beef *roof] + :- ~[//unix] + :* %hear [%& ~bud] + 0x5f5.c27c.c400.0587.8b0d.0a5d.eb8e.39fa. + 49f4.4848.bfa6.f600.0100.0223.c98c.8800 + == + :~ :- :~ /sys/way/~bud/pub + /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + /init + == + [%give %done ~] + :- ~[/ames] [%pass /pump/~bud/4 %b %rest ~1111.1.5..00.00.01] + == + == + :: subscriber gall hears new %watch-ack from ames, gives to self + ~& > 'subscriber gall hears new %watch-ack from ames, gives to self' + :- t30 |. :- %| + =^ t31 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.9 0xdead.beef *roof] + :+ /sys/way/~bud/pub + :~ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + /init + == + [%ames %done ~] + :~ :- :~ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + /init + == + [%give %unto %watch-ack ~] + == + == + :: subscriber gall hears new %watch-ack from self, tells :sub + ~& > 'subscriber gall hears new %watch-ack from self, tells :sub' + :- t31 |. :- %| + =^ t32 gall.nec + %: gall-check-take:v gall.nec + [~1111.1.9 0xdead.beef *roof] + :+ /use/sub/0w1.d6Isf/out/~bud/pub/2/sub-foo/~bud + ~[/init] + [%gall %unto %watch-ack ~] + ~ + == + :: subscriber ames hears %cork ack + ~& > 'subscriber ames hears %cork ack' + :- t32 |. :- %| + =^ t33 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.10 0xdead.beef *roof] + :- ~[//unix] + :* %hear [%& ~bud] + 0x5f.f966.8e00.0449.bdec.9006.c7e5.1237. + 1d87.53fe.d7bb.ad00.0100.0223.c6a8.5800 + == + [~[/ames] [%pass /pump/~bud/0 %b %rest ~1111.1.5..00.02.00]]~ + == + :- t33 |. :- %& + ;: weld + %+ expect-eq + !> (sy 0 ~) + !> =< corked + %: ames-scry-peer:v + ames.nec + [~1111.1.10 0xdead.beef *roof] + [~nec ~bud] + == + :: + %+ expect-eq + !> (sy 1 ~) + !> =< corked + %: ames-scry-peer:v + ames.bud + [~1111.1.8 0xbeef.dead *roof] + [~bud ~nec] + == + :: + %+ expect-eq + !> 2 + !> %: gall-scry-nonce:v + gall.nec + [~1111.1.10 0xdead.beef *roof] + ~nec %sub + [~bud %pub /sub-foo/~bud] + == + == +-- diff --git a/tests/sys/vane/eyre.hoon b/tests/sys/vane/eyre.hoon index f8fd9ba0f..10802f190 100644 --- a/tests/sys/vane/eyre.hoon +++ b/tests/sys/vane/eyre.hoon @@ -7,27 +7,14 @@ :: |% ++ test-init - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == - :: - results1 + -:perform-init +:: +++ test-born + -:(perform-born eyre-gate) :: ++ test-overwrite-bindings :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -57,14 +44,7 @@ :: ++ test-remove-binding :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -130,14 +110,7 @@ :: ++ test-builtin-four-oh-four :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: when there's no configuration and nothing matches, expect 404 :: =^ results2 eyre-gate @@ -173,14 +146,7 @@ :: ++ test-basic-app-request :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -266,14 +232,7 @@ :: ++ test-app-error :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -369,14 +328,7 @@ :: ++ test-multipart-app-request :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -484,17 +436,11 @@ :: ++ test-login-handler-full-path :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init + =^ results2 eyre-gate (perform-born eyre-gate) :: app1 binds successfully :: - =^ results2 eyre-gate + =^ results3 eyre-gate %- eyre-call :* eyre-gate now=~1111.1.2 @@ -504,7 +450,7 @@ == :: outside requests a path that app1 has bound to :: - =^ results3 eyre-gate + =^ results4 eyre-gate %- eyre-call-with-comparator :* eyre-gate now=~1111.1.3 @@ -550,7 +496,7 @@ == :: app then gives a redirect to Eyre :: - =^ results4 eyre-gate + =^ results5 eyre-gate %- eyre-take :* eyre-gate now=~1111.1.4 @@ -569,7 +515,7 @@ == == == :: the browser then fetches the login page :: - =^ results5 eyre-gate + =^ results6 eyre-gate %- perform-authentication :* eyre-gate now=~1111.1.5 @@ -577,7 +523,7 @@ == :: going back to the original url will acknowledge the authentication cookie :: - =^ results6 eyre-gate + =^ results7 eyre-gate %- eyre-call-with-comparator :* eyre-gate now=~1111.1.5..1.0.0 @@ -644,18 +590,12 @@ results4 results5 results6 + results7 == :: ++ test-generator :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: gen1 binds successfully :: =^ results2 eyre-gate @@ -783,14 +723,7 @@ :: ++ test-channel-reject-unauthenticated :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: =^ results2 eyre-gate %- eyre-call :* @@ -1873,14 +1806,7 @@ :: ++ test-born-sends-pending-cancels :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init :: app1 binds successfully :: =^ results2 eyre-gate @@ -1951,15 +1877,15 @@ |= moves=(list move:eyre-gate) ^- tang :: - ?. ?=([^ ^ ~] moves) + ?. ?=([^ ^ ^ ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: - :: we don't care about the first one, which is just a static - :: configuration move. + :: we don't care about the first two, which are just + :: configuration moves. :: - =/ move=move:eyre-gate i.t.moves - =/ =duct duct.move - =/ card=(wind note:eyre-gate gift:eyre-gate) card.move + =/ =move:eyre-gate i.t.t.moves + =/ =duct duct.move + =/ card card.move :: %+ weld (expect-eq !>(~[/http-blah]) !>(duct)) @@ -2126,6 +2052,30 @@ :: todo: handle other deals :: [%leaf "unexpected %deal type"]~ +:: +perfom-init: %init a new eyre-gate +:: +++ perform-init + %- eyre-call :* + eyre-gate + now=~1111.1.1 + scry=scry-provides-code + call-args=[duct=~[/init] ~ [%init ~]] + expected-moves=~ + == +:: +perform-born: %born an eyre-gate +:: +++ perform-born + |= =_eyre-gate + %- eyre-call :* + eyre-gate + new=~1111.1.1 + scry=scry-provides-code + call-args=[duct=~[/unix] ~ [%born ~]] + ^= expected-moves + :~ [duct=~[/unix] %give %set-config *http-config:eyre] + [duct=~[/unix] %give %sessions ~] + == + == :: +perform-authentication: goes through the authentication flow :: ++ perform-authentication @@ -2185,6 +2135,9 @@ :~ ::NOTE this ~d7 is tied to the eyre-internal +session-timeout... :- duct=~[/http-blah] [%pass p=/sessions/expire q=[%b [%wait p=(add start-now ~d7.m1)]]] + :: + =+ token='0v3.q0p7t.mlkkq.cqtto.p0nvi.2ieea' + [duct=~[/unix] %give %sessions [token ~ ~]] :: :* duct=~[/http-blah] %give @@ -2209,17 +2162,11 @@ == ^- [tang _eyre-gate] :: - =^ results1 eyre-gate - %- eyre-call :* - eyre-gate - now=~1111.1.1 - scry=scry-provides-code - call-args=[duct=~[/init] ~ [%init ~]] - expected-moves=~ - == + =^ results1 eyre-gate perform-init + =^ results2 eyre-gate (perform-born eyre-gate) :: ensure there's an authenticated session :: - =^ results2 eyre-gate + =^ results3 eyre-gate %- perform-authentication :* eyre-gate now=~1111.1.2 @@ -2227,7 +2174,7 @@ == :: send the channel a poke and a subscription request :: - =^ results3 eyre-gate + =^ results4 eyre-gate %- eyre-call-with-comparator :* eyre-gate now=~1111.1.2 @@ -2293,7 +2240,7 @@ == == :: :_ eyre-gate - :(weld results1 results2 results3) + :(weld results1 results2 results3 results4) :: ++ scry-provides-code ^- roof |= [gang =view =beam]