diff --git a/run-first-validator.md b/run-first-validator.md index 9c8d543..53f7b43 100644 --- a/run-first-validator.md +++ b/run-first-validator.md @@ -7,26 +7,64 @@ ## Generate mainnet genesis file - +- Fetch the stack in machine where the testnet chain node is running + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull + ``` + +- Run script to export state from testnet chain + + ```bash + ~/cerc/laconicd-stack/scripts/export-testnet-state.sh + ``` + + - The file will be generated in `/export/testnet-state.json` + + + + +- If mainnet node will be setup in new machine, fetch the stack again + +- Build container image + + ```bash + # Fetch laconicd repo specified in stack + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd setup-repositories --git-ssh --pull + + # Build image + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers + ``` + +- Copy the generated exported state from earlier + + ```bash + cp ~/cerc/laconicd-stack/testnet-state.json + ``` + +- Run script to generate genesis file using the exported state + + ```bash + ~/cerc/laconicd-stack/scripts/generate-mainnet-genesis.sh ~/cerc/laconicd-stack/testnet-state.json + ``` + + - Genesis file will generated in `output/genesis.json` ## Run node - Update [run-first-validator-vars.yml](playbooks/first-validator/run-first-validator-vars.yml) with required values: - - Use the mainnet genesis file generated in the previous step - ```bash # Private key of the existing account in hex format (required for gentx) pvt_key: "" - # Path to the generated mainnet genesis file + # Path to the generated mainnet genesis file generated in the previous step genesis_file: "" - # Optional - cerc_chain_id: "laconic-mainnet" + # Set custom moniker for the node cerc_moniker: "MainnetNode" - min_gas_price: 0.001 - cerc_loglevel: "info" + + # Set desired key name key_name: "validator" ``` diff --git a/scripts/genesis.sh b/scripts/genesis.sh index 31589b1..d055438 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -43,5 +43,7 @@ jq --arg old "$zero_address" --arg new "$lps_lockup_address" \ '.app_state.bank.balances |= map(if .address == $old then .address = $new else . end)' "$mainnet_genesis_file" > tmp.$$.json \ && mv tmp.$$.json "$mainnet_genesis_file" +# TODO: Dump JSON for allocations in LPS_LOCKUP_MODULE_ACCOUNT state + # Ensure that resulting genesis file is valid laconicd genesis validate diff --git a/stack-orchestrator/stacks/mainnet-laconicd/stack.yml b/stack-orchestrator/stacks/mainnet-laconicd/stack.yml index d65a7e0..3240acd 100644 --- a/stack-orchestrator/stacks/mainnet-laconicd/stack.yml +++ b/stack-orchestrator/stacks/mainnet-laconicd/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: mainnet-laconicd description: "Laconicd full node" repos: - - git.vdb.to/cerc-io/laconicd@v0.1.11 + - git.vdb.to/cerc-io/laconicd@mainnet containers: - cerc/laconicd pods: