Run a Validator
Study operating a validator node.
Prerequisite Readings
You should follow these procedures first if you intend to use a Key Management System (KMS), check out this guide on using a KMS.
⚠️WARNING Ensure that UTC is set as the server timezone. A LastResultsHash
mismatch problem could be brought on by a different timezone configuration. Your node will go offline because of this!
Create Your Validator
You can activate a new validator by staking HEART tokens using your node consensus public key (humanvalconspub...
).
To find out your validator pubkey, write the following command:
humansd tendermint show-validator
🚨 DANGER: Never use a test
keying backend to generate your mainnet validator keys. By making your funds remotely accessible via the eth_sendTransaction
JSON-RPC interface, this can lead to a loss of funds.
Reference: Security Advisory: Insecurely configured geth can make funds remotely accessible
Use this command to build your validator on the testnet:
humansd tx staking create-validator \
--amount=1000000000000000000aheart \
--pubkey=$(humansd tendermint show-validator) \
--moniker="choose a moniker" \
--chain-id=<chain_id> \
--commission-rate="0.05" \
--commission-max-rate="0.10" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas="auto" \
--gas-prices="1800000000aheart" \
--from=<key_name>
The min_commission_rate
global parameter is set to 0.05 (5%), meaning that the minimum comission any validator on the Humans.ai network can have is 5%.
Validators need to set --commission-rate
≥0.05, otherwise they will not be able to create their validator.
The commission-max-change-rate
, which measures % point change over the commission-rate
, is utilized when setting commission parameters. For instance, a 100% rate rise from 1% to 2% is only 1 percentage point.
Min-self-delegation
is a strictly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A min-self-delegation
of 1000000000000000000
means your validator will never have a self-delegation lower than 1 heart
Using a third-party explorer, you can verify that you are in the validator set.
Edit Validator Description
The public description of your validator is editable. Your validator will be identified by this information, and delegators will use it to determine which validators to stake to. Make careful to include information for each flag listed below. If a flag is not specified in the command, the field defaults to being empty (the default value for --moniker
is the machine name) if it has never been set, or it stays the same if it has.
The validator you are updating is indicated by the <key_name>. Remember that the --from flag is required to specify the validator to update if you decide to omit some flags.
With systems like Keybase or UPort, the --identity
option can be used to validate identity. When using Keybase, the 16-digit string generated with a keybase.io account should be entered into the --identity
field. It is a means of authenticating your identity across many web networks that is cryptographically secure. We can get your Keybase avatar via the Keybase API.
humansd tx staking edit-validator
--moniker="Choose a moniker" \
--website="https://humans.ai" \
--identity=7B1E65E19B5DCD9F \
--details="Bringing AI to the Interchain!" \
--chain-id=<chain_id> \
--gas="auto" \
--gas-prices="1800000000aheart" \
--from=<key_name> \
--commission-rate="0.05"
The commission-rate
value must abide by the following rules:
- Must be between 0.05 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 is only permitted to modify its commission once per day and only to the extent permitted by thecommission-max-change-rate
limits.
View Validator Description
Use this command to view the validator's information:
humansd query staking validator <account_cosmos>
Track Validator Signing Information
The signing-info
command allows you to keep track of a validator's previous signatures:
humansd query slashing signing-info <validator-pubkey>\
--chain-id=<chain_id>
Unjail Validator
In order to get block proposer rewards once more once a validator has been jailed
for downtime, you must submit a Unjail
transaction from the operator account (depending on the zone fee distribution).
humansd tx slashing unjail \
--from=<key_name> \
--chain-id=<chain_id>
Confirm Your Validator is Running
If the command below returns something, your validator is in use:
humansd query tendermint-validator-set | grep "$(humansd tendermint show-address)"
Your validator should now appear in one of Humans.ai's explorers. You need to find the address
in the /.humansd/config/priv_validator.json
file that has been bech32
encoded.
To be in the active validator set, you need to have more total voting power than the 50th validator.
Halting Your Validator
It can be helpful to have your validator systematically and gracefully stop when attempting to perform basic maintenance or while making plans for a forthcoming coordinated upgrade.
You may accomplish this by either supplying the --halt-height
flag to humansd
or specifying the halt-height
variable to the height at which you want your node to stop down.
After committing the block, the node will shut down with a zero exit code at that specified height.
Common Problems
Problem #1: My validator has voting_power: 0
Your validator was recently jailed. If validators do not vote on '4750' of the most recent '5000' blocks, or if they double sign, they are jailed, or removed from the active validator list.
You can restore your voting rights to your validator if you were imprisoned for inactivity. First, restart humansd
if it is not already running:
humansd start
Wait until your full node catches up to the most recent block. You can then unjail your validator.
Finally, double-check your validator to verify whether your voting capability has returned.
humansd status
You might have noticed that your voting influence has decreased. You received a budget cut for downtime, that's why! Currently, there is no penalty for downtime on mainnet, but in the futures it will be enabled by a governance proposal.
Problem #2: My node crashes because of too many open files
Linux may open up to 1024
files at once (per process). It is known that humansd
can open more than 1024
files. The result is a process crash. Run ulimit -n 4096
to raise the number of open files permitted as a temporary workaround, and then resume the process with humansd start
. It could be necessary to configure something at that level if you launch humansd
using systemd
or another process manager. Below is a sample systemd
file to address this problem:
# /etc/systemd/system/humansd.service
[Unit]
Description=Humans Node
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/go/bin/humansd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target