Boots without error and sends and receives talk messages

This commit is contained in:
Ted Blackman 2019-07-28 23:37:49 -07:00
parent fdb20a7528
commit 5b0ee61a64
5 changed files with 49 additions and 50 deletions

View File

@ -926,10 +926,10 @@
::
=/ =peer-state (got-peer-state her)
=/ =channel [[our her] now +>.ames-state -.peer-state]
=/ peer-core (make-peer-core peer-state channel)
:: if processing succeded, send positive ack packet and exit
::
?~ error
=/ peer-core (make-peer-core peer-state channel)
abet:(run-message-still:peer-core bone %done ok=%.y)
:: failed; send message nack packet
::
@ -940,10 +940,10 @@
=/ =message-blob (jam [failed u.error])
:: send nack-trace message on associated .nack-trace-bone
::
=/ peer-core (make-peer-core peer-state channel)
=. peer-core (make-peer-core peer-state channel)
=/ nack-trace-bone=^bone (mix 0b10 bone)
::
abet:(run-message-pump:peer-core nack-trace-bone %boon message-blob)
abet:(run-message-pump:peer-core nack-trace-bone %memo message-blob)
:: +on-hear: handle raw packet receipt
::
++ on-hear
@ -1304,8 +1304,8 @@
?~ snd-messages.todos event-core
::
=. event-core
%- on-memo(duct duct.i.snd-messages.todos)
[ship message.i.snd-messages.todos]
%- on-plea(duct duct.i.snd-messages.todos)
[ship plea.i.snd-messages.todos]
::
$(snd-messages.todos t.snd-messages.todos)
:: apply outgoing packet blobs
@ -1433,7 +1433,7 @@
++ ping-sponsor
^+ event-core
::
(emit duct %pass /ping %a %plea sponsor.ames-state /ping ~)
(emit duct %pass /ping %a %plea sponsor.ames-state %a /ping ~)
:: +send-blob: fire packet at .ship and maybe sponsors
::
:: Send to .ship and sponsors until we find a direct lane.
@ -1720,7 +1720,7 @@
|= [=message-num message=*]
^+ peer-core
::
=+ ;; [=failed=message-num =error] message
=+ ;; [=failed=^message-num =error] message
:: flip .bone's second bit to find referenced flow
::
=/ target-bone=^bone (mix 0b10 bone)
@ -1759,17 +1759,18 @@
^+ peer-core
:: don't accept requests for arbitrary vanes
::
=+ ;; [vane=?(%a %c %g %k) =plea] message
=+ ;; =plea message
:: %a /ping means sponsor ping timer; send ack
::
?: ?=(%a vane)
?: ?=(%a vane.plea)
:: validate ping message and send ack
::
:: TODO: treat ames as client vane and go through arvo?
:: removes reentrancy and could nack more easily
::
=/ error=(unit error)
?: =([/ping ~] plea) ~
?: =([/ping ~] +.plea)
~
`[%ping [%leaf "ames: invalid ping"]~]
::
(run-message-still bone %done ok=%.y)
@ -1780,7 +1781,7 @@
=^ client-duct ossuary.peer-state
(get-duct ossuary.peer-state bone duct)
::
?- vane
?+ vane.plea ~| %ames-evil-vane^vane.plea !!
%c (emit client-duct %pass wire %c %plea her.channel plea)
%g (emit client-duct %pass wire %g %plea her.channel plea)
%k (emit client-duct %pass wire %k %plea her.channel plea)
@ -2121,7 +2122,9 @@
=- :: if no sent packet matches the ack, don't apply mutations or effects
::
?. found.-
~& %alef-hear-noop
packet-pump
~& %alef-hear-ack^message-num^fragment-num
::
=. metrics.state metrics.-
=. live.state live.-
@ -2457,7 +2460,7 @@
::
++ assemble-fragments
|= [num-fragments=fragment-num fragments=(map fragment-num fragment)]
^- message
^- *
::
=| sorted=(list fragment)
=. sorted
@ -2467,7 +2470,6 @@
sorted
$(index +(index), sorted [(~(got by fragments) index) sorted])
::
;; message
%- cue
%+ can 13
%+ turn (flop sorted)

View File

@ -471,7 +471,7 @@
++ note :: out request $->
$~ [%b %wait *@da] ::
$% $: %a :: to %ames
$>(%memo task:able:ames) ::
$>(%plea task:able:ames) ::
== ::
$: %b :: to %behn
$> $? %drip ::
@ -505,7 +505,7 @@
$% [%init-clad ~] ::
== == ::
$: %a :: by %ames
$> $? %memo ::
$> $? %boon ::
%done ::
== ::
gift:able:ames ::
@ -2795,8 +2795,8 @@
::
=/ =desk p.riff
=/ =wire /warp-index/(scot %p ship)/(scot %tas desk)/(scot %ud index)
=/ =path [%c %question desk (scot %ud index) ~]
(emit duct %pass wire %a %memo ship path riff)
=/ =path [%question desk (scot %ud index) ~]
(emit duct %pass wire %a %plea ship %c path riff)
::
:: Create a request that cannot be filled immediately.
::
@ -4369,10 +4369,10 @@
(start-request:den for u.q.rif)
[mos ..^$]
::
%memo
%plea
=* her ship.req
=* pax path.message.req
=* res payload.message.req
=* pax path.plea.req
=* res payload.plea.req
::
?> ?=({%question *} pax)
=+ ryf=;;(riff res)
@ -4466,7 +4466,7 @@
?: ?=([%foreign-warp *] tea)
?> ?=(%writ +<.q.hin)
:_ ..^$
[hen %give %memo /remove-me (bind `riot`p.q.hin rant-to-rand)]~
[hen %give %boon (bind `riot`p.q.hin rant-to-rand)]~
::
?: ?=({%foreign-request @ @ @ *} tea)
=/ her (slav %p i.t.tea)
@ -4502,10 +4502,9 @@
== ==
::
?: ?=([%warp-index @ @ @ ~] tea)
?> ?=(%memo +<.q.hin)
?> ?=([%remove-me ~] path.message.q.hin)
?> ?=(%boon +<.q.hin)
::
=+ ;; res=(unit rand) payload.message.q.hin
=+ ;; res=(unit rand) payload.q.hin
::
=/ her=ship (slav %p i.t.tea)
=/ =desk (slav %tas i.t.t.tea)
@ -4568,7 +4567,7 @@
::
:: handled in the wire dispatcher
::
%memo !!
%boon !!
%writ !!
::
%done

View File

@ -225,7 +225,7 @@
==
%+ mo-pass
[%sys %way (scot %p him) p.caz -.q.caz ~]
`note-arvo`[%a %memo him [%g %ge p.caz ~] [num roc]]
`note-arvo`[%a %plea him %g [%ge p.caz ~] [num roc]]
::
++ mo-baba :: error convert b
|= error=(unit error:ames)
@ -360,8 +360,8 @@
?- -.cuf
%coup (mo-give %done ?~(p.cuf ~ `[%gall-coup u.p.cuf]))
%reap (mo-give %done ?~(p.cuf ~ `[%gall-reap u.p.cuf]))
%diff (mo-give %memo /remove-me num %d p.p.cuf q.q.p.cuf)
%quit (mo-give %memo /remove-me num %x ~)
%diff (mo-give %boon num %d p.p.cuf q.q.p.cuf)
%quit (mo-give %boon num %x ~)
:: we send http-responses, we don't receive them.
::
$http-response !!
@ -393,8 +393,8 @@
?: ?=([%a %done *] sih)
(mo-awed him cub error.sih)
::
?> ?=([%a %memo *] sih)
=+ mes=;;([@ud roon] payload.message.sih)
?> ?=([%a %boon *] sih)
=+ mes=;;([@ud roon] payload.sih)
(mo-gawd:(mo-abed:mo hen) him dap mes)
==
::
@ -1290,14 +1290,14 @@
$init
[~ ..^$(sys.mast.all hen)]
::
%memo
~& %gall-memo-path^path.message.q.hic
?> ?=([%ge @ ~] path.message.q.hic)
%plea
~& %gall-plea-path^path.plea.q.hic
?> ?=([%ge @ ~] path.plea.q.hic)
=/ him=ship ship.q.hic
=* dap i.t.path.message.q.hic
=* dap i.t.path.plea.q.hic
::
=+ mes=;;([@ud rook] payload.message.q.hic)
~& %gall-memo-coerced
=+ mes=;;([@ud rook] payload.plea.q.hic)
~& %gall-plea-coerced
=< mo-abet
(mo-gawk:(mo-abed:mo hen) him dap mes)
::

View File

@ -80,9 +80,9 @@
[p=duct q=card] ::
:: ::
+$ note :: out request $->
$~ [%a %memo *ship *message:ames] ::
$~ [%a %plea *ship *plea:ames] ::
$% $: %a :: to %ames
$>(%memo task:able:ames) :: send message
$>(%plea task:able:ames) :: send request message
== ::
$: %k :: to self
$>(%look task) :: set ethereum source
@ -93,7 +93,7 @@
:: ::
+$ sign :: in result $<-
$~ [%a %done ~] ::
$% [%a $>(%memo gift:able:ames)] :: message result
$% [%a $>(%boon gift:able:ames)] :: message response
[%a $>(%done gift:able:ames)] :: message (n)ack
== ::
-- ::
@ -437,11 +437,11 @@
==
::
:: authenticated remote request
:: [%memo =ship =message:ames]
:: [%plea =ship =plea:ames]
::
%memo
%plea
=* her ship.tac
=/ mes (message message.tac)
=/ mes (message payload.plea.tac)
?- -.mes
::
:: cancel trackers
@ -479,9 +479,9 @@
::TODO fail:et
+>.$
::
[%a %memo *]
[%a %boon *]
=. moz [[hen %give %done ~] moz]
=+ ;; =message-response message.hin
=+ ;; =message-response payload.hin
(call hen %vent-update vent-result.message-response)
==
:: :: ++curd:of
@ -567,7 +567,7 @@
::
?. ?=([[%a *] *] d)
(emit d %give %public-keys vent-result)
(emit d %give %memo /k/remove-me %public-keys-result vent-result)
(emit d %give %boon %public-keys-result vent-result)
$(yez t.yez)
::
++ get-source
@ -742,7 +742,7 @@
?: ?=(%& -.source)
=/ send-message
|= =message
[hen %pass /public-keys %a %memo p.source /k/public-keys message]
[hen %pass /public-keys %a %plea p.source %k /public-keys message]
=. ..feel
(emit (send-message %nuke whos))
(emit (send-message %public-keys whos))

View File

@ -7579,8 +7579,9 @@
{$j gift:able:jael}
{$k gift:able:kale}
==
:: $unix-task: input from unix
::
+$ unix-task :: input from unix
+$ unix-task
$~ [%wake ~]
$% :: %dill: keyboard input
::
@ -7627,9 +7628,6 @@
:: %behn: wakeup
::
$>(%wake task:able:behn)
:: %ames: send message
::
$>(%memo task:able:ames)
==
:: ::
:::: ++azimuth :: (2az) azimuth