Run a validator
âšī¸ Synopsis
- You have reached here because you have performed a [Setup and run a testnet node] and is ready to prepare a validator node locally.
Running a Validatorâ
đĄ Pre-conditions
- [Setup and run mainnet] is configured using keyring and a local node is avaiable.
- If you are using key management system, then read [Setup kmd].
- The production mainnet is fully synchronized.
What is a Validator?â
A validator function is to secure the Proof of Stake network. As an example, in a DDOS attack, the validator can isolate the network. It is also a working participant of the Tendermint consensus protocol in block provisioning. A validator can run as a single full node or a signer node. A more detailed description is given earlier here.
A variant of a validator is a delegator node running the Proof of Stake network.
Create Your Validatorâ
- Find your validator node
gotabitd tendermint show-validator
Output
gotabitd tendermint show-validator
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"JDbqGajR5gcABVejT1SZYzoDxwR24tYh0/wfSiouy+8="}
Create your validator using the command below
gotabitd tx staking create-validator \
--amount=1000000ugtb \
--pubkey=$(gotabitd tendermint show-validator) \
--moniker=<moniker> \
--chain-id=<chain-id> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas="auto" \
--gas-prices="0.0025ugtb" \
--from=<key_name> \
--keyring-backend=test
where eg. moniker="gtbmdb"
chain-id="mainnet"
key_name=mygenesis1
Edit Validator Descriptionâ
The following flags will identify your validator
Flags:
# Moniker will default to machine name if empty and is relied upon by delegator
eg. --moniker="gotamdb"
# To identify which validator to update
eg. --from=mygenesis1
â ī¸ Caution Some flags cannot be changed onece and a validator node is running. These are:
- commission-max-rate and
- commission-max-change-rate
View Validator Descriptionâ
Use the command below:
gotabitd query staking validator <account_gotabit> where eg.account_gotabit=$MY_VALIDATOR_ADDRESS
Track Validator Signing Informationâ
To track historical signing events, use the command below:
gotabitd query slashing signing-info <validator-pubkey>\
--chain-id my-test-chain --keyring-backend test
# where eg. chain_id="mainnet"
Unjail Validatorâ
A jail time is imposed when a validator is not working on blocks for some reason. Use the operator account in order to be able to get block proposer rewards again (depends on the zone fee distribution). Use the command below:
gotabitd tx slashing unjail \
--from=<key_name> \
--chain-id my-test-chain --keyring-backend test
# where eg. key_name=mygenesis1 and chain_id="mainnet".
Confirm Your Validator is Runningâ
Use the command check the status of the running validator.
gotabitd query tendermint-validator-set | grep "$(gotabitd tendermint show-address)"
Halting Your Validatorâ
Stopping the validator gracefully can be achieve by:
- Set the halt-height to the height at which you want your node to shutdown; or,
- By passing the --halt-height flag to gotabitd.
The node will shutdown with a zero exit code at that given height after committing the block.
Restore a Validatorâ
A validator can be completely restored on a new GotaBit node with the following set of keys:
The Consensus key, stored in
~/.gotabit/config/priv_validator.json
The mnemonic to the validator wallet
đ NOTE: Before proceeding, ensure that the existing validator is not active. Double voting has severe slashing consequences.
To restore a validator:
- 1: Setup a full GotaBit node synced up to the latest block.
- 2: Replace the ~/.gotabit/config/priv_validator.json file of the new node with the associated file from the old node, then restart your node.