mirror of
https://github.com/urbit/shrub.git
synced 2024-11-29 14:57:12 +03:00
wip
This commit is contained in:
parent
577eed93b8
commit
a47ef9ac77
@ -169,7 +169,7 @@
|
||||
=. ..abet-pe
|
||||
=/ sof ((soft unix-effect) i.effects)
|
||||
?~ sof
|
||||
~? aqua-debug=| [who=who %unknown-effect i.effects]
|
||||
~? aqua-debug=& [who=who %unknown-effect i.effects]
|
||||
..abet-pe
|
||||
(publish-effect u.sof)
|
||||
$(effects t.effects)
|
||||
@ -366,7 +366,8 @@
|
||||
%e %eyre
|
||||
%f %ford
|
||||
%g %gall
|
||||
%j %ford
|
||||
%j %jael
|
||||
%k %kale
|
||||
==
|
||||
=/ pax
|
||||
/(scot %p our.hid)/home/(scot %da now.hid)/sys/vane/[vane]
|
||||
|
@ -152,6 +152,7 @@
|
||||
=/ m (async:stdio ,block)
|
||||
^- form:m
|
||||
;< =json bind:m (request-rpc url `'block number' %eth-block-number ~)
|
||||
~& [%block-number json (parse-eth-block-number:rpc:ethereum json)]
|
||||
(get-block-by-number url (parse-eth-block-number:rpc:ethereum json))
|
||||
::
|
||||
++ get-block-by-number
|
||||
@ -296,7 +297,7 @@
|
||||
=/ a-purl=purl:eyre node.p.source
|
||||
=. url.state (crip (en-purl:html a-purl))
|
||||
=. whos.state whos
|
||||
(watch state url.state launch:contracts:azimuth)
|
||||
(watch state url.state 0) :: launch:contracts:azimuth)
|
||||
::
|
||||
:: Start watching a node
|
||||
::
|
||||
@ -317,9 +318,11 @@
|
||||
|= state=app-state
|
||||
=/ m (async:stdio ,app-state)
|
||||
^- form:m
|
||||
~& [%get-updates number.state]
|
||||
~& [%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
|
||||
|- ^- form:m
|
||||
=* walk-loop $
|
||||
@ -403,7 +406,7 @@
|
||||
|= [state=app-state =latest=number:block]
|
||||
=/ m (async:stdio ,number:block)
|
||||
^- form:m
|
||||
=/ zoom-margin=number:block 30
|
||||
=/ zoom-margin=number:block 3
|
||||
?: (lth latest-number (add number.state zoom-margin))
|
||||
(pure:m number.state)
|
||||
=/ to-number=number:block (sub latest-number zoom-margin)
|
||||
|
@ -133,16 +133,23 @@
|
||||
%+ (wrap-philter ,_eth-node ,~)
|
||||
router:eth-node
|
||||
;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud))
|
||||
~& > 'BUD DONE'
|
||||
;< ~ bind:m (raw-ship ~dev `(dawn:eth-node ~dev))
|
||||
~& > 'DEV DONE'
|
||||
(send-hi ~bud ~dev)
|
||||
~& > 'HI DONE'
|
||||
;< eth-node=_eth-node bind:m
|
||||
(breach-and-hear:eth-node our.hid ~dev ~bud)
|
||||
~& > 'BREACH DONE'
|
||||
;< [eth-node=_eth-node ~] bind:m
|
||||
%+ (wrap-philter ,_eth-node ,~)
|
||||
router:eth-node
|
||||
;< ~ bind:m (send-hi-not-responding ~bud ~dev)
|
||||
~& > 'HI NOT RESPONDING DONE'
|
||||
;< ~ bind:m (raw-ship ~dev `(dawn:eth-node ~dev))
|
||||
~& > 'REBOOT DEV DONE'
|
||||
(wait-for-dojo ~bud "hi ~dev successful")
|
||||
~& > 'DONE'
|
||||
(pure:m ~)
|
||||
::
|
||||
:+ %breach-hi-cousin
|
||||
|
@ -85,18 +85,18 @@
|
||||
[%base %dojo]
|
||||
[%base %modulo]
|
||||
==
|
||||
:~ [%home %lens]
|
||||
[%home %acme]
|
||||
[%home %dns]
|
||||
:~ :: [%home %lens]
|
||||
:: [%home %acme]
|
||||
:: [%home %dns]
|
||||
[%home %dojo]
|
||||
[%home %hall]
|
||||
[%home %talk]
|
||||
[%home %modulo]
|
||||
[%home %launch]
|
||||
[%home %chat]
|
||||
[%home %publish]
|
||||
[%home %clock]
|
||||
[%home %weather]
|
||||
:: [%home %hall]
|
||||
:: [%home %talk]
|
||||
:: [%home %modulo]
|
||||
:: [%home %launch]
|
||||
:: [%home %chat]
|
||||
:: [%home %publish]
|
||||
:: [%home %clock]
|
||||
:: [%home %weather]
|
||||
[%home %azimuth-tracker]
|
||||
==
|
||||
::
|
||||
|
@ -30,14 +30,15 @@
|
||||
|= pin=ph-input
|
||||
^- output:n
|
||||
=, enjs:format
|
||||
=/ thus (extract-thus-to uf.pin 'http://localhost:8545')
|
||||
?~ thus
|
||||
=/ ask (extract-request uf.pin 'http://localhost:8545/')
|
||||
?~ ask
|
||||
[& ~ %wait ~]
|
||||
?~ r.mot.u.thus
|
||||
?~ body.request.u.ask
|
||||
[& ~ %wait ~]
|
||||
=/ req q.u.r.mot.u.thus
|
||||
=/ req q.u.body.request.u.ask
|
||||
|^ ^- output:n
|
||||
=/ method (get-method req)
|
||||
:: =; a ~& [%give-azimuth-response a] -
|
||||
?: =(method 'eth_blockNumber')
|
||||
:- | :_ [%wait ~]
|
||||
%+ answer-request req
|
||||
@ -46,19 +47,22 @@
|
||||
:- | :_ [%wait ~]
|
||||
%+ answer-request req
|
||||
:- %o
|
||||
=/ hash (get-block-hash req)
|
||||
=/ number (hash-to-number (hex-to-num:ethereum hash))
|
||||
=/ number (hex-to-num:ethereum (get-block-hash req))
|
||||
~& number=number
|
||||
=/ hash (number-to-hash number)
|
||||
~& hash=hash
|
||||
=/ parent-hash (number-to-hash ?~(number number (dec number)))
|
||||
~& parent-hash=parent-hash
|
||||
%- malt
|
||||
^- (list (pair term json))
|
||||
:~ hash+s+hash
|
||||
:~ hash+s+(crip (prefix-hex:ethereum (render-hex-bytes:ethereum 32 hash)))
|
||||
number+s+(crip (num-to-hex:ethereum number))
|
||||
'parentHash'^s+(crip (num-to-hex:ethereum parent-hash))
|
||||
==
|
||||
?: =(method 'eth_getLogs')
|
||||
:- | :_ [%wait ~]
|
||||
%+ answer-request req
|
||||
?~ (get-param-obj-maybe req 'blockHash')
|
||||
?^ (get-param-obj-maybe req 'blockHash')
|
||||
%- logs-by-hash
|
||||
(get-param-obj req 'blockHash')
|
||||
%+ logs-by-range
|
||||
@ -155,9 +159,8 @@
|
||||
=, dejs:format
|
||||
=/ id
|
||||
%. (need (de-json:html req))
|
||||
(ot params+(ar so) ~)
|
||||
?> ?=([* * ~] id)
|
||||
i.id
|
||||
(ot params+(at so bo ~) ~)
|
||||
-.id
|
||||
::
|
||||
++ answer-request
|
||||
|= [req=@t result=json]
|
||||
@ -175,23 +178,31 @@
|
||||
who.pin
|
||||
//http-client/0v1n.2m9vh
|
||||
%receive
|
||||
num.u.thus
|
||||
num.u.ask
|
||||
[%start [200 ~] `(as-octs:mimes:html resp) &]
|
||||
==
|
||||
::
|
||||
++ number-to-hash
|
||||
|= =number:block:able:kale
|
||||
`@`(cat 3 0x5363 number)
|
||||
^- @
|
||||
?: (lth number launch:contracts:azimuth)
|
||||
(cat 3 0x5364 (sub launch:contracts:azimuth number))
|
||||
(cat 3 0x5363 (sub number launch:contracts:azimuth))
|
||||
::
|
||||
++ hash-to-number
|
||||
|= =hash:block:able:kale
|
||||
(div hash 0x1.0000)
|
||||
(add launch:contracts:azimuth (div hash 0x1.0000))
|
||||
::
|
||||
++ logs-by-range
|
||||
|= [from-block=@ud to-block=@ud]
|
||||
%+ logs-to-json from-block
|
||||
?: (lth to-block launch:contracts:azimuth)
|
||||
~
|
||||
%+ swag
|
||||
[(sub from-block launch:contracts:azimuth) (sub to-block from-block)]
|
||||
?: (lth from-block launch:contracts:azimuth)
|
||||
[0 (sub to-block launch:contracts:azimuth)]
|
||||
:- (sub from-block launch:contracts:azimuth)
|
||||
(sub to-block from-block)
|
||||
logs
|
||||
::
|
||||
++ logs-by-hash
|
||||
|
@ -80,13 +80,12 @@
|
||||
::
|
||||
:: Check if given effect is an http request; extract
|
||||
::
|
||||
++ extract-thus-to
|
||||
++ extract-request
|
||||
|= [uf=unix-effect dest=@t]
|
||||
^- (unit [num=@ud mot=moth:eyre])
|
||||
?. ?=(%thus -.q.uf) ~
|
||||
?~ q.q.uf ~
|
||||
?. =(p.u.q.q.uf (rash dest auri:de-purl:html)) ~
|
||||
`[p.q.uf q.u.q.q.uf]
|
||||
^- (unit [num=@ud =request:http])
|
||||
?. ?=(%request -.q.uf) ~
|
||||
?. =(dest url.request.q.uf) ~
|
||||
`[id.q.uf request.q.uf]
|
||||
::
|
||||
:: Scry into a running aqua ship
|
||||
::
|
||||
|
@ -254,10 +254,10 @@
|
||||
:: XX use only for development may break contracts!
|
||||
:: XX if active clam contracts only to abort transaction?
|
||||
::
|
||||
:: ~& [%tapp-reset dap.bowl]
|
||||
:: `this-tapp
|
||||
~| [%tapp-load-incompatible dap.bowl]
|
||||
!!
|
||||
~& [%tapp-reset dap.bowl]
|
||||
`this-tapp
|
||||
:: ~| [%tapp-load-incompatible dap.bowl]
|
||||
:: !!
|
||||
::
|
||||
:: because the clam replaces the active continuation with
|
||||
:: the bunt of its mold, we must fail the transaction
|
||||
|
@ -44,8 +44,6 @@
|
||||
%+ pair wire
|
||||
$% [%wack p=@]
|
||||
[%whom p=ship]
|
||||
[%live p=@ud q=(unit @ud)]
|
||||
[%barn ~]
|
||||
[%boot $%([%fake p=ship] [%dawn p=dawn-event])]
|
||||
unix-task
|
||||
==
|
||||
@ -60,6 +58,7 @@
|
||||
[%sleep ~]
|
||||
[%restore ~]
|
||||
[%init ~]
|
||||
[%request id=@ud request=request:http]
|
||||
==
|
||||
+$ pill
|
||||
[boot-ova=* kernel-ova=(list unix-event) userspace-ova=(list unix-event)]
|
||||
|
@ -2402,7 +2402,6 @@
|
||||
:: Must uni the old-lat into the new-lat so that if we recreate
|
||||
:: the same blob hash, we use the old blob not the new one. Else
|
||||
:: you get mutually recurring %delta blobs.
|
||||
::
|
||||
++ add-blobs
|
||||
|= [new-blobs=(map path blob) old-lat=(map lobe blob)]
|
||||
^- (map lobe blob)
|
||||
@ -4107,7 +4106,7 @@
|
||||
%boat
|
||||
:_ ..^$
|
||||
[hen %give %hill (turn ~(tap by mon.ruf) head)]~
|
||||
::.
|
||||
::
|
||||
%cred
|
||||
=. cez.ruf
|
||||
?~ cew.req (~(del by cez.ruf) nom.req)
|
||||
|
@ -83,7 +83,7 @@
|
||||
$>(%want task:able:ames) :: send message
|
||||
== ::
|
||||
$: %k :: to self
|
||||
$>(%listen task) :: set ethereum source
|
||||
$>(%listen task) :: set ethereum source
|
||||
== ::
|
||||
$: @tas ::
|
||||
$% $>(%init vane-task) :: report install
|
||||
@ -411,6 +411,7 @@
|
||||
:: ships with real keys must have domains,
|
||||
:: those with fake keys must not
|
||||
::
|
||||
~| [fak.own.pki tuf.own.pki]
|
||||
?< =(fak.own.pki ?=(^ tuf.own.pki))
|
||||
+>.$(moz [[hen %give %turf tuf.own.pki] moz])
|
||||
::
|
||||
@ -676,7 +677,10 @@
|
||||
yen.etn (~(put in yen.etn) hen)
|
||||
moz
|
||||
%- welp :_ moz
|
||||
~& [%kale-sources-feed etn=etn]
|
||||
%+ turn
|
||||
^- (list (pair source-id (set ship)))
|
||||
:- [default-source.etn ~]
|
||||
~(tap by ship-sources-reverse.etn)
|
||||
|= [=source-id whos=(set ship)]
|
||||
[hen %give %source whos (~(got by sources.etn) source-id)]
|
||||
@ -782,8 +786,8 @@
|
||||
?~ whol
|
||||
ship-sources.etn
|
||||
(~(put by $(whol t.whol)) i.whol source-id)
|
||||
=. ship-sources-reverse
|
||||
%- ~(gas ju ship-sources-reverse)
|
||||
=. ship-sources-reverse.etn
|
||||
%- ~(gas ju ship-sources-reverse.etn)
|
||||
(turn whol |=(=ship [source-id ship]))
|
||||
..feed
|
||||
(exec yen.etn [%give %source whos source])
|
||||
@ -841,7 +845,7 @@
|
||||
:: old/state
|
||||
==
|
||||
^+ ..^$
|
||||
..^$(fak.own.pki.lex &)
|
||||
..^$
|
||||
:: ..^$(lex old)
|
||||
:: :: ++scry
|
||||
++ scry :: inspect
|
||||
|
Loading…
Reference in New Issue
Block a user