mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
azimuth: correctly load snapshot on boot
This commit is contained in:
parent
45c1693085
commit
ea199bfba9
@ -6,10 +6,16 @@
|
||||
default-agent,
|
||||
verb,
|
||||
dbug
|
||||
:: Generally don't update the snapshot until we have clay tombstoning.
|
||||
:: To update, run:
|
||||
:: =e -build-file %/lib/ethereum/hoon
|
||||
:: =l .^((list event-log:rpc:e) %gx /=azimuth=/logs/noun)
|
||||
:: */app/azimuth/logs/eth-logs ð-logs l
|
||||
::
|
||||
/* snap %eth-logs /app/azimuth/logs/eth-logs
|
||||
::
|
||||
=/ last-snap :: maybe just use the last one?
|
||||
%+ roll `(list event-log:rpc:ethereum)`~ ::snap
|
||||
%+ roll `(list event-log:rpc:ethereum)`snap ::~
|
||||
|= [log=event-log:rpc:ethereum last=@ud]
|
||||
?~ mined.log
|
||||
last
|
||||
@ -24,7 +30,7 @@
|
||||
+$ app-state
|
||||
$: %0
|
||||
url=@ta
|
||||
net=network
|
||||
=net
|
||||
whos=(set ship)
|
||||
nas=^state:naive
|
||||
own=owners
|
||||
@ -37,11 +43,10 @@
|
||||
[%listen whos=(list ship) =source:jael]
|
||||
:: %watch: configure node url and network
|
||||
::
|
||||
[%watch url=@ta net=network]
|
||||
[%watch url=@ta =net]
|
||||
==
|
||||
::
|
||||
+$ tagged-diff [=id:block diff:naive]
|
||||
+$ network ?(%mainnet %ropsten %local)
|
||||
+$ card card:agent:gall
|
||||
:: TODO: add to state?
|
||||
::
|
||||
@ -117,9 +122,12 @@
|
||||
net.state net.poke
|
||||
url.state url.poke
|
||||
own.state ~
|
||||
logs.state ~
|
||||
logs.state ?:(?=(%default net.poke) snap ~)
|
||||
==
|
||||
[start:do this]
|
||||
%- %- slog :_ ~
|
||||
leaf+"azimuth: loading snapshot with {<(lent logs.state)>} events"
|
||||
=^ snap-cards state (run-logs:do logs.state)
|
||||
[(weld (jael-update:do (to-udiffs:do snap-cards)) start:do) this]
|
||||
==
|
||||
::
|
||||
++ on-watch
|
||||
@ -314,11 +322,11 @@
|
||||
[%give %fact ~[/event] %naive-diffs !>(+.tag)]
|
||||
::
|
||||
++ get-network
|
||||
|= =network
|
||||
|= =net
|
||||
^- [azimuth=@ux naive=@ux chain-id=@ launch=@]
|
||||
=< [azimuth naive chain-id launch]
|
||||
=, azimuth
|
||||
?- network
|
||||
?- net
|
||||
%mainnet mainnet-contracts
|
||||
%ropsten ropsten-contracts
|
||||
%local local-contracts
|
||||
|
@ -1,4 +1,4 @@
|
||||
:: Change node url and network for azimuth
|
||||
:- %say
|
||||
|= [* [url=@ta net=?(%mainnet %ropsten %local) ~] ~]
|
||||
|= [* [url=@ta net=?(%mainnet %ropsten %local %default) ~] ~]
|
||||
[%azimuth-poke %watch url net]
|
||||
|
@ -5,7 +5,7 @@
|
||||
|%
|
||||
+$ owner [=proxy:naive =address:naive]
|
||||
+$ owners (jug owner ship)
|
||||
+$ net ?(%mainnet %ropsten %local)
|
||||
+$ net ?(%mainnet %ropsten %local %default)
|
||||
::
|
||||
+$ config
|
||||
$% [%frequency frequency=@dr]
|
||||
|
Loading…
Reference in New Issue
Block a user