pill: add azimuth snapshot

This commit is contained in:
yosoyubik 2021-12-07 16:13:39 +01:00
parent d08ab43f3a
commit 81eb6ae247
7 changed files with 26 additions and 31 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:0394295b16a0709e30e6a01006310ea52a7da2396dd6b0632689b9f3334a6cee oid sha256:8388d1c8e9f1a9bfceeab27b86387ecd9fc5f31d5c1f405e1b1017e35c795217
size 26210958 size 26315069

View File

@ -8,7 +8,7 @@
dbug dbug
:: Generally don't update the snapshot until we have clay tombstoning. :: Generally don't update the snapshot until we have clay tombstoning.
:: ::
/* state-naive %naive /app/azimuth/state/naive /* snap %azimuth /app/azimuth/state/azimuth
:: To update, run from dojo: :: To update, run from dojo:
:: -azimuth-snap-state %default 'state' :: -azimuth-snap-state %default 'state'
:: ::
@ -18,8 +18,8 @@
:: */app/azimuth/logs/eth-logs &eth-logs l :: */app/azimuth/logs/eth-logs &eth-logs l
:: -azimuth-snap-logs %default 'state' :: -azimuth-snap-logs %default 'state'
:: ::
=/ snap=snap-state state-naive =/ snap=snap-state snap
=/ last-snap number.id.snap =/ last-snap=@ number.id.snap
:: ::
=, jael =, jael
|% |%
@ -246,9 +246,7 @@
%history (welp logs.state loglist.diff) %history (welp logs.state loglist.diff)
%logs (welp logs.state loglist.diff) %logs (welp logs.state loglist.diff)
== ==
:: =? nas.state ?=(%history -.diff) *^state:naive :: should go
=^ effects state (run-logs:do loglist.diff) =^ effects state (run-logs:do loglist.diff)
::
:_ this :_ this
%+ weld %+ weld
(event-update:do effects) (event-update:do effects)
@ -406,6 +404,7 @@
=/ args=vase !> =/ args=vase !>
:+ %watch /[dap.bowl] :+ %watch /[dap.bowl]
^- config:eth-watcher ^- config:eth-watcher
:* url.state =(%czar (clan:title our.bowl)) refresh ~h30
(max launch.net ?:(=(net.state %default) +(last-snap) 0)) (max launch.net ?:(=(net.state %default) +(last-snap) 0))
~[azimuth.net] ~[azimuth.net]
~[naive.net] ~[naive.net]

View File

@ -1,4 +1,4 @@
:: naive state :: /app/azimuth state snapshot
:: ::
/- *dice /- *dice
/+ naive /+ naive
@ -15,7 +15,7 @@
++ grow ++ grow
|% |%
++ mime ++ mime
[/application/x-naive (as-octs:mimes:html (jam snap))] [/application/octet-stream (as-octs:mimes:html (jam snap))]
-- --
++ grad %mime ++ grad %mime
-- --

View File

@ -1,4 +1,5 @@
:: Creates a snapshop of the naive state and its indices (owners and sposnors) :: Creates a snapshot of the azimuth state and its indices
:: (owners and sposnors) from a list of ethereum logs
:: ::
/- spider, *dice /- spider, *dice
/+ strand, /+ strand,
@ -59,9 +60,9 @@
leaf+"owners: {<~(wyt by owners)>}" leaf+"owners: {<~(wyt by owners)>}"
== ==
:: ::
=/ =path /app/azimuth/[name]/naive =/ =path /app/azimuth/[name]/azimuth
=/ =cage naive+!>([%0 id nas owners sponsors]) =/ =cage azimuth+!>([%0 id nas owners sponsors])
=/ =task [%info %base %& [path %ins cage]~] =/ =task [%info %base %& [path %ins cage]~]
=/ =card [%pass /next %arvo %c task] =/ =card [%pass /next %arvo %c task]
;< ~ bind:m (send-raw-card:strandio card) ;< ~ bind:m (send-raw-card:strandio card)
(pure:m !>('naive logs processed')) (pure:m !>('azimuth logs processed'))

View File

@ -1,12 +1,6 @@
:: =e -build-file %/lib/ethereum/hoon :: Creates a snapshot of the azimuth state and its indices
:: =n -build-file %/lib/naive/hoon :: (owners and sposnors) from scrying /app/azimuth
:: =d -build-file %/sur/dice/hoon ::
:: =l .^((list event-log:rpc:e) %gx /=azimuth=/logs/noun)
:: =nas .^(^state:n %gx /=azimuth=/nas/noun)
:: =own .^(owners:d %gx /=azimuth=/own/noun)
:: =spo .^(sponsors:d %gx /=azimuth=/spo/noun)
:: =block-id =+ last=(rear l) [block-hash block-number]:(need mined.last)
:: */app/azimuth/state/naive &naive [block-id nas own spo]
:: ::
/- spider, *dice /- spider, *dice
/+ strand, strandio, naive, ethereum, dice /+ strand, strandio, naive, ethereum, dice
@ -36,9 +30,9 @@
leaf+"owners: {<~(wyt by owners)>}" leaf+"owners: {<~(wyt by owners)>}"
== ==
:: ::
=/ =path /app/azimuth/[name]/naive =/ =path /app/azimuth/[name]/azimuth
=/ =cage naive+!>([%0 id nas owners sponsors]) =/ =cage azimuth+!>([%0 id nas owners sponsors])
=/ =task [%info %base %& [path %ins cage]~] =/ =task [%info %base %& [path %ins cage]~]
=/ =card [%pass /next %arvo %c task] =/ =card [%pass /next %arvo %c task]
;< ~ bind:m (send-raw-card:strandio card) ;< ~ bind:m (send-raw-card:strandio card)
(pure:m !>('naive state saved')) (pure:m !>('azimuth state saved'))

View File

@ -1,5 +1,6 @@
:: |pill: helper functions for making pills :: |pill: helper functions for making pills
:: ::
/- *dice
^? ^?
|% |%
:: ::
@ -90,7 +91,7 @@
:: ::
++ file-ovum2 |=(p=path `unix-event`[//arvo what/(user-files p)]) ++ file-ovum2 |=(p=path `unix-event`[//arvo what/(user-files p)])
:: ::
:: +user-files: all userspace hoon files :: +user-files: all userspace hoon files, and azimuth snapshot
:: ::
++ user-files ++ user-files
|= bas=path |= bas=path
@ -117,12 +118,12 @@
=/ lon .^(arch %cy pax) =/ lon .^(arch %cy pax)
=? hav ?=(^ fil.lon) =? hav ?=(^ fil.lon)
:: ::
:: install only hoon files for now :: install only hoon files and azimuth snapshot for now
:: ::
?. ?=([%hoon *] tyl) ?+ tyl hav
hav [%hoon *] [(flop `path`t.tyl) hoon/.^(@t %cx pax)]^hav
:_ hav [%azimuth *] [(flop `path`t.tyl) mime/.^(snap-state %cx pax)]^hav
[(flop `path`t.tyl) hoon/.^(@t %cx pax)] ==
:: ::
=/ all ~(tap by dir.lon) =/ all ~(tap by dir.lon)
|- ^+ hav |- ^+ hav