# 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= ``` - 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 --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= ``` - 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 "" -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