Add playbook to send create-validator tx for subsequent nodes (#3)

Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e of cerc-io/laconicd#66
- Use calculated staking amount for running validator nodes

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: #3
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 #3.
This commit is contained in:
2025-05-16 09:54:09 +00:00
committed by nabarun
co-authored by Shreerang Kale nabarun prathamesh
parent 3b526fac78
commit 3d7ba45796
19 changed files with 279 additions and 95 deletions
+110
View File
@@ -0,0 +1,110 @@
# Run Validator Node
## Prerequisites
- [ansible](playbooks/README.md#ansible-installation)
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install)
## Run node
- Get your private key from testnet deployment:
```bash
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
- Stop the node for SAPO testnet:
```bash
laconic-so deployment --dir <testnet-deployment-dir> stop
```
- Fetch the stack:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
```
This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator.
- Copy the example variables file:
```bash
cp ~/cerc/laconicd-stack/playbooks/validator/validator-vars.example.yml ~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml
```
- Update `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml` with required values:
```bash
# Set custom moniker for the node
cerc_moniker: "<your-moniker>"
# Set persistent peers (comma-separated list of node IDs and addresses)
# You can find the list of available peers in https://git.vdb.to/cerc-io/laconicd-stack/src/branch/main/node-addresses.yml
cerc_peers: "<node-id>@<node-host>:26656,<node-id>@<node-host>:26656"
```
- Export the data directory and mainnet deployment directory as environment variables:
```bash
# Parent directory where the deployment directory will live
export DATA_DIRECTORY=
# Set mainnet deployment directory
# for eg: mainnet-laconicd-deployment
export MAINNET_DEPLOYMENT_DIR=
```
- Run ansible playbook to set up and start your validator node:
```bash
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/run-validator.yml
```
- Check logs to ensure that node is running:
```bash
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
```
## Create Validator
- Export required env vars:
```bash
# Use the private key of the existing account that was exported in previous steps
export PVT_KEY=<private-key-in-hex-format>
# desired key name
export KEY_NAME=<key-name>
export DATA_DIRECTORY=<data-directory>
export MAINNET_DEPLOYMENT_DIR=<mainnet-deployment-dir>
```
- Run ansible playbook to create validator on running chain:
<!-- TODO: Use OS keyring -->
```bash
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/create-validator.yml
```
- Check the validator list:
```bash
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query staking validators'
```
## Register Your Node
- Get your node's address:
```bash
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'echo $(laconicd cometbft show-node-id)@YOUR_PUBLIC_IP_ADDRESS:26656'
```
- Add your node's address to the `~/cerc/laconicd-stack/node-addresses.yml` file
- Submit a PR to add your node address to the repository