Skip to main content

Running a Validator Node

This guide shows how to setup a validator node in simple steps.

Hardware requirements

  • Linux distribution
  • x86_64 processor
  • 16 GB RAM
  • 500 GB to 2 TB storage*
  • Storage size for validators depends on level of pruning.

Running your validator

The first step is to run a node. See the Node Installation and Joining a Network docs for instructions on how to get your node up and running.

After your node is running and synced, you can create a validator by staking tokens:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
tx staking create-validator \
--from ${MY_VALIDATOR_ACCOUNT} \
--amount 1000000000udenom \
--min-self-delegation 1000000000udenom \
--commission-rate 0.01 \
--commission-max-rate 0.1 \
--commission-max-change-rate 0.1 \
--pubkey "$(archwayd tendermint show-validator)" \
--chain-id ${CHAIN_ID}

Run validator pre-genesis

Initialize node

To initialize the genesis json file that is required to establish a network:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
init my-validator --chain-id ${CHAIN_ID}
info

See this example genesis file for the Constantine testnet.

Initialize account

Create a key to hold your account:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
keys add my-validator-account

After you run this command, you are prompted with a password dialogue. Enter a new password for your account.

Now, set the number of coins to stake:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
add-genesis-account "${VALIDATOR_ADDRESS}" 1000000000stake,1000000000ARCH
info

Note: Your account must have an equal amount of coins that match the bond denomination ("bond_denom") in your genesis file.

// genesis.json
"staking": {
"params": {
"unbonding_time": "1814400s",
"max_validators": 100,
"max_entries": 7,
"historical_entries": 10000,
"bond_denom": "uconst" // "uconst" is the bond denomination of Constantine testnet
},
}

Create validator transaction

Next, you must generate a transaction to create the validator:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
gentx my-validator-account 1000000000stake \
--commission-rate 0.01 \
--commission-max-rate 0.1 \
--commission-max-change-rate 0.1 \
--pubkey "$(archwayd tendermint show-validator)" \
--chain-id ${CHAIN_ID}

Add transaction to genesis file

Add the generated bonding transaction to the genesis file:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
collect-gentxs

Start validator node

Now, start your validator node in the local Archway network:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
start
tip

Note: If you have multiple nodes running on the same machine, errors like already in use ports are returned.

To proceed, run each node in isolated environments (Docker containers) or edit the app.toml and conf.toml files to setup different port numbers.

Run a validator post-genesis

Init config

Initialize your validator config:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
init ${VALIDATOR_MONIKER} --chain-id ${CHAIN_ID}

Retrieve the genesis file

To retrieve the genesis file, install jq (lightweight and flexible command-line JSON processor). Now, retrieve the genesis file:

curl -s "${RPC_URL}/genesis" | jq '.result.genesis' > ~/.archway/config/genesis.json

Run your node

Start your node in the Docker container:

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
start --p2p.seeds [email protected]_Name_orIPN:PORT --x-crisis-skip-assert-invariants

Create your validator

After your node is running and synced, you can create a validator by staking tokens.

note

If you ran the previous command in interactive mode, you must run the following command in a separate terminal window.

docker run --rm -it -v ~/.archway:/root/.archway archwaynetwork/archwayd:$NETWORK_NAME \
tx staking create-validator \
--from ${MY_VALIDATOR_ACCOUNT} \
--amount 1000000000udenom \
--min-self-delegation 1000000000udenom \
--commission-rate 0.01 \
--commission-max-rate 0.1 \
--commission-max-change-rate 0.1 \
--pubkey "$(archwayd tendermint show-validator)" \
--chain-id ${CHAIN_ID}