Run a Validator

Validators play a crucial role in the CosVM ecosystem by contributing to consensus and securing the network. Follow these steps to run and manage a validator node effectively:

Prerequisite Readings:

  • Validator Overview

  • Validator Security

TIP: If you plan to use a Key Management System (KMS), ensure to go through the steps in the Using a KMS guide before proceeding.

Important Note: Ensure your server timezone configuration is set to UTC. A mismatch in timezones may cause a LastResultsHash mismatch error, potentially taking down your node!

1. Creating Your Validator:

To create a validator, utilize your node's consensus public key (cvmvalconspub...) and stake CVMOS tokens using the following command:

To create your validator on mainnet, just use the following command:

cvmd tendermint show-validator

cvmd tx staking create-validator \
  --amount=1000000ucvm \
  --pubkey=$(cvmd tendermint show-validator) \
  --moniker="choose_a_moniker" \
  --chain-id= "cvm_323-1"\
  --commission-rate="0.05" \
  --commission-max-rate="0.10" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1000000" \
  --gas="auto" \
  --gas-prices="0.025ucvm" \
  --from=<key_name>

Editing Validator Description:

Modify your validator's public description to provide relevant information for potential delegators:

cvmd tx staking edit-validator \
  --moniker="choose_a_moniker" \
  --website="https://cosvm.network/" \
  --identity=6A0D65E29A4CBC8E \
  --details="To infinity and beyond!" \
  --chain-id="cvm_323-1" \
  --gas="auto" \
  --gas-prices="0.025ucvm" \
  --from=<key_name> \
  --commission-rate="0.10"
  1. Editing Validator Description:

You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below. If a flag is not included in the command the field will default to empty (--moniker defaults to the machine name) if the field has never been set or remain the same if it has been set in the past.

The <key_name> specifies which validator you are editing. If you choose to not include certain flags, remember that the --from flag must be included to identify the validator to update.

The --identity can be used as to verify identity with systems like Keybase or UPort. When using with Keybase --identity should be populated with a 16-digit string that is generated with a keybase.io account. It's a cryptographically secure method of verifying your identity across multiple online networks. The Keybase API allows us to retrieve your Keybase avatar. This is how you can add a logo to your validator profile.

Modify your validator's public description to provide relevant information for potential delegators:

cvmd tx staking edit-validator --moniker="choose a moniker"
--website="https://cosvm.network"
--identity=6A0D65E29A4CBC8E
--details="To infinity and beyond!"
--chain-id="cvm_323-1"
--gas="auto"
--gas-prices="0.025ucvm"
--from=<key_name>
--commission-rate="0.10"

Viewing Validator Information:

Check your validator's details using the following command:

cvmd query staking validator <account_cosmos>

Tracking Validator Signing Information:

Monitor your validator's signing history:

cvmd query slashing signing-info <validator-pubkey> \
  --chain-id="cvm_323-1"

Unjailing Your Validator:

If your validator is "jailed" due to downtime, execute an Unjail transaction to resume block proposer rewards:

cvmd tx slashing unjail
--from=<key_name>
--chain-id="cvm_323-1"

Confirm Validator Status:

Ensure your validator is active by running:

cvmd query tendermint-validator-set | grep "$(cvmd tendermint show-address)"

You should now see your validator in one of CosVM explorers. You are looking for the bech32 encoded address in the ~/.cvmd/config/priv_validator.json file

Common Problems Faced by CosVM Validators

Problem #1:

Validator's Voting Power is 0

If your validator's voting power drops to 0, it's likely that your validator has been "jailed." Validators can get jailed, or removed from the active validator set, for not voting on 500 of the last 10000 blocks or for double signing.

Solution:

If your validator got jailed due to downtime, restart cvmd if it's not running already:

cvmd start

Allow your full node to catch up with the latest block. Execute an unjail transaction for your validator:

cvmd tx slashing unjail \
  --from=<key_name> \
  --chain-id="cvm_323-1"

Check your validator's voting power status using:

cvmd status

Problem #2:

Node Crashes Due to Too Many Open Files If your node crashes because it surpasses the limit of open files (Linux default is 1024), it might be due to cvmd opening more files.

Solution:

Increase the number of allowed open files using:

ulimit -n 4096 

Restart the cvmd process:

cvmd start

For users employing systemd or another process manager, consider configuring it to handle this issue. Below is an example systemd service configuration:

# /etc/systemd/system/cvmd.service
[Unit]
Description=CosVM Node
After=network.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/go/bin/cvmd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

These solutions can help address common issues faced by CosVM validators, ensuring smoother operations and maintaining node stability.

Last updated