From 2c97988bcecaf799187293a724b6fc63e8b12c1d Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:15:53 +0000 Subject: [PATCH] makefile streamline --- tools/genesis/Makefile | 69 +++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/tools/genesis/Makefile b/tools/genesis/Makefile index 3ba1f0ee9..f892538fd 100644 --- a/tools/genesis/Makefile +++ b/tools/genesis/Makefile @@ -9,9 +9,8 @@ FUTURE_USES = 0.70 endif ifndef RECOVERY_FILE -# RECOVERY_FILE = v5_recovery -RECOVERY_FILE = sample_export_recovery - +# RECOVERY_FILE = +RECOVERY_FILE = ./tests/fixtures/v5_recovery.json endif ifndef YEARS @@ -19,7 +18,7 @@ YEARS = 7 endif ifndef CHAIN -CHAIN = testnet +CHAIN = mainnet endif ifndef GIT_ORG @@ -27,17 +26,39 @@ GIT_ORG = 0LNetworkCommunity endif ifndef GIT_REPO -GIT_REPO = genesis-smoke +GIT_REPO = release-v6.9.0-rc.0-genesis-7 endif +install: + cargo build --release -p libra -p libra-genesis-tools -p libra-framework + cp ./target/release/libra* ~/.cargo/bin/ + +register: + libra-genesis-tools register --org-github ${GIT_ORG} --name-github ${GIT_REPO} +# have cli tools use localhost + libra config fix --force-url http://localhost:8080 + +legacy: +### Fetch Ancestry Data, Snapshot, and Use v5.2 codebase and snapshot to generate recovery.json for seeding v6.9.x state + sudo rm -Rf ~/libra-recovery && mkdir -p ~/libra-recovery + wget https://github.com/0LNetworkCommunity/epoch-archive/raw/main/670.tar.gz -O ~/libra-recovery/670.tar.gz + cd ~/libra-recovery && tar -xvzf 670.tar.gz + wget https://raw.githubusercontent.com/sirouk/ol-data-extraction/v-6.9.x-ready/assets/data.json -O ~/libra-recovery/v5_ancestry.json + + sudo rm -Rf ~/libra-legacy-v6 + cd ~ && git clone -b v6 https://github.com/0LNetworkCommunity/libra-legacy-v6 + cd ~/libra-legacy-v6/ol/genesis-tools + cargo r -p ol-genesis-tools -- --export-json ~/libra-recovery/v5_recovery.json --snapshot-path ~/libra-recovery/670/state_ver* --ancestry-file ~/libra-recovery/v5_ancestry.json + cp -f ~/libra-recovery/v5_recovery.json ~/libra-framework/tools/genesis/tests/fixtures/v5_recovery.json + md5sum ~/libra-framework/tools/genesis/tests/fixtures/v5_recovery.json" genesis: stdlib - cargo r -- \ + libra-genesis-tools -- \ -c ${CHAIN} \ genesis --org-github ${GIT_ORG} \ --name-github ${GIT_REPO} \ --local-framework \ - --json-legacy ./tests/fixtures/${RECOVERY_FILE}.json \ + --json-legacy ${RECOVERY_FILE} \ --target-supply ${TARGET_SUPPLY} \ --target-future-uses ${FUTURE_USES} \ --years-escrow ${YEARS} \ @@ -45,32 +66,24 @@ genesis: stdlib --map-dd-to-slow 2B0E8325DEA5BE93D856CFDE2D0CBA12 -wizard: - cargo r -- -c ${CHAIN} \ - wizard --org-github ${GIT_ORG} \ - --name-github ${GIT_REPO} \ - --local-framework \ - --json-legacy ./tests/fixtures/${RECOVERY_FILE}.json \ - --target-supply ${TARGET_SUPPLY} \ - --target-future-uses ${FUTURE_USES} \ - --years-escrow ${YEARS} \ - --map-dd-to-slow 3A6C51A0B786D644590E8A21591FA8E2 \ - --map-dd-to-slow 2B0E8325DEA5BE93D856CFDE2D0CBA12 - stdlib: - cargo r -p libra-framework -- release + libra-framework release + +############ TESTNET HELPERS ################ + -git-fetch: +testnet: testnet-git-fetch testnet-stdlib testnet-genesis testnet-node + +testnet-git-fetch: @echo WILL RESET GIT AND PULL LATEST COMMIT git reset --hard && git pull -f -testnet: git-fetch stdlib test-genesis node - -test-node: - cargo r -p libra -- node +testnet-stdlib: + cargo r -p libra-framework -- release -node: - diem-node -f ~/.libra/validator.yaml +testnet-node: +# assumes you have done `install` above + libra node ifndef ALICE_IP ALICE_IP = 134.209.32.159 @@ -84,7 +97,7 @@ ifndef CAROL_IP CAROL_IP = 165.22.34.98 endif -test-genesis: +testnet-genesis: LIBRA_CI=1 cargo r -- \ -c ${CHAIN} testnet \ -m ${PERSONA} \