Validator (~30 min)
Prerequisites & Requirements
CLI: Make sure to install the
pocketdCLI.Synched Full Node: Ensure you have followed the Full Node Walkthrough to install and run a Full Node. Your node must be fully synced with the network before proceeding.
Ensure your node is running and fully synchronized with the network. You can check the synchronization status by running:
pocketd statusIf you followed the Full Node Walkthrough, you can switch to the user running the full node (which has pocketd installed) like so:
su - pocket # or a different user if you used a different nameAccount Setup
To become a Validator, you need a Validator account with sufficient funds to stake.
Prepare your environment
For convenience, set several environment variables to streamline interacting with the Shannon network.
We recommend you put these in your ~/.bashrc file:
export QUERY_FLAGS="--network=<NETWORK>" # e.g. local, alpha, beta, main
export TX_PARAM_FLAGS="--from validator --fees 200000upokt --network=<NETWORK>"
export ADDR=$(pocketd keys show validator -a)
export VALIDATOR_ADDR=$(pocketd keys show validator -a --bech val)Tip: Consider creating ~/.pocketrc and appending source ~/.pocketrc to your ~/.profile (or ~/.bashrc) to keep pocket-specific environment variables separate and organized:
touch ~/.pocketrc
echo "source ~/.pocketrc" >> ~/.profileFund the Validator Account
Run the following command to print the validator address:
echo "Validator address: $VALIDATOR_ADDR"If you are using Beta Testnet, use the Shannon Beta TestNet faucet to fund the validator account.
If you are on Mainnet you'll need to transfer funds to the account:
pocketd tx bank send <SOURCE ADDRESS> $ADDR <AMOUNT_TO_STAKE>upokt $TX_PARAM_FLAGSAfterwards, query the balance:
pocketd query bank balances $ADDR $QUERY_FLAGSTip: If you know someone at Grove who maintains Beta TestNet, you can ask them to run this command:
pocketd tx --network=beta tx bank send faucet_beta $ADDR 6900000000042upoktBack up Keys 🔑
Before you proceed ensure you have securely backed up your keys!!! Losing validator keys will result in SLASHING!
Back up your
validatoraddress key.Back up your
priv_validator_key.json— used to sign blocks. Found in/pocketd/config/.Back up your
node_key.json— used for P2P. Found in/pocketd/config/.
Get the Validator's Public Key
Your node has a unique public key associated with it, which is required for creating the Validator.
To retrieve your node's public key, run:
pocketd comet show-validatorThis command outputs your node's public key in JSON format, for example:
{ "@type": "/cosmos.crypto.ed25519.PubKey", "key": "YourPublicKeyHere" }Create the Validator JSON File
Create a JSON file named validator.json with the content below and make these changes:
Replace the "pubkey" value with the output from
pocketd comet show-validator.Update the "amount" field with the amount you wish to stake (e.g., "1000000upokt").
Set the "moniker" to your validator's name (
validatoris the default).Optionally fill in "identity", "website", "security", and "details".
cat << 🚀 > validator.json
{
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="
},
"amount": "1000000upokt",
"moniker": "validator",
"identity": "",
"website": "",
"security": "",
"details": "",
"commission-rate": "0.100000000000000000",
"commission-max-rate": "0.200000000000000000",
"commission-max-change-rate": "0.010000000000000000",
"min-self-delegation": "1"
}
🚀Create the Validator
Run the following command to create the validator:
pocketd tx staking create-validator ./validator.json $TX_PARAM_FLAGSExample with an explicit path:
pocketd tx staking create-validator ~/validator.json $TX_PARAM_FLAGSSome configurable parameters:
~/validator.json: The path to your validator JSON file.--from=validator: Specifies the local key to sign the transaction.--network=<network>: Replace<network>with the name of the network you are joining (e.g.,betafor testnet,mainfor mainnet).--fees 20000upokt: Transaction fees currently configured on both beta and mainnet.
After running the command, you should see a transaction confirmation with an output hash.
Verify the Validator Status
To verify that your Validator has been successfully created, run:
pocketd query staking validator $VALIDATOR_ADDR $QUERY_FLAGSThis command displays information about your Validator, including status, tokens staked, commission rates, and more.
Ensure that the status field indicates that your Validator is active:
status: BOND_STATUS_BONDED
Was this helpful?
