Register a validator#

This is a detailed step-by-step guide for setting up a Terra validator. Please be aware that while it is easy to set up a rudimentary validating node, running a production-quality validator node with a robust architecture and security features requires an extensive setup.

For more information on setting up a validator, see additional resources.

Prerequisites#

1. Retrieve your PubKey#

The Consensus PubKey of your node is required to create a new validator. Run:

--pubkey=$(terrad tendermint show-validator)

2. Create a new validator#

Get tokens

In order for Terrad to recognize a wallet address it must contain tokens. For the testnet, use the faucet to send Luna to your wallet. If you are on mainnet, send funds from an existing wallet. 1-3 luna are sufficient for most setup processes.

To create the validator and initialize it with a self-delegation, run the following command. key-name is the name of the Application Operator Key that is used to sign transactions.

terrad tx staking create-validator \
    --amount=5000000uluna \
    --pubkey=$(<your-consensus-PubKey>) \
    --moniker="<your-moniker>" \
    --chain-id=<chain_id> \
    --from=<key-name> \
    --commission-rate="0.10" \
    --commission-max-rate="0.20" \
    --commission-max-change-rate="0.01" \
    --min-self-delegation="1"

Warning

When you specify commission parameters, the commission-max-change-rate is measured as a percentage-point change of the commission-rate. For example, a change from 1% to 2% is a 100% rate increase, but the commission-max-change-rate is measured as 1%.

3. Confirm your validator is active#

If running the following command returns something, your validator is active:

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

You are looking for the bech32 encoded address in the ~/.terra/config/priv_validator.json file.

Note

Only the top 130 validators in voting power are included in the active validator set.

4. Secure your keys and have a backup plan#

In general a validator needs to do three things well

  • Sign and commit blocks (using the Tendermint Consensus key)

  • Provide Oracle FX rates via a feeder (using an Application Oracle Feeder key)

  • Conduct on-chain operations such as voting on Governance proposals (using an Application Operator Key)

Protecting and having a contingency backup plan for all your keys will help mitigate catastrophic hardware or software failures of the node. It is a good practice to test your backup plan on a testnet node in case of node failure.

Restore a validator#

A validator can be completely restored on a new Terra node with the following set of keys:

  • The Consensus key, stored in ~/.terra/config/priv_validator.json

  • The mnemonic to the validator wallet

  • The mnemonic to the oracle feeder wallet

Danger

Before proceeding, ensure that the existing validator is not active. Double voting has severe slashing consequences.

To restore a validator:

  1. Setup a full Terra node synced up to the latest block.

  2. Replace the ~/.terra/config/priv_validator.json file of the new node with the associated file from the old node, then restart your node.

  3. Set up the price and oracle feeders.