%breach-sync works with kale

This commit is contained in:
Philip Monk 2019-07-26 23:36:59 -07:00
parent dd76358f6a
commit f78d755a0d
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
8 changed files with 52 additions and 30 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a4a8e1daf0bfe86d5fc4ef7060b0c6a6c2678a344787926f14bb4b8cfabe8752
size 9549390
oid sha256:276e7ae464a476ade3f1c99bbfd6fa24cb104d361d447d2dbc6d7e42a9792fc2
size 9474521

View File

@ -318,12 +318,8 @@
|= state=app-state
=/ m (async:stdio ,app-state)
^- form:m
~& [%get-updatessss number.state]
;< =latest=block bind:m (get-latest-block url.state)
~& [%latest-block number.state]
;< =new=number:block bind:m (zoom state number.id.latest-block)
~& [%zoomed-to number.state]
=. number.state new-number
;< =latest=block bind:m (get-latest-block url.state)
;< state=app-state bind:m (zoom state number.id.latest-block)
|- ^- form:m
=* walk-loop $
~& [%walk-loop number.state]
@ -404,16 +400,18 @@
::
++ zoom
|= [state=app-state =latest=number:block]
=/ m (async:stdio ,number:block)
=/ m (async:stdio ,app-state)
^- form:m
=/ zoom-margin=number:block 3
?: (lth latest-number (add number.state zoom-margin))
(pure:m number.state)
(pure:m state)
=/ to-number=number:block (sub latest-number zoom-margin)
;< =udiffs:point bind:m
(get-logs-by-range url.state whos.state number.state to-number)
;< ~ bind:m (jael-update udiffs)
(pure:m to-number)
=. number.state +(to-number)
=. blocks.state ~
(pure:m state)
--
::
:: Main
@ -425,6 +423,7 @@
|= =in-poke-data
=/ m tapp-async
^- form:m
~& [%azimuth-tracker our.bowl number.state in-poke-data]
?- +<.in-poke-data
%init (init state)
%listen (listen state +>.in-poke-data)

View File

