laconicd-stack/docs/run-validator.md
2025-05-16 13:58:54 +05:30

3.0 KiB

Run Validator Node

Prerequisites

Run node

  • Get your private key from testnet deployment:

    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:

    laconic-so deployment --dir <testnet-deployment-dir> stop
    
  • Fetch the stack:

    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:

    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:

    # 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:

    # 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:

    ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/run-validator.yml
    
  • Check logs to ensure that node is running:

    laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
    

Create Validator

  • Export required env vars:

    # private key of the existing account
    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:

    ansible-playbook -i localhost, -c local playbooks/validator/create-validator.yml
    
  • Check the validator list:

    laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query staking validators'
    

Register Your Node

  • Get your node's address:

    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