Turning a full node in to a validator node [osmosis-1]

Cat Boss
3 min readAug 13, 2021

--

cover

Hello Cat Boss here! Today we’re going to quickly talk about how to transform a full node in to a validator node. This process will work for most cosmos-sdk based chains but we’ll stick with osmosis since we previously setup a full node there (https://catboss.medium.com/cat-boss-setting-up-a-fullnode-for-osmosis-osmosis-1-5f9752460f8f)

Official documentation from the osmosis team can be found: https://github.com/osmosis-labs/networks/blob/main/genesis-validators.md

If you haven’t figured it out already, a validator node is essentially a full node with an additional role.

Prerequisites

A synced up working full node with a priv_validator_key.json located in ~/.osmosisd/config/priv_validator_key.json .

The priv_validator_key.json is created when you previously initialised your working directory by running the following:

osmosisd init --chain-id=osmosis-1 <your_moniker>

Create an address

osmosisd keys add <key_name> <optional flags>

This will generate or create an osmo address which we will use to create a validator with. Run the following to list all your keys:

osmosisd keys list

It should show something like this

- name: soon-to-be-validator
type: local
address: osmo162c9jct25jz8jpg06v9d7y9tjwdgxxx0us72n5
pubkey: osmopub1addwnpepqtdwfs3ez4c9c4vte7y4ehe70wyydgxfmjsvmvswxlvgycu7dntdzrwalq4
mnemonic: ""
threshold: 0
pubkeys: []

Before continuing…

The address created above must have some balance in order to proceed.

Get tendermint validator pubkey

We will be linking this pubkey to our previously generated address when creating a validator

osmosisd tendermint show-validator

It should show something like this

osmovalconspub1...

Create validator

Adjust the transaction to match your needs (moniker, website…etc)

osmosisd tx staking create-validator \
--amount=10000000uosmo \
--pubkey=$(osmosisd tendermint show-validator) \
--moniker="Cat Boss" \
--website="https://catboss.network" \
--chain-id=osmosis-1 \
--commission-rate="0.1" \
--commission-max-rate="1.00" \
--commission-max-change-rate="1.00" \
--min-self-delegation="1" \
--gas="auto" \
--gas-adjustment="1.2" \
--gas-prices="0.025uosmo" \
--from=<key_name>

Once completed, the cli should return a tx hash like this:

5D8890A9C492791DE4028F78D1C75A7DA9479030554F746FC6B124E605CAC4E1

Go over to any explorer and have a look to make sure everything is set.
ex: https://www.mintscan.io/osmosis/txs/5D8890A9C492791DE4028F78D1C75A7DA9479030554F746FC6B124E605CAC4E1

Check your validator status

Get your validator address

osmosisd keys show <key_name> -a --bech val

query your validator

osmosisd query staking validator <validator_address> -o json | jq

if setup correctly, you should see something like this:

{
"operator_address": "osmovaloper1wke3ev9ja6rxsngld75r3vppcpet94xxwcmk4v",
"consensus_pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "FxemoA8I2BR+58ooPCP5Dge1SU5npBWSPb9zccCtgMs="
},
"jailed": false,
"status": "BOND_STATUS_BONDED",
"tokens": "67276171545",
"delegator_shares": "67276171545.000000000000000000",
"description": {
"moniker": "Cat Boss",
"identity": "059BCF656623D0BE",
"website": "https://catboss.network",
"security_contact": "",
"details": "Trust me, I am a Cat."
},
"unbonding_height": "0",
"unbonding_time": "1970-01-01T00:00:00Z",
"commission": {
"commission_rates": {
"rate": "0.050000000000000000",
"max_rate": "1.000000000000000000",
"max_change_rate": "1.000000000000000000"
},
"update_time": "2021-08-09T21:27:15.132574847Z"
},
"min_self_delegation": "1"
}

Congrats

You have officially created a validator node. In order to be active, your voting power will need to be higher than the active validator in the last place.

Comments

While this is the most generic way there are some things we should mention in terms of security. If possible we should never create/add any key in our remote full node. Instead we want to do this locally and broadcast to our node remotely. Stay tuned, we’ll have an article soon on how to locally run tx and queries while calling our node remotely.

ヾ(=`ω´=)ノ”

--

--

Cat Boss
Cat Boss

Written by Cat Boss

We’re dPoS validators and we like writing medium posts documenting our journey, sharing tips we learn along the way. Trust me, I am a Cat.

No responses yet