helm, docket: bind /who endpoint in helm instead

This seems like a better place.
This commit is contained in:
fang 2021-12-17 00:42:57 +01:00
parent 81f1d816e0
commit 970075bbcd
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
3 changed files with 43 additions and 31 deletions

View File

@ -2,27 +2,28 @@
/+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln /+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln
|% |%
+$ state +$ state
$~ [%22 *state:drum *state:helm *state:kiln] $~ [%23 *state:drum *state:helm *state:kiln]
$>(%22 any-state) $>(%23 any-state)
:: ::
+$ any-state +$ any-state
$% [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)] $% [ver=?(%1 %2 %3 %4 %5 %6) lac=(map @tas fin-any-state)]
[%7 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%7 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%8 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%8 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%9 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%9 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%10 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%10 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%11 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%11 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%12 drum=state-2:drum helm=state:helm kiln=state-0:kiln] [%12 drum=state-2:drum helm=state-1:helm kiln=state-0:kiln]
[%13 drum=state-2:drum helm=state:helm kiln=state-1:kiln] [%13 drum=state-2:drum helm=state-1:helm kiln=state-1:kiln]
[%14 drum=state-2:drum helm=state:helm kiln=state-1:kiln] [%14 drum=state-2:drum helm=state-1:helm kiln=state-1:kiln]
[%15 drum=state-2:drum helm=state:helm kiln=state-2:kiln] [%15 drum=state-2:drum helm=state-1:helm kiln=state-2:kiln]
[%16 drum=state-4:drum helm=state:helm kiln=state-3:kiln] [%16 drum=state-4:drum helm=state-1:helm kiln=state-3:kiln]
[%17 drum=state-4:drum helm=state:helm kiln=state-4:kiln] [%17 drum=state-4:drum helm=state-1:helm kiln=state-4:kiln]
[%18 drum=state-4:drum helm=state:helm kiln=state-5:kiln] [%18 drum=state-4:drum helm=state-1:helm kiln=state-5:kiln]
[%19 drum=state-4:drum helm=state:helm kiln=state-6:kiln] [%19 drum=state-4:drum helm=state-1:helm kiln=state-6:kiln]
[%20 drum=state-4:drum helm=state:helm kiln=state-7:kiln] [%20 drum=state-4:drum helm=state-1:helm kiln=state-7:kiln]
[%21 drum=state-4:drum helm=state:helm kiln=state-8:kiln] [%21 drum=state-4:drum helm=state-1:helm kiln=state-8:kiln]
[%22 drum=state-4:drum helm=state:helm kiln=state-9:kiln] [%22 drum=state-4:drum helm=state-1:helm kiln=state-9:kiln]
[%23 drum=state-4:drum helm=state-2:helm kiln=state-9:kiln]
== ==
+$ any-state-tuple +$ any-state-tuple
$: drum=any-state:drum $: drum=any-state:drum
@ -48,6 +49,7 @@
++ on-fail on-fail:def ++ on-fail on-fail:def
++ on-init ++ on-init
^- step:agent:gall ^- step:agent:gall
=^ h helm.state on-init:helm-core
=^ d drum.state on-init:drum-core =^ d drum.state on-init:drum-core
=^ k kiln.state on-init:kiln-core =^ k kiln.state on-init:kiln-core
[:(welp d k) this] [:(welp d k) this]

View File

@ -1,27 +1,33 @@
/+ pill /+ pill
=* card card:agent:gall =* card card:agent:gall
|% |%
+$ state state-1 +$ state state-2
+$ any-state +$ any-state
$~ *state $~ *state
$% state-1 $% state-2
state-1
state-0 state-0
== ==
+$ state-1 +$ state-2 [%2 =mass-timer]
$: %1 +$ state-1 [%1 =mass-timer]
mass-timer=[way=wire nex=@da tim=@dr]
==
+$ state-0 [%0 hoc=(map bone session-0)] +$ state-0 [%0 hoc=(map bone session-0)]
+$ session-0 +$ session-0
$: say=* $: say=*
mud=* mud=*
mass-timer=[way=wire nex=@da tim=@dr] =mass-timer
== ==
:: ::
+$ mass-timer [way=wire nex=@da tim=@dr]
::
++ state-0-to-1 ++ state-0-to-1
|= s=state-0 |= s=state-0
^- state ^- state-1
[%1 mass-timer:(~(got by hoc.s) 0)] [%1 mass-timer:(~(got by hoc.s) 0)]
::
++ state-1-to-2
|= s=state-1
^- state-2
[%2 +.s]
-- --
|= [=bowl:gall sat=state] |= [=bowl:gall sat=state]
=| moz=(list card) =| moz=(list card)
@ -39,11 +45,17 @@
^+ this ^+ this
?~(caz this $(caz t.caz, this (emit i.caz))) ?~(caz this $(caz t.caz, this (emit i.caz)))
:: ::
++ on-init
(poke-serve [~ /who] %base /gen/who/hoon ~)
::
++ on-load ++ on-load
|= [hood-version=@ud old=any-state] |= [hood-version=@ud old=any-state]
=< abet =< abet
=? old ?=(%0 -.old) (state-0-to-1 old) =? old ?=(%0 -.old) (state-0-to-1 old)
?> ?=(%1 -.old) =? this ?=(%1 -.old)
(emil -:(poke-serve [~ /who] %base /gen/who/hoon ~))
=? old ?=(%1 -.old) (state-1-to-2 old)
?> ?=(%2 -.old)
this(sat old) this(sat old)
:: ::
++ poke-rekey :: rotate private keys ++ poke-rekey :: rotate private keys

View File

@ -45,7 +45,6 @@
(~(connect pass /eyre) [~ /] %docket) (~(connect pass /eyre) [~ /] %docket)
(~(wait pass /init) (add 1 now.bowl)) (~(wait pass /init) (add 1 now.bowl))
(~(connect pass /eyre) [~ /apps] %docket) (~(connect pass /eyre) [~ /apps] %docket)
(~(arvo pass /eyre) %e %serve [~ /who] %base /gen/who/hoon ~)
== ==
:: ::
++ on-load ++ on-load
@ -56,8 +55,7 @@
|^ |^
=. -.state old =. -.state old
=. +.state inflate-cache =. +.state inflate-cache
:_ this `this
[(~(arvo pass /eyre) %e %serve [~ /who] %base /gen/who/hoon ~)]~
:: ::
++ inflate-cache ++ inflate-cache
^- cache ^- cache