From 4b64d5f790812108f5dfba43b7198ce8ee7221aa Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 3 Jun 2025 19:01:10 +0530 Subject: [PATCH 1/3] Compress exported testnet state --- scripts/export-testnet-state.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/export-testnet-state.sh b/scripts/export-testnet-state.sh index a6b21d4..8a2a74e 100755 --- a/scripts/export-testnet-state.sh +++ b/scripts/export-testnet-state.sh @@ -19,10 +19,10 @@ OUTPUT_DIR=${TESTNET_DEPLOYMENT_DIR}/export mkdir -p $OUTPUT_DIR # Export state from testnet chain -testnet_state_file="$OUTPUT_DIR/testnet-state.json" +testnet_state_file="$OUTPUT_DIR/testnet-state.json.gz" docker run -it \ -v ${TESTNET_DEPLOYMENT_DIR}/data/laconicd-data:/root/testnet-deployment/.laconicd \ cerc/laconicd:local bash -c "laconicd export --home /root/testnet-deployment/.laconicd" \ - | jq > "$testnet_state_file" + | jq | gzip > "$testnet_state_file" echo "Exported state from testnet to $testnet_state_file" -- 2.45.2 From bd8b4c9857731f2f70cd8bdfbde97138f495d348 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Wed, 4 Jun 2025 09:25:01 +0530 Subject: [PATCH 2/3] Update README instructions --- docs/demo.md | 14 ++++++++++++-- docs/run-first-validator.md | 12 +++++++++++- scripts/export-testnet-state.sh | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/demo.md b/docs/demo.md index 251a7d5..9c7b995 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -9,12 +9,13 @@ ```bash cargo install tmkms --features=softsign --version=0.14.0 ``` -- testnet-state.json ([exported testnet state](./run-first-validator.md#export-testnet-state)) +- Install `gzip` using `sudo apt install gzip` +- testnet-state.gz ([exported testnet state](./run-first-validator.md#export-testnet-state)) - LPS distribution Google spreadsheet URL or CSV file path ## Steps -- In current working directory demo, keep exported `testnet-state.json` file from prerequisites +- In current working directory demo, keep exported `testnet-state.gz` file from prerequisites - Fetch stack: @@ -36,6 +37,15 @@ export CWD=$(pwd) ``` +- Copy over compressed file before this + + ``` + gzip -dc $CWD/testnet-state.gz > $CWD/testnet-state.json + + # Remove zip folder + rm -rf testnet-state.gz + ``` + - Set envs: ```bash diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index a3bc9b6..cb8df26 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -5,6 +5,7 @@ - [ansible](playbooks/README.md#ansible-installation) - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) - LPS distribution Google spreadsheet URL or CSV file path +- Install `gzip` using `sudo apt install gzip` ## Export testnet state @@ -34,7 +35,7 @@ ~/cerc/laconicd-stack/scripts/export-testnet-state.sh ``` - - The file will be generated in `/export/testnet-state.json` + - The compressed gzip will be generated at `/export/testnet-state.gz` ## Generate mainnet genesis file @@ -44,6 +45,15 @@ laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull ``` +- Copy over compressed file before this + + ``` + gzip -dc /export/testnet-state.gz > testnet-state.json + + # Remove zip folder + rm -rf /export/testnet-state.gz + ``` + - Copy over the exported `testnet-state.json` file to target machine - Generate LPS lockup distribution JSON file diff --git a/scripts/export-testnet-state.sh b/scripts/export-testnet-state.sh index 8a2a74e..757f4d4 100755 --- a/scripts/export-testnet-state.sh +++ b/scripts/export-testnet-state.sh @@ -19,7 +19,7 @@ OUTPUT_DIR=${TESTNET_DEPLOYMENT_DIR}/export mkdir -p $OUTPUT_DIR # Export state from testnet chain -testnet_state_file="$OUTPUT_DIR/testnet-state.json.gz" +testnet_state_file="$OUTPUT_DIR/testnet-state.gz" docker run -it \ -v ${TESTNET_DEPLOYMENT_DIR}/data/laconicd-data:/root/testnet-deployment/.laconicd \ cerc/laconicd:local bash -c "laconicd export --home /root/testnet-deployment/.laconicd" \ -- 2.45.2 From 479c79f1d91297675904ee0d132c81019ca56250 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Wed, 4 Jun 2025 16:38:37 +0530 Subject: [PATCH 3/3] Update steps for extracting JSON file --- docs/demo.md | 2 +- docs/run-first-validator.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/demo.md b/docs/demo.md index 9c7b995..a8878fb 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -37,7 +37,7 @@ export CWD=$(pwd) ``` -- Copy over compressed file before this +- Extract the testnet-state JSON file ``` gzip -dc $CWD/testnet-state.gz > $CWD/testnet-state.json diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index cb8df26..eac5cc7 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -45,17 +45,17 @@ laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull ``` -- Copy over compressed file before this +- Copy over compressed `testnet-state.gz` file to target machine + +- Extract the testnet-state JSON file ``` - gzip -dc /export/testnet-state.gz > testnet-state.json + gzip -dc /testnet-state.gz > testnet-state.json # Remove zip folder - rm -rf /export/testnet-state.gz + rm -rf /testnet-state.gz ``` -- Copy over the exported `testnet-state.json` file to target machine - - Generate LPS lockup distribution JSON file ```bash -- 2.45.2