Setup
Become a dHealth validator
Validators are responsible for committing new blocks to the blockchain through voting. A validator's stake is slashed if they become unavailable or sign blocks at the same height. Please read about Sentry Node Architecture to protect your node from DDOS attacks and to ensure high-availability.
1. Run a fullnode
To become a validator, you must first have dhealth(testnet)d installed and be able to run a fullnode. You can first setup your fullnode if you haven't yet.
The rest of the documentation will assume you have followed our instructions and have successfully set up a fullnode.
Not enough funds? Googe Cloud can help you
Running a validator node should be done on a separate machine, not your local computer. This is due to the fact that validators need to be constantly running to avoid getting slashed (and thus loosing funds). We highly recommend setting up a local machine that can run 24/7, even a Raspberry can do the job.
If you do not have the possibility of using a local machine, even an hosted server can be perfect. If you wish to get started for free, you can use the 300$ Google Cloud bonus. This should be enough to run a validator for 5-6 months.
2. Create your validator
In order to create a validator, you need to have to create a local wallet first. This will be used in order to hold the tokens that you will later delegate to your validator node, allowing him to properly work. In order to create this wallet, please run:
dhealthd keys add <key_name> --coin-type 10111
dhealth-testnetd keys add <key_name> --coin-type 10111
or use the --recover flag if you already have a secret recovery phrase (mnemonic phase) you'd want to use:
dhealthd keys add <key_name> --coin-type 10111 --recover
dhealth-testnetd keys add <key_name> --coin-type 10111 --recover
Key name
Please select a key name that you will easily remember and be able to type fast. This name will be used all over the places inside other commands later.
Once that you have created your local wallet, it's time to get some tokens to be used as the initial validator stake so that it can run properly. If you are setting up a validator on our testnet, you can request some testnet tokens from our testnet faucet.
You can get your address by running:
dhealthd keys show <key_name> -a
dhealth-testnetd keys show <key_name> -a
To run a validator node you need to first get your current validator public key that was created when you ran desmod init. Your desmosvalconspub (Desmos Validator Consensus Pubkey) can be used to create a new validator by staking tokens. You can find your validator pubkey by running:
dhealthd tendermint show-validator
dhealth-testnetd tendermint show-validator
You can also check your account balance with:
dhealthd q bank balances <youraccountaddress>
dhealth-testnetd q bank balances <youraccountaddress>
To create your validator, just use the following command:
Transaction fee
Don't delegate all your DHP. Leave some to pay for transaction fee.
dhealthd tx staking create-validator \
--amount=100000000000udhp \
--pubkey=$(dhealthd tendermint show-validator) \
--moniker="<validator_name>" \
--chain-id=dhealth \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation=1 \
--from=<key_name> \
--gas=auto \
--gas-adjustment=1.5 \
--gas-prices="0.025udhp"
dhealth-testnetd tx staking create-validator \
--amount=100000000000utdhp \
--pubkey=$(dhealth-testnetd tendermint show-validator) \
--moniker="<validator_name>" \
--chain-id=dhealth-testnet-2 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation=1 \
--from=<key_name> \
--gas=auto \
--gas-adjustment=1.5 \
--gas-prices="0.025utdhp"
TIP
When specifying the value of the
moniker
flag, please keep in mind this is going to be the public name associated to your validator. For this reason, it should represent your company name or something else that can easily identify you among all the other validators.
TIP
When specifying commission parameters, the
commission-max-change-rate
is used to measure % point change over thecommission-rate
. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point.
TIP
Min-self-delegation
is a strictly positive integer that represents the minimum amount of self-delegated staking token your validator must always have. Amin-self-delegation
of 1 means your validator will never have a self-delegation lower than1utdhp
(or1udhp
in mainnet). A validator with a self delegation lower than this number will automatically be unbonded.
You can confirm that you are in the validator set by using a block explorer:
- Testnet: Big Dipper
- Mainnet: Big Dipper, NodeStake, EZStaking, Ping.pub
3. Edit the 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 some block explorers to retrieve your Keybase avatar. This is how you can add a logo to your validator profile.
dhealthd tx staking edit-validator \
--moniker="choose a moniker" \
--website="https://dhealth.com" \
--identity=6A0D65E29A4CBC8E \
--details="To infinity and beyond!" \
--commission-rate="0.10" \
--chain-id=dhealth \
--from=<key_name>
dhealth-testnetd tx staking edit-validator \
--moniker="choose a moniker" \
--website="https://dhealth.com" \
--identity=6A0D65E29A4CBC8E \
--details="To infinity and beyond!" \
--commission-rate="0.10" \
--chain-id=dhealth-testnet-2 \
--from=<key_name>
Note: The commission-rate value must adhere to the following invariants:
- Must be between 0 and the validator's
commission-max-rate
. - Must not exceed the validator's
commission-max-change-rate
which is maximum % point change rate per day. In other words, a validator can only change its commission once per day and withincommission-max-change-rate
bounds.
View the validator description
View the validator's information with this command:
dhealthd query staking validator <operator_address>
dhealth-testnetd query staking validator <operator_address>
Confirm your validator is running
Your validator is active if the following command returns anything:
dhealthd query tendermint-validator-set | grep $(dhealthd status 2>&1 | jq '.ValidatorInfo.PubKey.value')
dhealth-testnetd query tendermint-validator-set | grep $(dhealth-testnetd status 2>&1 | jq '.ValidatorInfo.PubKey.value')
When you query the node status with dhealthd status
, it includes the validator pubkey in base64 encoding. If your node is an active validator, the validator pubkey will be shown when you query the validator set.
You should now see your validator in one of the Desmos explorers. You are looking for the bech32
encoded operator address starts with dhvaloper
. It is another representation of your <key_name>
that you have used to create this validator.
To show the operator address, you can run
dhealthd keys show <key_name> -a --bech val
dhealth-testnetd keys show <key_name> -a --bech val
Updated 8 months ago