How to set up a validator node 🌐
Pre-requisites
First of all, you need to have:
- installed ↗️
fetchd
. - Configured and connected ↗️ your validator to the desired network.
Also, it would be beneficial if you also explore the CLI documentation ↗️ to understand how to correctly interact with the Fetch Ledger.
Creating a validator
If you wish to create a validator, you will need to send a transaction to the network to stake your FET tokens. This process registers you as a validator, and if you are one of the chosen validators, you will start to produce blocks. If you want to create a validator using fetchd
Command Line Interface (CLI) ↗️ you will need to send a create-validator
transaction to the network as shown below:
fetchd tx staking create-validator \
--amount=<the amount to bond> \
--pubkey=$(fetchd tendermint show-validator) \
--moniker="choose a moniker" \
--chain-id=<chain_id> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="<the min self delegation>" \
--gas auto --gas-adjustment 1.5 --gas-prices "<network gas prices>" \
--from=<key_name>
Dorado example
You should verify that you have some tokens available before trying to create a validator. The easiest way to do this is via the CLI ↗️. Below, you can find an example of a typical CLI command that registers the node as running the validator:
fetchd tx staking create-validator \
--amount=1000000000000000000atestfet \
--pubkey=$(fetchd tendermint show-validator) \
--moniker="my-test-validator" \
--chain-id=dorado-1 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000000000000000" \
--gas auto --gas-adjustment 1.5 --gas-prices 1000000000atestfet \
--from=test-key
Edit a validator configuration
It is possible that validators will need to adjust various settings about their nodes over the time.
This can be simple things, such as the associated website for a validator, or more consequential actions, like altering the commission rate. In either case, should a validator choose to make this update they would send an edit-validator
transaction to the network.
These transactions can be created in a similar way to the create-validator
transaction depicted above:
fetchd tx staking edit-validator
--moniker="choose a moniker" \
--website="https://fetch.ai" \
--details="To infinity and beyond!" \
--chain-id=<chain_id> \
--commission-rate="0.10" \
--from=<key_name>
Unbonding a validator
Whenever and if a validator wants to stop being a validator for any reason, they can unbond some or all of their staked tokens. Unbonding refers to the process of withdrawing or removing a certain amount of staked tokens from a validator or a network after a defined waiting period.
This operation is carried out with the following CLI command:
fetchd tx staking unbond \
<validator operator address> \
<amount to remove> \
--from <key name>
An instance of this command is given in the example below:
fetchd tx staking unbond \
fetchvaloper1jqqwdch3jmzlmj4tjfn67s3sqm9elkd3wrpspf \
1000000000000000000000atestfet \
--gas auto --gas-adjustment 1.5 --gas-prices 1000000000atestfet \
--from test-key