mirror of
https://github.com/urbit/shrub.git
synced 2024-11-30 22:15:47 +03:00
remove snapshot scaffolding
This commit is contained in:
parent
900e7fc12c
commit
6eb4d9389d
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f37432dba5cc7ebb82f52a159a1f65540d12ff74868cac1ad298adc2fd4431a5
|
||||
size 4512165
|
||||
oid sha256:2b1571c0f3039a71a900fc968052cd2f9a2245f0f7ac727be722c4ce002fbc8a
|
||||
size 4803678
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b4ec80306985dde4f8abb2e6d85414685309232aec8dffc4795f5546c2f27f5
|
||||
size 9669171
|
||||
oid sha256:c84bb3630f7f4cd080c48eba65de6b55d0dbb6b9238db112cc67f103daa681bb
|
||||
size 9655452
|
||||
|
@ -296,7 +296,6 @@
|
||||
~[~['arvo' 'netw' 'ork']]
|
||||
0
|
||||
`(need (de-purl:html 'http://localhost:8545'))
|
||||
~
|
||||
==
|
||||
::
|
||||
:: Should only do galaxies
|
||||
|
@ -24,7 +24,6 @@
|
||||
turf=(list turf)
|
||||
bloq=@ud
|
||||
node=(unit purl:eyre)
|
||||
snap=(unit snapshot:jael)
|
||||
==
|
||||
::
|
||||
++ module-ova
|
||||
|
@ -1342,7 +1342,6 @@
|
||||
%ogre `%c
|
||||
%perm `%c
|
||||
%rest `%b
|
||||
%snap `%j
|
||||
%wait `%b
|
||||
%want `%a
|
||||
%warp `%c
|
||||
|
@ -39,7 +39,6 @@
|
||||
$: ver=$0 :: vane version
|
||||
pki=state-pki ::
|
||||
etn=state-eth-node :: eth connection state
|
||||
sap=state-snapshots :: state snapshots
|
||||
== ::
|
||||
+$ state-pki :: urbit metadata
|
||||
$: $= own :: vault (vein)
|
||||
@ -59,13 +58,6 @@
|
||||
pos=(map ship point) :: on-chain ship state
|
||||
== ::
|
||||
== ::
|
||||
+$ state-snapshots :: rewind points
|
||||
$: interval=_100 :: block interval
|
||||
max-count=_10 :: max snaps
|
||||
count=@ud :: length of snaps
|
||||
last-block=@ud :: number of last snap
|
||||
snaps=(qeu [block-number=@ud snap=snapshot]) :: old states
|
||||
== ::
|
||||
+$ message :: message to her jael
|
||||
$% [%nuke whos=(set ship)] :: cancel trackers
|
||||
[%public-keys whos=(set ship)] :: view ethereum events
|
||||
@ -256,12 +248,7 @@
|
||||
:: save our parent signature (only for moons)
|
||||
::
|
||||
=. sig.own.pki sig.seed.tac
|
||||
:: if we're given a snapshot, restore it
|
||||
::
|
||||
=. +>.$
|
||||
?~ snap.tac +>.$
|
||||
(restore-snap hen u.snap.tac |)
|
||||
:: load our initial public key, overriding snapshot
|
||||
:: load our initial public key
|
||||
::
|
||||
=. pos.zim.pki
|
||||
=/ cub (nol:nu:crub:crypto key.seed.tac)
|
||||
@ -298,7 +285,7 @@
|
||||
(~(put by points) ship.spon.tac spon-point)
|
||||
=. +>.$
|
||||
%- curd =< abet
|
||||
(public-keys:~(feel su hen our pki etn sap) %full points)
|
||||
(public-keys:~(feel su hen our pki etn) %full points)
|
||||
::
|
||||
:: start subscriptions
|
||||
::
|
||||
@ -307,16 +294,16 @@
|
||||
?- (clan:title our)
|
||||
%czar
|
||||
%- curd =< abet
|
||||
(sources:~(feel su hen our pki etn sap) ~ [%| %azimuth-tracker])
|
||||
(sources:~(feel su hen our pki etn) ~ [%| %azimuth-tracker])
|
||||
::
|
||||
*
|
||||
=. +>.$
|
||||
%- curd =< abet
|
||||
%+ sources:~(feel su hen our pki etn sap)
|
||||
%+ sources:~(feel su hen our pki etn)
|
||||
(silt ship.spon.tac ~)
|
||||
[%| %azimuth-tracker]
|
||||
%- curd =< abet
|
||||
(sources:~(feel su hen our pki etn sap) ~ [%& ship.spon.tac])
|
||||
(sources:~(feel su hen our pki etn) ~ [%& ship.spon.tac])
|
||||
==
|
||||
::
|
||||
=. moz
|
||||
@ -394,7 +381,7 @@
|
||||
%listen
|
||||
~& [%jael-listen whos source]:tac
|
||||
%- curd =< abet
|
||||
(sources:~(feel su hen our pki etn sap) [whos source]:tac)
|
||||
(sources:~(feel su hen our pki etn) [whos source]:tac)
|
||||
::
|
||||
:: cancel all trackers from duct
|
||||
:: {$nuke whos=(set ship)}
|
||||
@ -425,7 +412,7 @@
|
||||
::
|
||||
%public-keys
|
||||
%- curd =< abet
|
||||
(~(public-keys ~(feed su hen our pki etn sap) hen) ships.tac)
|
||||
(~(public-keys ~(feed su hen our pki etn) hen) ships.tac)
|
||||
::
|
||||
:: seen after breach
|
||||
:: [%meet our=ship who=ship]
|
||||
@ -433,11 +420,6 @@
|
||||
%meet
|
||||
+>.$
|
||||
::
|
||||
:: restore snapshot
|
||||
:: [%snap snap=snapshot kick=?]
|
||||
%snap
|
||||
(restore-snap hen snap.tac kick.tac)
|
||||
::
|
||||
:: XX should be a subscription
|
||||
:: XX reconcile with .dns.eth
|
||||
:: request domains
|
||||
@ -461,7 +443,7 @@
|
||||
:: {$private-keys $~}
|
||||
::
|
||||
%private-keys
|
||||
(curd abet:~(private-keys ~(feed su hen our pki etn sap) hen))
|
||||
(curd abet:~(private-keys ~(feed su hen our pki etn) hen))
|
||||
::
|
||||
%wegh
|
||||
%_ +>
|
||||
@ -473,7 +455,6 @@
|
||||
:+ %jael %|
|
||||
:~ pki+&+pki
|
||||
etn+&+etn
|
||||
sap+&+sap
|
||||
dot+&+lex
|
||||
==
|
||||
==
|
||||
@ -506,14 +487,8 @@
|
||||
%public-keys-result
|
||||
=. moz [[hen %give %mack ~] moz]
|
||||
%- curd =< abet
|
||||
(public-keys:~(feel su hen our pki etn sap) public-keys-result.mes)
|
||||
(public-keys:~(feel su hen our pki etn) public-keys-result.mes)
|
||||
==
|
||||
::
|
||||
:: rewind to snapshot
|
||||
:: {$wind p/@ud}
|
||||
::
|
||||
%wind
|
||||
(wind hen p.tac)
|
||||
==
|
||||
::
|
||||
++ take
|
||||
@ -555,7 +530,7 @@
|
||||
%. [hen tea app]
|
||||
=< pump
|
||||
%- curd =< abet
|
||||
(~(new-event su hen our pki etn sap) peer-sign)
|
||||
(~(new-event su hen our pki etn) peer-sign)
|
||||
==
|
||||
==
|
||||
:: :: ++curd:of
|
||||
@ -563,34 +538,12 @@
|
||||
|= $: moz/(list move)
|
||||
pki/state-pki
|
||||
etn/state-eth-node
|
||||
sap/state-snapshots
|
||||
==
|
||||
+>(pki pki, etn etn, sap sap, moz (weld (flop moz) ^moz))
|
||||
+>(pki pki, etn etn, moz (weld (flop moz) ^moz))
|
||||
:: :: ++wind:of
|
||||
++ pump
|
||||
|= [hen=duct =wire app=term]
|
||||
(emit [hen %pass wire %g %deal [our our] app %pump ~])
|
||||
::
|
||||
++ wind :: rewind to snap
|
||||
|= [hen=duct block=@ud]
|
||||
^+ +>
|
||||
:: XX what do
|
||||
!!
|
||||
:: :: ++restore-block:of
|
||||
++ restore-block :: rewind before block
|
||||
|= [hen=duct block=@ud]
|
||||
!!
|
||||
:: %+ cute hen =< abet
|
||||
:: XX
|
||||
:: (~(restore-block et hen our now sub.lex etn.lex sap.lex) block)
|
||||
:: :: ++restore-snap:of
|
||||
++ restore-snap :: restore snapshot
|
||||
|= [hen=duct snap=snapshot look=?]
|
||||
!!
|
||||
:: %+ cute hen =< abet
|
||||
:: XX
|
||||
:: %- ~(restore-snap et hen our now sub.lex etn.lex sap.lex)
|
||||
:: [snap look]
|
||||
--
|
||||
:: :: ++su
|
||||
:::: ## relative^heavy :: subjective engine
|
||||
@ -609,19 +562,17 @@
|
||||
our=ship
|
||||
state-pki
|
||||
state-eth-node
|
||||
state-snapshots
|
||||
==
|
||||
:: moz: moves in reverse order
|
||||
:: pki: relative urbit state
|
||||
::
|
||||
=* pki ->+<
|
||||
=* etn ->+>-
|
||||
=* sap ->+>+
|
||||
=* etn ->+>
|
||||
|%
|
||||
++ this-su .
|
||||
:: :: ++abet:su
|
||||
++ abet :: resolve
|
||||
[(flop moz) pki etn sap]
|
||||
[(flop moz) pki etn]
|
||||
:: :: ++exec:su
|
||||
++ emit
|
||||
|= =move
|
||||
@ -711,10 +662,6 @@
|
||||
this-su
|
||||
(public-keys:feel %diff a-ship u.a-diff)
|
||||
::
|
||||
++ extract-snap :: extract rewind point
|
||||
^- snapshot
|
||||
~
|
||||
::
|
||||
++ feed
|
||||
|_ :: hen: subscription source
|
||||
::
|
||||
@ -1112,18 +1059,6 @@
|
||||
?. ?=(~ tyl) [~ ~]
|
||||
:^ ~ ~ %noun !>
|
||||
etn.lex
|
||||
::
|
||||
%snap
|
||||
?. ?=(~ tyl) [~ ~]
|
||||
?: =(~ snaps.sap.lex)
|
||||
`~
|
||||
:^ ~ ~ %noun !>
|
||||
|- ^- snapshot
|
||||
=^ snap=[@ud snap=snapshot] snaps.sap.lex
|
||||
~(get to snaps.sap.lex)
|
||||
?: =(~ snaps.sap.lex)
|
||||
snap.snap
|
||||
$
|
||||
::
|
||||
%turf
|
||||
?. ?=(~ tyl) [~ ~]
|
||||
|
@ -2078,7 +2078,6 @@
|
||||
turf=(list turf) :: domains
|
||||
bloq=@ud :: block number
|
||||
node=(unit purl:eyre) :: gateway url
|
||||
snap=(unit snapshot) :: head start
|
||||
== ::
|
||||
[%fake =ship] :: fake boot
|
||||
[%listen whos=(set ship) =source] :: set ethereum source
|
||||
@ -2087,12 +2086,10 @@
|
||||
[%private-keys ~] :: sub to privates
|
||||
[%public-keys ships=(set ship)] :: sub to publics
|
||||
[%meet =ship =life =pass] :: met after breach
|
||||
[%snap snap=snapshot kick=?] :: load snapshot
|
||||
[%turf ~] :: view domains
|
||||
$>(%vega vane-task) :: report upgrade
|
||||
$>(%wegh vane-task) :: memory usage request
|
||||
$>(%west vane-task) :: remote request
|
||||
[%wind p=@ud] :: rewind before block
|
||||
== ::
|
||||
::
|
||||
++ block
|
||||
@ -2223,7 +2220,6 @@
|
||||
:: ::
|
||||
+$ source (each ship term)
|
||||
+$ source-id @udsourceid
|
||||
+$ snapshot ~
|
||||
::
|
||||
:: +state-eth-node: state of a connection to an ethereum node
|
||||
::
|
||||
@ -8971,36 +8967,6 @@
|
||||
(~(put by tuf) q.i.dom p.i.dom)
|
||||
$(dom t.dom)
|
||||
--
|
||||
:: |snap:dawn restore from snapshot
|
||||
::
|
||||
++ snap
|
||||
!:
|
||||
|%
|
||||
:: +bloq:snap:dawn: extract block number
|
||||
::
|
||||
++ bloq
|
||||
|= snap=snapshot:jael
|
||||
^- (unit @ud)
|
||||
~
|
||||
:: +czar:snap:dawn: extract galaxy table
|
||||
::
|
||||
++ czar
|
||||
|= snap=snapshot:jael
|
||||
^- (unit (map ship [=life =pass]))
|
||||
~
|
||||
:: +point:snap:dawn: extract ship's contract state
|
||||
::
|
||||
++ point
|
||||
|= [who=ship snap=snapshot:jael]
|
||||
^- (unit point:azimuth)
|
||||
~
|
||||
:: +turf:snap:dawn: extract network domains
|
||||
::
|
||||
++ turf
|
||||
|= snap=snapshot:jael
|
||||
^- (unit (list ^turf))
|
||||
~
|
||||
--
|
||||
:: +veri:dawn: validate keys, life, discontinuity, &c
|
||||
::
|
||||
++ veri
|
||||
|
@ -75,7 +75,6 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
u3_Host.ops_u.can = c3n;
|
||||
u3_Host.ops_u.dem = c3n;
|
||||
u3_Host.ops_u.dry = c3n;
|
||||
u3_Host.ops_u.etn = c3n;
|
||||
u3_Host.ops_u.gab = c3n;
|
||||
u3_Host.ops_u.git = c3n;
|
||||
|
||||
@ -95,7 +94,7 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
u3_Host.ops_u.kno_w = DefaultKernel;
|
||||
|
||||
while ( -1 != (ch_i=getopt(argc, argv,
|
||||
"G:J:B:K:A:H:I:w:u:e:E:f:F:k:m:p:LjabcCdgqstvxPDRS")) )
|
||||
"G:J:B:K:A:H:I:w:u:e:E:f:F:k:p:LjabcCdgqsvxPDRS")) )
|
||||
{
|
||||
switch ( ch_i ) {
|
||||
case 'J': {
|
||||
@ -164,10 +163,6 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
u3_Host.ops_u.key_c = strdup(optarg);
|
||||
break;
|
||||
}
|
||||
case 'm': {
|
||||
u3_Host.ops_u.sap_c = strdup(optarg);
|
||||
break;
|
||||
}
|
||||
case 'p': {
|
||||
if ( c3n == _main_readw(optarg, 65536, &arg_w) ) {
|
||||
return c3n;
|
||||
@ -192,7 +187,6 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
case 'v': { u3_Host.ops_u.veb = c3y; break; }
|
||||
case 's': { u3_Host.ops_u.git = c3y; break; }
|
||||
case 'S': { u3_Host.ops_u.has = c3y; break; }
|
||||
case 't': { u3_Host.ops_u.etn = c3y; break; }
|
||||
case '?': default: {
|
||||
return c3n;
|
||||
}
|
||||
@ -298,24 +292,6 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
return c3n;
|
||||
}
|
||||
|
||||
if ( u3_Host.ops_u.nuu != c3y && u3_Host.ops_u.sap_c != 0 ) {
|
||||
fprintf(stderr, "-m only makes sense when bootstrapping a new instance\n");
|
||||
return c3n;
|
||||
}
|
||||
|
||||
if ( u3_Host.ops_u.fak_c != 0 && u3_Host.ops_u.sap_c != 0 ) {
|
||||
fprintf(stderr, "-m and -F cannot be used together\n");
|
||||
return c3n;
|
||||
}
|
||||
|
||||
if ( u3_Host.ops_u.ets_c != 0 && u3_Host.ops_u.sap_c != 0 ) {
|
||||
fprintf(stderr, "-m and -E cannot be used together\n");
|
||||
return c3n;
|
||||
}
|
||||
if ( u3_Host.ops_u.can == c3y && u3_Host.ops_u.sap_c != 0 ) {
|
||||
fprintf(stderr, "-m and -C cannot be used together\n");
|
||||
return c3n;
|
||||
}
|
||||
if ( u3_Host.ops_u.can == c3y && u3_Host.ops_u.ets_c != 0 ) {
|
||||
fprintf(stderr, "-C and -E cannot be used together\n");
|
||||
return c3n;
|
||||
|
@ -300,33 +300,11 @@ _dawn_turf(c3_c* dns_c)
|
||||
u3_noun
|
||||
u3_dawn_vent(u3_noun seed)
|
||||
{
|
||||
u3_noun url, bok, pos, pon, zar, tuf, sap;
|
||||
u3_noun url, bok, pos, pon, zar, tuf;
|
||||
|
||||
u3_noun ship = u3h(seed);
|
||||
u3_noun rank = u3do("clan:title", u3k(ship));
|
||||
|
||||
// load snapshot from file
|
||||
//
|
||||
if ( 0 != u3_Host.ops_u.ets_c ) {
|
||||
u3l_log("boot: loading azimuth snapshot\r\n");
|
||||
u3_noun raw_snap = u3ke_cue(u3m_file(u3_Host.ops_u.ets_c));
|
||||
sap = u3nc(u3_nul, raw_snap);
|
||||
}
|
||||
// load snapshot from HTTP URL
|
||||
//
|
||||
else if ( 0 != u3_Host.ops_u.sap_c ) {
|
||||
u3l_log("boot: downloading azimuth snapshot from %s\r\n",
|
||||
u3_Host.ops_u.sap_c);
|
||||
u3_noun raw_snap = _dawn_get_jam(u3_Host.ops_u.sap_c);
|
||||
sap = u3nc(u3_nul, raw_snap);
|
||||
}
|
||||
// no snapshot
|
||||
//
|
||||
else {
|
||||
u3l_log("boot: no azimuth snapshot specified\n");
|
||||
sap = u3_nul;
|
||||
}
|
||||
|
||||
url = _dawn_purl(rank);
|
||||
|
||||
// XX require https?
|
||||
@ -337,14 +315,7 @@ u3_dawn_vent(u3_noun seed)
|
||||
|
||||
// pin block number
|
||||
//
|
||||
if ( c3y == u3_Host.ops_u.etn ) {
|
||||
u3l_log("boot: extracting block from snapshot\r\n");
|
||||
|
||||
bok = _dawn_need_unit(u3do("bloq:snap:dawn", u3k(u3t(sap))),
|
||||
"boot: failed to extract "
|
||||
"block from snapshot");
|
||||
}
|
||||
else {
|
||||
{
|
||||
u3l_log("boot: retrieving latest block\r\n");
|
||||
|
||||
u3_noun oct = u3v_wish("bloq:give:dawn");
|
||||
@ -360,14 +331,7 @@ u3_dawn_vent(u3_noun seed)
|
||||
//
|
||||
u3_noun pot;
|
||||
|
||||
if ( c3y == u3_Host.ops_u.etn ) {
|
||||
u3l_log("boot: extracting public keys from snapshot\r\n");
|
||||
|
||||
pot = _dawn_need_unit(u3dc("point:snap:dawn", u3k(ship), u3k(u3t(sap))),
|
||||
"boot: failed to extract "
|
||||
"public keys from snapshot");
|
||||
}
|
||||
else if ( c3__pawn == rank ) {
|
||||
if ( c3__pawn == rank ) {
|
||||
// irrelevant, just bunt +point
|
||||
//
|
||||
pot = u3v_wish("*point:azimuth");
|
||||
@ -435,14 +399,7 @@ u3_dawn_vent(u3_noun seed)
|
||||
|
||||
// (map ship [=life =pass]): galaxy table
|
||||
//
|
||||
if ( c3y == u3_Host.ops_u.etn ) {
|
||||
u3l_log("boot: extracting galaxy table from snapshot\r\n");
|
||||
|
||||
zar = _dawn_need_unit(u3do("czar:snap:dawn", u3k(u3t(sap))),
|
||||
"boot: failed to extract "
|
||||
"galaxy table from snapshot");
|
||||
}
|
||||
else {
|
||||
{
|
||||
u3l_log("boot: retrieving galaxy table\r\n");
|
||||
|
||||
u3_noun oct = u3do("czar:give:dawn", u3k(bok));
|
||||
@ -458,13 +415,6 @@ u3_dawn_vent(u3_noun seed)
|
||||
if ( 0 != u3_Host.ops_u.dns_c ) {
|
||||
tuf = _dawn_turf(u3_Host.ops_u.dns_c);
|
||||
}
|
||||
else if ( c3y == u3_Host.ops_u.etn ) {
|
||||
u3l_log("boot: extracting network domains from snapshot\r\n");
|
||||
|
||||
tuf = _dawn_need_unit(u3do("turf:snap:dawn", u3k(u3t(sap))),
|
||||
"boot: failed to extract "
|
||||
"network domains from snapshot");
|
||||
}
|
||||
else {
|
||||
u3l_log("boot: retrieving network domains\r\n");
|
||||
|
||||
@ -476,14 +426,7 @@ u3_dawn_vent(u3_noun seed)
|
||||
u3z(oct); u3z(fut);
|
||||
}
|
||||
|
||||
if ( c3y == u3_Host.ops_u.etn ) {
|
||||
u3l_log("boot: extracting sponsor keys from snapshot\r\n");
|
||||
|
||||
pon = _dawn_need_unit(u3do("point:snap:dawn", u3k(u3t(sap))),
|
||||
"boot: failed to extract "
|
||||
"sponsor keys from snapshot");
|
||||
}
|
||||
else {
|
||||
{
|
||||
u3l_log("boot: retrieving sponsor keys\r\n");
|
||||
|
||||
u3_noun oct = u3dc("point:give:dawn", u3k(bok), u3k(pos));
|
||||
@ -500,7 +443,7 @@ u3_dawn_vent(u3_noun seed)
|
||||
|
||||
// [%dawn seed sponsor galaxies domains block eth-url snap]
|
||||
//
|
||||
return u3nc(c3__dawn, u3nq(seed, pon, zar, u3nq(tuf, bok, url, sap)));
|
||||
return u3nc(c3__dawn, u3nq(seed, pon, zar, u3nt(tuf, bok, url)));
|
||||
}
|
||||
|
||||
/* _dawn_come(): mine a comet under a list of stars
|
||||
|
Loading…
Reference in New Issue
Block a user