Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e - Add step for installing `zstd` in macOS - Use ansible command module for running docker commands Co-authored-by: Shreerang Kale <shreerangkale@gmail.com> Reviewed-on: #30 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
83 lines
2.5 KiB
Markdown
83 lines
2.5 KiB
Markdown
# Export Testnet
|
|
|
|
## Prerequisites
|
|
|
|
- Machine where the SAPO testnet validator node is already running
|
|
|
|
- Install `zstd` using `sudo apt install zstd` (Linux) or `brew install zstd` (macOS)
|
|
|
|
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install)
|
|
|
|
- laconicd-stack
|
|
|
|
```bash
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
|
```
|
|
|
|
## Export testnet state
|
|
|
|
- Run the following steps in machine where the testnet node is already running (machine 1)
|
|
|
|
- Export the testnet deployment directory as environment variable:
|
|
|
|
```bash
|
|
export TESTNET_DEPLOYMENT_DIR=<absolute/path/to/testnet/deployment>
|
|
```
|
|
|
|
- Get your private key from testnet deployment (should be available if steps for joining SAPO testnet was followed previously):
|
|
|
|
```bash
|
|
laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR exec laconicd "laconicd keys export <key-name> --unarmored-hex --unsafe --keyring-backend test"
|
|
```
|
|
|
|
NOTE: Store this key securely as it is needed in later steps for signing bootstrap validator node gentx
|
|
|
|
- Stop the node for SAPO testnet:
|
|
|
|
```bash
|
|
laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR stop
|
|
```
|
|
|
|
- Run script to export state from testnet chain:
|
|
|
|
```bash
|
|
~/cerc/laconicd-stack/scripts/export-testnet-state.sh $TESTNET_DEPLOYMENT_DIR
|
|
```
|
|
|
|
- The compressed zst file will be generated at `$TESTNET_DEPLOYMENT_DIR/export/testnet-state.zst`
|
|
|
|
- The generated state file will be used in later steps for creating genesis.json file for mainnet
|
|
|
|
## Prepare LPS distribution JSON
|
|
|
|
- The following steps can be performed in any machine
|
|
|
|
- Fetch laconicd-stack
|
|
|
|
```bash
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
|
```
|
|
|
|
- Set envs:
|
|
|
|
```bash
|
|
# File path where LPS distribution JSON file will be created
|
|
export LPS_DISTRIBUTION_PATH=<absolute/path/to/distribution.json>
|
|
```
|
|
|
|
- Generate lockup distribution JSON file with LPS distribution Google spreadsheet URL or downloaded CSV file path
|
|
|
|
```bash
|
|
~/cerc/laconicd-stack/scripts/generate-lps-lock.sh -i "<lps-distribution-spreadsheet-url-or-csv-file-path>" -o $LPS_DISTRIBUTION_PATH
|
|
```
|
|
|
|
- This will generate the JSON file at `$LPS_DISTRIBUTION_PATH` which will be later required when creating genesis file
|
|
|
|
## Requirements for Mainnet Genesis
|
|
|
|
- Exported testnet state
|
|
- LPS distribution JSON
|
|
- Account address for early supports
|
|
- This account will be allocated 20% of total LPS tokens
|
|
- Private key of account which will sign gentx for the bootstrap validator node
|