From f194d93645a85a6104e9810e6a1efec2f3dc582c Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 12:37:50 +0530 Subject: [PATCH] Add instructions to run subsequent validator nodes --- .gitignore | 2 +- README.md | 1 + playbooks/validator/run-validator.yml | 2 +- .../validator/validator-vars.example.yml | 6 ++ playbooks/validator/validator-vars.yml | 6 -- run-first-validator.md | 2 +- run-validator.md | 80 +++++++++++++++++++ 7 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 playbooks/validator/validator-vars.example.yml delete mode 100644 playbooks/validator/validator-vars.yml create mode 100644 run-validator.md diff --git a/.gitignore b/.gitignore index 2948191..9098bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ *-spec.yml # Playbook vars -playbooks/first-validator/first-validator-vars.yml +*-vars.yml diff --git a/README.md b/README.md index c870d42..3973081 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # laconicd-stack - Follow [run-first-validator.md](run-first-validator.md) to run the first validator node +- Follow [run-validator.md](run-validator.md) to run subsequent validator nodes diff --git a/playbooks/validator/run-validator.yml b/playbooks/validator/run-validator.yml index 036591f..9a5bd2b 100644 --- a/playbooks/validator/run-validator.yml +++ b/playbooks/validator/run-validator.yml @@ -6,7 +6,7 @@ vars: data_directory: "{{ lookup('env', 'DATA_DIRECTORY') }}" mainnet_deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}" - spec_file: "{{data_directory}}/laconicd-spec.yml" + spec_file: "{{data_directory}}/laconicd-validator-spec.yml" spec_template: "./templates/specs/spec-template.yml.j2" tasks: - name: Fail if DATA_DIRECTORY or MAINNET_DEPLOYMENT_DIR env vars are not set diff --git a/playbooks/validator/validator-vars.example.yml b/playbooks/validator/validator-vars.example.yml new file mode 100644 index 0000000..4fa9440 --- /dev/null +++ b/playbooks/validator/validator-vars.example.yml @@ -0,0 +1,6 @@ +cerc_moniker: "LaconicMainnetNode" +cerc_chain_id: "laconic-mainnet" +min_gas_price: 0.001 +cerc_loglevel: "info" +genesis_file: "~/cerc/laconicd-stack/genesis/mainnet-genesis.json" +cerc_peers: "" diff --git a/playbooks/validator/validator-vars.yml b/playbooks/validator/validator-vars.yml deleted file mode 100644 index f3a1142..0000000 --- a/playbooks/validator/validator-vars.yml +++ /dev/null @@ -1,6 +0,0 @@ -cerc_moniker: "MainnetNode" -cerc_chain_id: "laconic-mainnet" -min_gas_price: 0.001 -cerc_loglevel: "info" -genesis_file: "" -cerc_peers: "" diff --git a/run-first-validator.md b/run-first-validator.md index dbc4a21..43a5411 100644 --- a/run-first-validator.md +++ b/run-first-validator.md @@ -89,7 +89,7 @@ - Run ansible playbook to submit the gentx and run the node: ```bash - ansible-playbook -i localhost, -c local playbooks/first-validator/run-first-validator.yml + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/run-first-validator.yml ``` - Check logs to ensure that node is running: diff --git a/run-validator.md b/run-validator.md new file mode 100644 index 0000000..ca63468 --- /dev/null +++ b/run-validator.md @@ -0,0 +1,80 @@ +# 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 + +- 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 + # Path to the genesis file published by the first validator + genesis_file: "~/cerc/laconicd-stack/genesis/mainnet-genesis.json" + + # Set custom moniker for the node + cerc_moniker: "LaconicMainnetNode" + + # Set chain ID (should match the one in the genesis file) + cerc_chain_id: "laconic-mainnet" + + # Set minimum gas price + min_gas_price: 0.001 + + # Set log level + cerc_loglevel: "info" + + # Set persistent peers (comma-separated list of node IDs and addresses) + # You can find the list of available peers in node-addresses.yml + cerc_peers: "@:26656,@: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 + ``` + +## 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