Add demo steps to run validator nodes setup locally

This commit is contained in:
Shreerang Kale 2025-05-15 15:43:58 +05:30
parent f4ab2bf232
commit bb15d72044

79
demo.md Normal file
View File

@ -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: "<node-id>@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
```