From bb15d72044171c864de3ab1adfaad93e1196d730 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 15 May 2025 15:43:58 +0530 Subject: [PATCH] Add demo steps to run validator nodes setup locally --- demo.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 demo.md diff --git a/demo.md b/demo.md new file mode 100644 index 0000000..f695489 --- /dev/null +++ b/demo.md @@ -0,0 +1,79 @@ +# demo + +## 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 + ``` + +- Check first validator node address using: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'echo $(laconicd cometbft show-node-id)@host.docker.internal:26656' + ``` + + NOTE: Make sure that DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR values are that of first validator deployment + +- Update `cerc_peers` in `~/cerc/laconicd-stack/playbooks/validator/validator-vars.yml`: + + ```bash + cerc_peers: "@host.docker.internal: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-validator-deployment + export MAINNET_DEPLOYMENT_DIR= + ``` + +- Update port mappings in `~/cerc/laconicd-stack/playbooks/validator/templates/specs/spec-template.yml.j2` with: + + ```bash + network: + ports: + laconicd: + - '3060:6060' + - '36657:26657' + - '36656:26656' + - '3473:9473' + - '3090:9090' + - '3317:1317' + ``` + +- Update permission for `genesis/mainnet-genesis.json`: + + ```bash + sudo chmod 777 ~/cerc/laconicd-stack/genesis/mainnet-genesis.json + ``` + +- 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 + ```