@ -178,30 +178,40 @@
:+ %breach-sync
~[~bud ~marbud]
=. eth-node (spawn:eth-node ~marbud)
=. eth-node (spawn:eth-node ~fipfes)
;< [eth-node=_eth-node ~] bind:m
%+ (wrap-philter ,_eth-node ,~)
router:eth-node
;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud))
~& > 'BUD DONE'
;< ~ bind:m (raw-ship ~marbud `(dawn:eth-node ~marbud))
~& > 'MARBUD DONE'
;< file=@t bind:m (touch-file ~bud %base)
~& %checking-file-touched
~& > 'TOUCH FILE DONE'
(check-file-touched ~marbud %home file)
~& %checked-file-touched
~& > 'TOUCH FILE CHECK DONE'
;< eth-node=_eth-node bind:m
(breach-and-hear:eth-node our.hid ~bud ~marbud)
~& > 'BREACH DONE'
;< [eth-node=_eth-node ~] bind:m
%+ (wrap-philter ,_eth-node ,~)
router:eth-node
;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud))
~& > 'BUD RE DONE'
;< ~ bind:m (just-events (dojo ~bud "|merge %base ~marbud %kids, =gem %this"))
~& > 'THIS MERGE STARTED DONE'
;< file=@t bind:m (touch-file ~bud %base)
~& > 'TOUCH-1 DONE'
;< file=@t bind:m (touch-file ~bud %base)
~& > 'TOUCH-2 DONE'
(check-file-touched ~marbud %home file)
~& > 'DONE DONE'
(pure:m ~)
::
:+ %breach-multiple
~[~bud ~marbud]
=. eth-node (spawn:eth-node ~marbud)
=. eth-node (spawn:eth-node ~fipfes)
;< [eth-node=_eth-node ~] bind:m
%+ (wrap-philter ,_eth-node ,~)
router:eth-node

View File

@ -48,6 +48,7 @@
%+ answer-request req
:- %o
=/ number (hex-to-num:ethereum (get-block-hash req))
~& who=who.pin
~& number=number
=/ hash (number-to-hash number)
~& hash=hash
@ -107,7 +108,7 @@
[& ~ %wait ~]
::
++ latest-block
(add launch:contracts:azimuth (lent logs))
(add launch:contracts:azimuth (dec (lent logs)))
::
++ get-id
|= req=@t
@ -200,10 +201,11 @@
?: (lth to-block launch:contracts:azimuth)
~
%+ swag
~& [%logs-by-range from-block to-block launch:contracts:azimuth]
?: (lth from-block launch:contracts:azimuth)
[0 (sub to-block launch:contracts:azimuth)]
[0 +((sub to-block launch:contracts:azimuth))]
:- (sub from-block launch:contracts:azimuth)
(sub to-block from-block)
+((sub to-block from-block))
logs
::
++ logs-by-hash
@ -230,7 +232,7 @@
(crip (prefix-hex:ethereum (render-hex-bytes:ethereum 32 hash)))
::
:+ 'blockNumber' %s
(crip (num-to-hex:ethereum count))
(crip (num-to-hex:ethereum (add launch:contracts:azimuth count)))
::
:+ 'address' %s
(crip (address-to-hex:ethereum azimuth:contracts:azimuth))
@ -347,7 +349,7 @@
++ breach-and-hear
|= [our=@p who=@p her=@p]
=. this-az (breach who)
=. this-az (spawn ~fes)
=. this-az ?:((~(has by lives) ~fes) (cycle-keys ~fes) (spawn ~fes))
=/ new-rut rut:(~(got by lives) who)
=/ m (ph ,_this-az)
;< [this-az=_this-az ~] bind:m

View File

@ -40,7 +40,6 @@
[%i /vane/iris]
:: sys/vane/jael: security
::
[%j /vane/jael]
[%k /vane/kale]
==
|= [=term =path]

View File

@ -1471,22 +1471,25 @@
=/ her=ship (slav %p i.t.tea)
=/ gus (~(us go ton.fox) our)
=/ diz (myx:gus her)
=/ ded=deed
=/ ded=(unit deed)
?: ?=(%full -.public-keys-result.sih)
~| [her=her public-keys-result=public-keys-result.sih]
=/ a-point=(unit point:able:kale)
(~(get by points.public-keys-result.sih) her)
?~ a-point
~& [%no-keys her]
[*life *pass ~]
~
=/ a-pass=pass pass:(~(got by keys.u.a-point) life.u.a-point)
[life.u.a-point a-pass oath=~]
`[life.u.a-point a-pass oath=~]
?> ?=(%keys -.diff.public-keys-result.sih)
?> =(her who.public-keys-result.sih)
=/ a-key-update=key-update:point:able:kale
to.diff.public-keys-result.sih
[life.a-key-update pass.a-key-update oath=~]
=. lew.wod.dur.diz `ded
`[life.a-key-update pass.a-key-update oath=~]
?~ ded
[~ +>.$]
~& [%installing-deed her u.ded]
=. lew.wod.dur.diz `u.ded
=. ton.fox (~(su go ton.fox) (nux:gus diz))
[~ +>.$]
::

View File

@ -497,6 +497,9 @@
%wipe ::
== ::
task:able:ford ::
== ::
$: %k :: by %kale
$>(%public-keys task:able:kale) ::
== == ::
++ riot (unit rant) :: response+complete
++ sign :: in result $<-
@ -2634,22 +2637,25 @@
::
=* ruf |4.+6.^$
::
=+ ^- [hun=(unit duct) rede]
=+ ^- [mow=(list move) hun=(unit duct) rede]
?. =(our her)
:: no duct, foreign +rede or default
::
:- ~
:+ ?: (~(has by hoy.ruf) her)
~
[hun.rom.ruf %pass /sinks %k %public-keys (silt her ~)]~
~
=/ rus rus:(~(gut by hoy.ruf) her *rung)
%+ ~(gut by rus) syd
[lim=~2000.1.1 ref=`*rind qyx=~ dom=*dome per=~ pew=~]
:: administrative duct, domestic +rede
::
:- `hun.rom.ruf
:+ ~ `hun.rom.ruf
=/ jod (~(gut by dos.rom.ruf) syd *dojo)
[lim=now ref=~ [qyx dom per pew]:jod]
::
=* red=rede ->
=| mow/(list move)
=* red=rede ->+
|%
++ abet :: resolve
^- [(list move) raft]
@ -4464,8 +4470,10 @@
?: ?=([%sinks ~] tea)
?> ?=(%public-keys +<.q.hin)
~& 'XXX'
~& our=our
?: ?=(%full -.public-keys-result.q.hin)
!!
~& %clay-sinks-full
[~ ..^$]
?. ?=(%rift -.diff.public-keys-result.q.hin)
[~ ..^$]
~& rift=public-keys-result.q.hin

View File

@ -478,6 +478,7 @@
%public-keys-result
=. moz [[hen %give %mack ~] moz]
%- curd =< abet
~& [%kale-new-from-kale public-keys-result.mes]
(public-keys:~(feel su hen our pki etn sap) public-keys-result.mes)
==
::