forked from 0LNetworkCommunity/libra-legacy-v6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
571 lines (436 loc) · 17.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
#### VARIABLES ####
SHELL=/usr/bin/env bash
DATA_PATH = ${HOME}/.0L
USER_BIN_PATH = ${HOME}/bin
# Chain settings
CHAIN_ID = 1
ifndef SOURCE
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
SOURCE=${MAKEFILE_DIR}
endif
# Account settings
ifndef ACC
ACC=$(shell toml get ${DATA_PATH}/0L.toml profile.account | tr -d '"')
endif
IP=$(shell toml get ${DATA_PATH}/0L.toml profile.ip)
# Github settings
GITHUB_TOKEN = $(shell cat ${DATA_PATH}/github_token.txt || echo NOT FOUND)
REPO_ORG = OLSF
REPO_NAME = genesis-registration
CARGO_ARGS = --release
# testnet automation settings
ifeq (${TEST}, y)
REPO_NAME = dev-genesis
MNEM = $(shell cat ol/
fixtures/mnemonic/${NS}.mnem)
CARGO_ARGS = --locked # just keeping this from doing --release mode, while in testnet mode.
GITHUB_USER = OLSF
endif
# Registration params
REMOTE = 'backend=github;repository_owner=${GITHUB_USER};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=${ACC}'
GENESIS_REMOTE = 'backend=github;repository_owner=${REPO_ORG};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=${ACC}'
LOCAL = 'backend=disk;path=${DATA_PATH}/key_store.json;namespace=${ACC}'
RELEASE_URL=https://github.com/OLSF/libra/releases/download
ifndef RELEASE
RELEASE=$(shell curl -sL https://api.github.com/repos/OLSF/libra/releases/latest | jq -r '.assets[].browser_download_url')
endif
BINS=db-backup db-backup-verify db-restore diem-node tower ol txs stdlib
ifndef V
V=previous
endif
##### DEPENDENCIES #####
deps:
. ./ol/util/setup.sh
download: web-files
@for b in ${RELEASE} ; do \
echo $$b | rev | cut -d"/" -f1 | rev ; \
curl --progress-bar --create-dirs -o ${USER_BIN_PATH}/$$(echo $$b | rev | cut -d"/" -f1 | rev) -L $$b ; \
echo 'downloaded to ${USER_BIN_PATH}' ; \
chmod 744 ${USER_BIN_PATH}/$$(echo $$b | rev | cut -d"/" -f1 | rev) ;\
done
web-files:
curl -L --progress-bar --create-dirs -o ${DATA_PATH}/web-monitor.tar.gz https://github.com/OLSF/libra/releases/latest/download/web-monitor.tar.gz
mkdir ${DATA_PATH}/web-monitor | true
tar -xf ${DATA_PATH}/web-monitor.tar.gz --directory ${DATA_PATH}/web-monitor
download-release:
@for b in ${BINS} ; do \
echo $$b ; \
curl --create-dirs -o ${DATA_PATH}/release-${RELEASE}/$$b -L ${RELEASE_URL}/${RELEASE}/$$b ; \
chmod 744 ${DATA_PATH}/release-${RELEASE}/$$b ; \
cp ${DATA_PATH}/release-${RELEASE}/$$b ${USER_BIN_PATH}/$$b ; \
done
uninstall:
@for b in ${BINS} ; do \
rm ${USER_BIN_PATH}/$$b ; \
done
bins: stdlib
# Build and install genesis tool, diem-node, and tower
# NOTE: stdlib is built for cli bindings
cargo build -p diem-node -p tower -p backup-cli -p ol -p txs -p onboard ${CARGO_ARGS}
stdlib:
# cargo run ${CARGO_ARGS} -p diem-framework
cargo run ${CARGO_ARGS} -p diem-framework -- --create-upgrade-payload
sha256sum language/diem-framework/staged/stdlib.mv
install: mv-bin bin-path
mkdir ${USER_BIN_PATH} | true
cp -f ${SOURCE}/target/release/tower ${USER_BIN_PATH}/tower
cp -f ${SOURCE}/target/release/diem-node ${USER_BIN_PATH}/diem-node
cp -f ${SOURCE}/target/release/db-restore ${USER_BIN_PATH}/db-restore
cp -f ${SOURCE}/target/release/db-backup ${USER_BIN_PATH}/db-backup
cp -f ${SOURCE}/target/release/db-backup-verify ${USER_BIN_PATH}/db-backup-verify
cp -f ${SOURCE}/target/release/ol ${USER_BIN_PATH}/ol
cp -f ${SOURCE}/target/release/txs ${USER_BIN_PATH}/txs
cp -f ${SOURCE}/target/release/onboard ${USER_BIN_PATH}/onboard
bin-path:
@if (cat ~/.bashrc | grep '~/bin:') ; then \
echo "OK .bashrc correctly configured with PATH=~/bin" ; \
else \
echo -n "WARN Your .bashrc doesn't seem to have ~/bin as a search path. Append .bashrc with PATH=~/bin:$$PATH ? (y/n) " ; \
read answer ; \
if [ "$$answer" != "$${answer#[Yy]}" ] ; then \
echo adding to PATH ; \
echo PATH=~/bin:$$PATH >> ~/.bashrc ; \
fi ; \
fi
mv-bin:
@if which ol | grep /usr/local/bin ; then \
echo -n "You have executables in a deprecated location. Move the executables from /usr/local/bin to ~/bin? (y/n) " ; \
read answer ; \
if [ "$$answer" != "$${answer#[Yy]}" ] ; then \
echo copy all bins ; \
mkdir ~/bin/ | true ; \
mv /usr/local/bin/* ${USER_BIN_PATH} ; \
fi ; \
fi
reset:
onboard val --skip-mining --upstream-peer http://167.172.248.37/ --source-path ~/libra
backup:
cd ~ && rsync -av --exclude db/ --exclude logs/ ~/.0L/* ~/0L_backup_$(shell date +"%m-%d-%y-%T")
confirm:
@read -p "Continue (y/n)?" CONT; \
if [ "$$CONT" = "y" ]; then \
echo "deleting...."; \
else \
exit 1; \
fi \
danger-restore:
cp ${HOME}/0L_backup/github_token.txt ${HOME}/.0L/ | true
cp ${HOME}/0L_backup/autopay_batch.json ${HOME}/.0L/ | true
rsync -rtv ${HOME}/0L_backup/blocks/ ${HOME}/.0L/blocks | true
rsync -rtv ${HOME}/0L_backup/vdf_proofs/ ${HOME}/.0L/vdf_proofs | true
rsync -rtv ${HOME}/0L_backup/set_layout.toml ${HOME}/.0L/ | true
clear-prod-db:
@echo WIPING DB
make confirm
rm -rf ${DATA_PATH}/db | true
reset-safety:
@echo CLEARING SAFETY RULES IN KEY_STORE.JSON
jq -r '.["${ACC}-oper/safety_data"].value = { "epoch": 0, "last_voted_round": 0, "preferred_round": 0, "last_vote": null }' ${DATA_PATH}/key_store.json > ${DATA_PATH}/temp_key_store && mv ${DATA_PATH}/temp_key_store ${DATA_PATH}/key_store.json
move-test:
cd language/move-lang/functional-tests/ && cargo t 0L
#### GENESIS BACKEND SETUP ####
init-backend:
curl -X POST -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/orgs/${REPO_ORG}/repos -d '{"name":"${REPO_NAME}", "private": "true", "auto_init": "true"}'
layout:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- set-layout \
--shared-backend 'backend=github;repository_owner=${REPO_ORG};repository=${REPO_NAME};token=${DATA_PATH}/github_token.txt;namespace=common' \
--path ./ol/devnet/set_layout_${NODE_ENV}.toml
root:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- diem-root-key \
--validator-backend ${LOCAL} \
--shared-backend ${REMOTE}
treasury:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- treasury-compliance-key \
--validator-backend ${LOCAL} \
--shared-backend ${REMOTE}
#### GENESIS REGISTRATION ####
gen-fork-repo:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- create-repo \
--repo-name ${REPO_NAME} \
--repo-owner ${REPO_ORG} \
--shared-backend ${REMOTE}
gen-make-pull:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- create-repo \
--repo-name ${REPO_NAME} \
--repo-owner ${REPO_ORG} \
--shared-backend ${GENESIS_REMOTE} \
--pull-request-user ${GITHUB_USER}
gen-delete-fork:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- create-repo \
--repo-name ${REPO_NAME} \
--repo-owner ${REPO_ORG} \
--shared-backend ${GENESIS_REMOTE} \
--delete-repo-user ${GITHUB_USER}
gen-onboard:
cargo run -p onboard ${CARGO_ARGS} -- val --genesis-ceremony
gen-reset:
cargo run -p onboard ${CARGO_ARGS} -- val --genesis-ceremony --skip-mining
gen-register:
@echo the OPER initializes local accounts and submit pubkeys to github
ACC=${ACC}-oper make oper-key
@echo The OWNERS initialize local accounts and submit pubkeys to github, and mining proofs
make owner-key add-proofs
@echo OWNER *assigns* an operator.
OPER=${ACC}-oper make assign
@echo OPER send signed transaction with configurations for *OWNER* account
ACC=${ACC}-oper OWNER=${ACC} IP=${IP} make reg
@echo Making pull request to genesis coordination repo
make gen-make-pull
init-test:
echo ${MNEM} | head -c -1 | cargo run -p diem-genesis-tool -- init --path=${DATA_PATH} --namespace=${ACC}
init:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- init --path=${DATA_PATH} --namespace=${ACC}
# OWNER does this
# Submits proofs to shared storage
add-proofs:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- mining \
--path-to-genesis-pow ${DATA_PATH}/vdf_proofs/proof_0.json \
--path-to-account-json ${DATA_PATH}/account.json \
--shared-backend ${REMOTE}
# OPER does this
# Submits operator key to github, and creates local OPERATOR_ACCOUNT
oper-key:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- operator-key \
--validator-backend ${LOCAL} \
--shared-backend ${REMOTE}
# OWNER does this
# Submits operator key to github, does *NOT* create the OWNER_ACCOUNT locally
owner-key:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- owner-key \
--validator-backend ${LOCAL} \
--shared-backend ${REMOTE}
# OWNER does this
# Links to an operator on github, creates the OWNER_ACCOUNT locally
assign:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- set-operator \
--operator-name ${OPER} \
--shared-backend ${REMOTE}
# OPER does this
# Submits signed validator registration transaction to github.
reg:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- validator-config \
--owner-name ${OWNER} \
--chain-id ${CHAIN_ID} \
--validator-address "/ip4/${IP}/tcp/6180" \
--fullnode-address "/ip4/${IP}/tcp/6179" \
--validator-backend ${LOCAL} \
--shared-backend ${REMOTE}
# Helpers to verify the local state.
verify:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- verify \
--validator-backend ${LOCAL}
# --genesis-path ${DATA_PATH}/genesis.blob
verify-gen:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- verify \
--validator-backend ${LOCAL} \
--genesis-path ${DATA_PATH}/genesis.blob
genesis:
cargo run -p diem-genesis-tool ${CARGO_ARGS} -- files \
--chain-id ${CHAIN_ID} \
--validator-backend ${LOCAL} \
--data-path ${DATA_PATH} \
--namespace ${ACC}-oper \
--repo ${REPO_NAME} \
--github-org ${REPO_ORG} \
--layout-path ${DATA_PATH}/set_layout.toml \
--val-ip-address ${IP}
sha256sum ${DATA_PATH}/genesis.blob
#### NODE MANAGEMENT ####
start:
# run in foreground. Only for testing, use a daemon for net.
RUST_LOG=error cargo run -p diem-node -- --config ${DATA_PATH}/validator.node.yaml
# Start a fullnode instead of a validator node
start-full:
cargo run -p diem-node -- --config ${DATA_PATH}/fullnode.node.yaml
daemon:
mkdir -p ~/.config/systemd/user/
cp ./ol/util/diem-node.service ~/.config/systemd/user/
@if test -d ~/logs; then \
echo "WIPING SYSTEMD LOGS"; \
rm -rf ~/logs*; \
fi
mkdir ~/logs
touch ~/logs/node.log
systemctl --user daemon-reload
systemctl --user stop diem-node.service
systemctl --user start diem-node.service
sleep 2
systemctl --user status diem-node.service &
tail -f ~/logs/node.log
#### TEST SETUP ####
clear:
ifeq (${TEST}, y)
@if test -d ${DATA_PATH}; then \
cd ${DATA_PATH} && rm -rf libradb *.yaml *.blob *.json db *.toml; \
fi
@if test -d ${DATA_PATH}/vdf_proofs; then \
rm -f ${DATA_PATH}/vdf_proofs/*.json; \
fi
endif
fixture-stdlib:
make stdlib
cp language/diem-framework/staged/stdlib.mv ol/fixtures/stdlib/fresh_stdlib.mv
#### HELPERS ####
check:
@echo data path: ${DATA_PATH}
@echo account: ${ACC}
@echo github_token: ${GITHUB_TOKEN}
@echo ip: ${IP}
@echo node path: ${DATA_PATH}
@echo github_org: ${REPO_ORG}
@echo github_repo: ${REPO_NAME}
@echo env: ${NODE_ENV}
@echo devnet mode: ${TEST}
@echo devnet name: ${NS}
@echo devnet mnem: ${MNEM}
fix:
ifdef TEST
@echo NAMESPACE: ${NS}
@echo GENESIS: ${V}
@if test ! -d ${DATA_PATH}; then \
echo Creating Directories; \
mkdir ${DATA_PATH}; \
mkdir -p ${DATA_PATH}/vdf_proofs/; \
fi
@if test ! -d ${DATA_PATH}/vdf_proofs; then \
echo Creating Directories; \
mkdir -p ${DATA_PATH}/vdf_proofs/; \
fi
@if test -f ${DATA_PATH}/vdf_proofs/proof_0.json; then \
rm ${DATA_PATH}/vdf_proofs/proof_0.json; \
fi
@if test -f ${DATA_PATH}/0L.toml; then \
rm ${DATA_PATH}/0L.toml; \
fi
# skip miner configuration with fixtures
cp ./ol/fixtures/configs/${NS}.toml ${DATA_PATH}/0L.toml
# skip mining proof zero with fixtures
cp ./ol/fixtures/vdf_proofs/${NODE_ENV}/${NS}/proof_0.json ${DATA_PATH}/vdf_proofs/proof_0.json
# place a mock autopay.json in root
cp ./ol/fixtures/autopay/${NS}.autopay_batch.json ${DATA_PATH}/autopay_batch.json
# place a mock account.json in root, used as template for onboarding
cp ./ol/fixtures/account/${NS}.account.json ${DATA_PATH}/account.json
# replace the set_layout
cp ./ol/devnet/set_layout_test.toml ${DATA_PATH}/set_layout.toml
endif
fix-genesis:
cp ./ol/devnet/genesis/${V}/genesis.blob ${DATA_PATH}/
cp ./ol/devnet/genesis/${V}/genesis_waypoint ${DATA_PATH}/
#### HELPERS ####
set-waypoint:
@if test -f ${DATA_PATH}/key_store.json; then \
jq -r '. | with_entries(select(.key|match("-oper/waypoint";"i")))[].value' ${DATA_PATH}/key_store.json > ${DATA_PATH}/client_waypoint; \
jq -r '. | with_entries(select(.key|match("-oper/genesis-waypoint";"i")))[].value' ${DATA_PATH}/key_store.json > ${DATA_PATH}/genesis_waypoint; \
fi
@echo client_waypoint:
@cat ${DATA_PATH}/client_waypoint
client: set-waypoint
# ifeq (${TEST}, y)
# echo ${MNEM} | cargo run -p cli -- -u http://localhost:8080 --waypoint $$(cat ${DATA_PATH}/client_waypoint) --chain-id ${CHAIN_ID}
# else
cargo run -p cli -- -u http://localhost:8080 --waypoint $$(cat ${DATA_PATH}/client_waypoint) --chain-id ${CHAIN_ID}
# endif
keygen:
cd ${DATA_PATH} && onboard keygen
# miner-genesis:
# cd ${DATA_PATH} && NODE_ENV=${NODE_ENV} miner genesis
# reset: stop clear fixtures init keys daemon
remove-keys:
make stop
jq 'del(.["${ACC}-oper/owner", "${ACC}-oper/operator"])' ${DATA_PATH}/key_store.json > ${DATA_PATH}/tmp
mv ${DATA_PATH}/tmp ${DATA_PATH}/key_store.json
wipe:
history -c
shred ~/.bash_history
srm ~/.bash_history
stop:
systemctl --user stop diem-node.service
debug:
make smoke-onboard <<< $$'${MNEM}'
##### DEVNET TESTS #####
devnet: clear fix dev-wizard dev-genesis start
# runs a smoke test from fixtures.
# Uses genesis blob from fixtures, assumes 3 validators, and test settings.
# This will work for validator nodes alice, bob, carol, and any fullnodes; 'eve'
dev-join: clear fix fix-genesis dev-wizard
# REQUIRES MOCK GIT INFRASTRUCTURE: OLSF/dev-genesis OLSF/dev-epoch-archive
# see `devnet-archive` below
# We want to simulate the onboarding/new validator fetching genesis files from the mock archive: dev-genesis-archive
# mock restore backups from dev-epoch-archive
rm -rf ~/.0L/restore
# restore from MOCK archive OLSF/dev-epoch-archive
cargo r -p ol -- restore
# start a node with fullnode.node.yaml configs
make start-full
dev-wizard:
# REQUIRES there is a genesis.blob in the fixtures/genesis/<version> you are testing
MNEM='${MNEM}' cargo run -p onboard -- val --prebuilt-genesis ${DATA_PATH}/genesis.blob --skip-mining --chain-id 1 --genesis-ceremony
#### DEVNET RESTART ####
# usually do this on Alice, which has the dev-epoch-archive repo, and dev-genesis
# Do the ceremony: and also save the genesis fixtures, needs to happen before fix.
dev-register: clear fix dev-wizard gen-register
# Do a dev genesis on each node after EVERY NODE COMPLETED registration.
dev-genesis: genesis dev-save-genesis fix-genesis
#### DEVNET INFRA ####
# To make reproducible devnet files.
# Save the files to mock infrastructure i.e. devnet github
dev-infra: dev-backup-archive dev-commit
dev-save-genesis: set-waypoint
rsync -a ${DATA_PATH}/genesis* ${SOURCE}/ol/devnet/genesis/${V}/
git add ${SOURCE}/ol/devnet/genesis/${V}/
dev-backup-archive:
cd ${HOME}/dev-epoch-archive && make devnet-backup
dev-commit:
git commit -a -m "save genesis fixtures to ${V}" | true
git push | true
TAG=$(shell git tag -l "previous")
clean-tags:
git push origin --delete ${TAG}
git tag -d ${TAG}
nuke-testnet:
@echo WIPING EVERYTHING but keeping: github_token.txt, autopay_batch.json, set_layout.toml, /vdf_proofs/proof_0.json
@if test -d ${DATA_PATH}; then \
cd ${DATA_PATH} && cp github_token.txt autopay_batch.json set_layout.toml vdf_proofs/proof_0.json ~/; \
cd ${DATA_PATH} && rm -rf *; \
cd ~ && cp github_token.txt autopay_batch.json set_layout.toml ${DATA_PATH}; \
cd ${DATA_PATH} && mkdir vdf_proofs;\
cd ~ && cp proof_0.json ${DATA_PATH}/vdf_proofs/; \
fi
####### SWARM ########
sw: sw-build sw-start sw-init
## Build
sw-stdlib:
cd ${SOURCE} && cargo run -p diem-framework ${CARGO_ARGS}
sw-build:
cargo build -p diem-node -p diem-swarm -p cli ${CARGO_ARGS}
## Swarm
sw-start:
cd ${SOURCE} && cargo run ${CARGO_ARGS} -p diem-swarm -- --diem-node target/debug/diem-node -c ${DATA_PATH}/swarm_temp -n 1 -s --cli-path ${SOURCE}/target/debug/cli
sw-init:
cd ${SOURCE} && cargo r ${CARGO_ARGS} -p ol -- --swarm-path ${DATA_PATH}/swarm_temp/ --swarm-persona alice init --source-path ~/libra
sw-miner:
cd ${SOURCE} && cargo r -p tower -- --swarm-path ${DATA_PATH}/swarm_temp --swarm-persona alice start
sw-query:
cd ${SOURCE} && cargo r -p ol -- --swarm-path ${DATA_PATH}/swarm_temp --swarm-persona alice query --txs
sw-tx:
cd ${SOURCE} && cargo r -p txs -- --swarm-path ${DATA_PATH}/swarm_temp --swarm-persona alice wallet -s
##### FORK TESTS #####
fork: stdlib fork-genesis fork-config fork-start
EPOCH_HEIGHT = $(shell cargo r -p ol -- query --epoch | cut -d ":" -f 2)
epoch:
cargo r -p ol -- query --epoch
echo ${EPOCH_HEIGHT}
fork-backup:
rm -rf ${SOURCE}/ol/devnet/snapshot/*
cargo run -p backup-cli --bin db-backup -- one-shot backup --backup-service-address http://localhost:6186 state-snapshot --state-version ${EPOCH_HEIGHT} local-fs --dir ${SOURCE}/ol/devnet/snapshot/
# Make genesis file
fork-genesis:
cargo run -p ol-genesis-tools -- --genesis ${DATA_PATH}/genesis_from_snapshot.blob --snapshot ${SOURCE}/ol/devnet/snapshot/state_ver*
# Use onboard to create all node files
fork-config:
cargo run -p onboard -- fork -u http://167.172.248.37 --prebuilt-genesis ${DATA_PATH}/genesis_from_snapshot.blob
# start node from files
fork-start:
rm -rf ~/.0L/db
cargo run -p libra-node -- --config ~/.0L/validator.node.yaml