Validating on Testnet
Synced Node
Before creating a testnet validator, ensure you have first followed the instructions on how to join the testnet
Initialize Wallet Keyring
If you decide you want to turn your node into a validator, you will first need to add a wallet to your keyring.
While you can add an existing wallet through your seed phrase, we will create a new wallet in this example (replace KEY_NAME with a name of your choosing):
osmosisd keys add KEY_NAME
Ensure you write down the mnemonic as you can not recover the wallet without it. To ensure your wallet was saved to your keyring, check that KEY_NAME is in your keys list:
osmosisd keys list
Validator Public Key
The last thing needed before initializing the validator is to obtain your validator public key which was created when you first initialized your node. To obtain your validator pubkey:
osmosisd tendermint show-validator
Create Validator Command
Ensure you have a small amount of OSMO on the wallet address you are using on your keyring in order to successfully send a transaction. Once you have have a balance on the address on your keyring, you can now send the create-validator transaction.
Get OSMO via the Faucet
If you need testnet testnet OSMO you have two options.
- Use the faucet at https://faucet.osmosis.zone
- Join the osmosis discord, get the testnet role here, and then utilize the faucet bot in the faucet channel.
The validator details are supplied in a JSON file, not as command flags. Create validator.json:
{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw="},
"amount": "400000000uosmo",
"moniker": "Wosmongton",
"identity": "",
"website": "",
"details": "",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.05",
"min-self-delegation": "400000000"
}
The pubkey value is the whole JSON object printed by osmosisd tendermint show-validator, not the bech32 osmovalconspub... string. Paste it in verbatim.
Then submit it, passing the file path as the only argument:
osmosisd tx staking create-validator validator.json \
--from=[KEY_NAME] \
--chain-id="osmo-test-5" \
--gas="auto" \
--gas-adjustment=1.3 \
--gas-prices="0.03uosmo"
What the JSON fields mean:
pubkeyis the validator consensus public key fromosmosisd tendermint show-validator.amountis your self-delegation, in uosmo (in the example,400000000uosmois 400 OSMO).monikeris a human readable name you choose for your validator.securityis a contact your delegators can reach you at.identity,website, anddetailsare optional and may be left as empty strings.commission-rateis the rate you charge your delegators (10 percent in the example).commission-max-rateis the most you are ever allowed to charge (20 percent in the example).commission-max-change-rateis how much you can raise the rate in a 24 hour period (5 percent per day in the example, until reaching the max).min-self-delegationis the lowest amount of your own funds the validator must keep self-delegated to stay bonded (400 OSMO in the example).
And the flags:
--fromis the KEY_NAME you created when initializing the key on your keyring.--chain-idis the network you are joining (osmo-test-5for this testnet).--gas-pricesis the price per unit of gas in uosmo.
Troubleshooting
If you inspect your create-validator transaction in the explorer, and see the following error:
out of gas in location: WritePerByte; gasWanted: 177140, gasUsed: 177979: out of gas
The simulated gas limit was too low. Increase --gas-adjustment, or replace --gas="auto" with a fixed limit above the reported gasUsed value. For the example above:
--gas=220000
--gas-prices controls the transaction fee, not the gas limit. Osmosis sets a dynamic minimum gas price via its fee market, so query the current base fee (osmosisd query txfees base-fee) and pass a value at or above it.
Track Validator Active Set
To see the current validator active set:
osmosisd query staking validators --limit 300 -o json | jq -r '.validators[] |
[.operator_address, .status, (.tokens|tonumber / pow(10; 6)),
.commission.update_time[0:19], .description.moniker] | @csv' | column -t -s","
You can search for your specific moniker by adding grep MONIKER at the end:
osmosisd query staking validators --limit 300 -o json | jq -r '.validators[] |
[.operator_address, .status, (.tokens|tonumber / pow(10; 6)),
.commission.update_time[0:19], .description.moniker] | @csv' | column -t -s"," | grep Wosmongton
If your bond status is BOND_STATUS_BONDED, congratulations, your validator is part of the active validator set!
Track Validator Signing
To track your validator's signing history, copy the validator public key:
osmosisd tendermint show-validator
Use your validators public key queried above:
osmosisd query slashing signing-info [validator-pubkey]
Example:
osmosisd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"HlixoxNZBPq4pBOYEimtSq9Ak4peBISVsIbI5ZHrEAU="}'