Divide generate genesis and create validator playbooks into build and start playbooks (#13)
Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e Co-authored-by: Shreerang Kale <shreerangkale@gmail.com> Reviewed-on: #13 Co-authored-by: shreerang <shreerang@noreply.git.vdb.to> Co-committed-by: shreerang <shreerang@noreply.git.vdb.to>
This commit was merged in pull request #13.
This commit is contained in:
+51
-34
@@ -2,14 +2,42 @@
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [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 `zstd` using `sudo apt install zstd`
|
||||
- Machine 1: Where the SAPO testnet node is already running
|
||||
|
||||
- Install `zstd` using `sudo apt install zstd`
|
||||
|
||||
- Machine 2: Where the mainnet first validator node is to be setup
|
||||
|
||||
- Machine 3: Where the genesis file is to be generated
|
||||
|
||||
- Install `zstd` using `sudo apt install zstd`
|
||||
|
||||
- LPS distribution Google spreadsheet URL or CSV file path
|
||||
|
||||
- Following tools are required in all machines:
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
- [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
|
||||
```
|
||||
|
||||
## Build laconicd to generate genesis file
|
||||
|
||||
- Run the following steps in a secure machine (machine 3) separate from the one where the node is to be setup (machine 2)
|
||||
|
||||
- Run playbook to build laconicd container:
|
||||
|
||||
```bash
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/build-laconicd.yml
|
||||
```
|
||||
|
||||
## Setup node
|
||||
|
||||
- Run the following steps in the machine where the mainnet node is to be setup
|
||||
- Run the following steps in the machine where the mainnet node is to be setup (machine 2)
|
||||
|
||||
- Copy the example variables file if not already done:
|
||||
|
||||
@@ -51,11 +79,11 @@
|
||||
cerc/laconicd:local bash -c "laconicd tendermint show-validator"
|
||||
```
|
||||
|
||||
NOTE: This public key is required in next step to generate the genesis file
|
||||
NOTE: This public key is required in [next step to generate the genesis file](#generate-mainnet-genesis-file)
|
||||
|
||||
## Export testnet state
|
||||
|
||||
- Run the following steps in machine where the testnet node is running
|
||||
- Run the following steps in machine where the testnet node is already running (machine 1)
|
||||
|
||||
- Get your private key from testnet deployment:
|
||||
|
||||
@@ -71,12 +99,6 @@
|
||||
laconic-so deployment --dir <testnet-deployment-dir> stop
|
||||
```
|
||||
|
||||
- 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
|
||||
@@ -87,13 +109,7 @@
|
||||
|
||||
## Generate mainnet genesis file
|
||||
|
||||
- Run the following steps in secure machine separate from the one where the node is setup
|
||||
|
||||
- Fetch the stack:
|
||||
|
||||
```bash
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||
```
|
||||
- Run the following steps in machine where [the genesis file is to be generated (machine 3)](#build-laconicd-to-generate-genesis-file)
|
||||
|
||||
- Copy over compressed `testnet-state.zst` file to target machine
|
||||
|
||||
@@ -110,9 +126,6 @@
|
||||
|
||||
# Parent directory where the deployment directory will live
|
||||
export DATA_DIRECTORY=
|
||||
|
||||
# Set mainnet deployment directory
|
||||
export MAINNET_DEPLOYMENT_DIR=mainnet-laconicd-deployment
|
||||
```
|
||||
|
||||
- Extract the testnet-state JSON file:
|
||||
@@ -140,8 +153,10 @@
|
||||
|
||||
- Edit `~/cerc/laconicd-stack/playbooks/first-validator/first-validator-vars.yml` with required values:
|
||||
|
||||
NOTE: Use the public key exported in [previous step](#setup-node)
|
||||
|
||||
```bash
|
||||
# Use the public key exported in previous step (make sure to wrap it with single quotes [''])
|
||||
# Make sure to wrap it with single quotes ('')
|
||||
validator_pub_key: '<public-key-of-your-node>'
|
||||
```
|
||||
|
||||
@@ -162,7 +177,7 @@
|
||||
|
||||
## Run node
|
||||
|
||||
- Run the following steps in the machine where the mainnet node is setup
|
||||
- Run the following steps in the machine where the mainnet node is setup (machine 2)
|
||||
|
||||
### Setup TMKMS (Optional but Recommended)
|
||||
|
||||
@@ -318,19 +333,21 @@
|
||||
|
||||
## Publish required artifacts
|
||||
|
||||
- Copy the genesis file to [config](./config) folder:
|
||||
- Run the following steps in machine where the genesis file and staking amount files are generated (machine 3)
|
||||
|
||||
```bash
|
||||
cp $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/genesis.json ~/cerc/laconicd-stack/config/mainnet-genesis.json
|
||||
```
|
||||
- Copy the genesis file to [config](./config) folder:
|
||||
|
||||
- Copy the staking amount file to [config](./config) folder:
|
||||
```bash
|
||||
cp $DATA_DIRECTORY/output/genesis.json ~/cerc/laconicd-stack/config/mainnet-genesis.json
|
||||
```
|
||||
|
||||
```bash
|
||||
cp $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/tmp/staking-amount.json ~/cerc/laconicd-stack/config/staking-amount.json
|
||||
```
|
||||
- Copy the staking amount file to [config](./config) folder:
|
||||
|
||||
- Get your node's address:
|
||||
```bash
|
||||
cp $DATA_DIRECTORY/output/staking-amount.json ~/cerc/laconicd-stack/config/staking-amount.json
|
||||
```
|
||||
|
||||
- Get your node's address by running following command in the machine where the mainnet node is running (machine 2):
|
||||
|
||||
```bash
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'echo $(laconicd cometbft show-node-id)@YOUR_PUBLIC_IP_ADDRESS:26656'
|
||||
|
||||
+39
-18
@@ -2,12 +2,31 @@
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install)
|
||||
- Machine 1: Where the SAPO testnet node is already running
|
||||
|
||||
## Setup Node
|
||||
- Machine 2: Where the mainnet validator node is to be setup
|
||||
|
||||
- Run the following steps in the machine where the validator node is to be setup
|
||||
- laconicd-stack
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
|
||||
- Machine 3: Where the create-validator transaction is to be signed
|
||||
|
||||
- laconicd-stack
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
|
||||
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) is required in all machines
|
||||
|
||||
- To fetch laconicd-stack:
|
||||
|
||||
```bash
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||
```
|
||||
|
||||
## Stop SAPO testnet node
|
||||
|
||||
- Run the following steps in machine where the testnet node is already running (machine 1)
|
||||
|
||||
- Get your private key from testnet deployment:
|
||||
|
||||
@@ -15,7 +34,7 @@
|
||||
laconic-so deployment --dir <testnet-deployment-dir> exec laconicd "laconicd keys export <key-name> --unarmored-hex --unsafe"
|
||||
```
|
||||
|
||||
NOTE: Store this key securely as it is needed in later steps
|
||||
NOTE: Store this key securely as it is needed in [later steps](#create-validator)
|
||||
|
||||
- Stop the node for SAPO testnet:
|
||||
|
||||
@@ -23,13 +42,19 @@
|
||||
laconic-so deployment --dir <testnet-deployment-dir> stop
|
||||
```
|
||||
|
||||
- Fetch the stack:
|
||||
## Build laconicd to create validator
|
||||
|
||||
- Run the following steps in a secure machine (machine 3) separate from the one where the node is to be setup (machine 2)
|
||||
|
||||
- Run playbook to build laconicd container:
|
||||
|
||||
```bash
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/build-laconicd.yml
|
||||
```
|
||||
|
||||
This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator.
|
||||
## Setup Node
|
||||
|
||||
- Run the following steps in the machine where the validator node is to be setup (machine 2)
|
||||
|
||||
- Copy the example variables file:
|
||||
|
||||
@@ -161,13 +186,7 @@
|
||||
|
||||
## Create Validator
|
||||
|
||||
- Run these steps in a secure machine separate from the one where the node is setup
|
||||
|
||||
- Fetch the stack:
|
||||
|
||||
```bash
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||
```
|
||||
- Run these steps in a machine from where [the create-validator transaction is to be signed (machine 3)](#build-laconicd-to-create-validator)
|
||||
|
||||
This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator.
|
||||
|
||||
@@ -179,11 +198,13 @@
|
||||
|
||||
- Update `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml` with required values:
|
||||
|
||||
NOTE: Use the public key exported in [previous step](#start-node)
|
||||
|
||||
```bash
|
||||
# Same moniker as set above
|
||||
cerc_moniker: "<your-moniker>"
|
||||
|
||||
# Use the public key exported in previous step (make sure to wrap it with single quotes [''])
|
||||
# Make sure to wrap it with single quotes ('')
|
||||
validator_pub_key: '<public-key-of-your-node>'
|
||||
|
||||
# Set the public IP address of the machine where your node is running
|
||||
@@ -203,9 +224,9 @@
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/create-validator.yml
|
||||
```
|
||||
|
||||
- Input private key of the existing account that was exported in previous steps when prompted
|
||||
- Input private key of the existing account that was exported in [previous steps](#stop-sapo-testnet-node) when prompted
|
||||
|
||||
- Run the following commands in the machine where the validator node is setup
|
||||
- Run the following commands in the machine where the validator node is running (machine 2)
|
||||
|
||||
- Check the validator list:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user