Add steps to compress testnet state JSON file #11

Merged
nabarun merged 3 commits from iv-compress-testnet-state into main 2025-06-04 11:25:23 +00:00
3 changed files with 26 additions and 6 deletions

View File

@ -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)
```
- Extract the testnet-state JSON file
```
gzip -dc $CWD/testnet-state.gz > $CWD/testnet-state.json
# Remove zip folder
rm -rf testnet-state.gz
```
- Set envs:
```bash

View File

@ -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 <absolute-path-to-testnet-deployment>
```
- The file will be generated in `<absolute-path-to-testnet-deployment>/export/testnet-state.json`
- The compressed gzip will be generated at `<absolute-path-to-testnet-deployment>/export/testnet-state.gz`
## Generate mainnet genesis file
@ -44,7 +45,16 @@
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
```
- Copy over the exported `testnet-state.json` file to target machine
- Copy over compressed `testnet-state.gz` file to target machine
- Extract the testnet-state JSON file
```
gzip -dc <path-to-compressed-file>/testnet-state.gz > testnet-state.json
# Remove zip folder
rm -rf <path-to-compressed-file>/testnet-state.gz
```
- Generate LPS lockup distribution JSON file

View File

@ -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.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"