Use zstd to compress testnet state file #12
12
docs/demo.md
12
docs/demo.md
@ -9,13 +9,13 @@
|
||||
```bash
|
||||
cargo install tmkms --features=softsign --version=0.14.0
|
||||
```
|
||||
- Install `gzip` using `sudo apt install gzip`
|
||||
- testnet-state.gz ([exported testnet state](./run-first-validator.md#export-testnet-state))
|
||||
- Install `zstd` using `sudo apt install zstd`
|
||||
- testnet-state.zst ([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.gz` file from prerequisites
|
||||
- In current working directory demo, keep exported `testnet-state.zst` file from prerequisites
|
||||
|
||||
- Fetch stack:
|
||||
|
||||
@ -40,10 +40,10 @@
|
||||
- Extract the testnet-state JSON file
|
||||
|
||||
```
|
||||
gzip -dc $CWD/testnet-state.gz > $CWD/testnet-state.json
|
||||
zstd -dc $CWD/testnet-state.zst > $CWD/testnet-state.json
|
||||
|
||||
# Remove zip folder
|
||||
rm -rf testnet-state.gz
|
||||
# Remove zst folder
|
||||
rm -rf testnet-state.zst
|
||||
```
|
||||
|
||||
- Set envs:
|
||||
|
@ -5,7 +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`
|
||||
- Install `zstd` using `sudo apt install zstd`
|
||||
|
||||
## Export testnet state
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
~/cerc/laconicd-stack/scripts/export-testnet-state.sh <absolute-path-to-testnet-deployment>
|
||||
```
|
||||
|
||||
- The compressed gzip will be generated at `<absolute-path-to-testnet-deployment>/export/testnet-state.gz`
|
||||
- The compressed zst file will be generated at `<absolute-path-to-testnet-deployment>/export/testnet-state.zst`
|
||||
|
||||
## Generate mainnet genesis file
|
||||
|
||||
@ -45,15 +45,15 @@
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||
```
|
||||
|
||||
- Copy over compressed `testnet-state.gz` file to target machine
|
||||
- Copy over compressed `testnet-state.zst` file to target machine
|
||||
|
||||
- Extract the testnet-state JSON file
|
||||
|
||||
```
|
||||
gzip -dc <path-to-compressed-file>/testnet-state.gz > testnet-state.json
|
||||
zstd -dc <path-to-compressed-file>/testnet-state.zst > testnet-state.json
|
||||
|
||||
# Remove zip folder
|
||||
rm -rf <path-to-compressed-file>/testnet-state.gz
|
||||
# Remove zst folder
|
||||
rm -rf <path-to-compressed-file>/testnet-state.zst
|
||||
```
|
||||
|
||||
- Generate LPS lockup distribution JSON 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.gz"
|
||||
testnet_state_file="$OUTPUT_DIR/testnet-state.zst"
|
||||
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 | gzip > "$testnet_state_file"
|
||||
| jq | zstd > "$testnet_state_file"
|
||||
|
||||
echo "Exported state from testnet to $testnet_state_file"
|
||||
|
Loading…
Reference in New Issue
Block a user