Validator (~30 min)

1

Introduction

This guide will help you stake and run a Validator node on Pocket Network.

As a Validator, you'll be participating in the consensus of the network, validating transactions, and securing the blockchain.

2

Prerequisites & Requirements

Ensure your node is running and fully synchronized with the network. You can check the synchronization status by running:

pocketd status

If 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 name
3

Account Setup

To become a Validator, you need a Validator account with sufficient funds to stake.

1

Create the Validator Account

Create a new key pair for your Validator account:

pocketd keys add validator

This will generate a new address and mnemonic.

2

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" >> ~/.profile
3

Fund 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_FLAGS

Afterwards, query the balance:

pocketd query bank balances $ADDR $QUERY_FLAGS

Tip: 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 6900000000042upokt
4

Back up Keys 🔑

  • Back up your validator address 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/.

4

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-validator

This command outputs your node's public key in JSON format, for example:

{ "@type": "/cosmos.crypto.ed25519.PubKey", "key": "YourPublicKeyHere" }
5

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 (validator is 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"
}
🚀
6

Create the Validator

Run the following command to create the validator:

pocketd tx staking create-validator ./validator.json $TX_PARAM_FLAGS

Example with an explicit path:

pocketd tx staking create-validator ~/validator.json $TX_PARAM_FLAGS

Some 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., beta for testnet, main for 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.

7

Verify the Validator Status

To verify that your Validator has been successfully created, run:

pocketd query staking validator $VALIDATOR_ADDR $QUERY_FLAGS

This 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?