How to Become a Validator

Stratos Chain relies on a set of validators to secure the network. This document explains how to become a validator step by step. In testing phase, the mechanisms and values are susceptible to change.

About Validator

The role of validators is to run a full-node and participate in consensus by broadcasting votes which contain cryptographic signatures signed by their private key. Validators commit new blocks in the blockchain and receive revenue in exchange for their work. They must also participate in governance by voting on proposals. Validators are weighted according to their total stake.

A full node is a program that fully validates transactions and blocks of a blockchain. In practice, running a full node implies running a non-compromised and up-to-date version of the software with low network latency and with no downtime.

The weight(i.e. voting power) of a validator is determined by the amount of staking tokens (STOS) bonded as collateral. These bonded staking tokens can be self-delegated directly by the validator or delegated to the validator by other tokens holders.

Not all the validators will actively participate in block processing. In testing phase, only the top 64 validators, sorted by their weight(voting power), will be in the active list.

Becoming a validator

1. Get Connected to Stratos Chain Testnet

Please refer to stratos-chain-testnet to

2. Directory Structure

After the node has caught up to the latest block, your Stratos-chain Wallet has been created and fed with an amount of tokens, the $HOME directory should include the following directories and files.

.
├── ...
├── .stchaincli
├── stchaincli
├── .stchaind
├── stchaind
├── ...

By default, the two binary executable files stchaincli and stchaind as well as two directories .stchaincl and .stchaind have been saved or created in the $HOME folder. If you are not sure what is your$HOMEfolder, in terminal, use 'echo $HOME' to check. In the following instruction, we suppose you have entered the $HOMEfolder

$ echo $HOME
/home/<your login username>

.stchaincli contains the folder keyring-test-cosmos, which holds the wallet info and wallet address

.
└── keyring-test-cosmos
    ├── st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw.address
    └── wallet1.info

.stchaind contains config and data folders.

.
├── config
   ├── addrbook.json
   ├── app.toml
   ├── config.toml
   ├── genesis.json
   ├── node_key.json
   └── priv_validator_key.json
└── data
    ├── application.db
    ├── blockstore.db
    ├── cs.wal
    ├── evidence.db
    ├── priv_validator_state.json
    ├── state.db
    └── tx_index.db

In config folder:

  • addrbook.json stores peer addresses.

  • app.toml contains the default settings required for app.

  • config.toml contains various options pertaining to the stratos-chain configurations.

  • genesis.json defines the initial state upon genesis of stratos-chain.

  • node_key.json contains the node private key and should thus be kept secret.

  • priv_validator_key.json contains the validator address, public key and private key, and should thus be kept secret.

In data folder:

  • All *.db folders are Tendermint databases

  • Tendermint uses a write ahead log (WAL) for consensus

  • priv_validator_state.jsonholds the validator's state

3. Check the account balance

$ ./stchaincli query account st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw
|
  address: st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw
  coins:
  - denom: ustos
    amount: "100000000000"
  public_key: ""
  account_number: 8
  sequence: 0

4. Get a new validator's pubkey

Validators are actors on the network committing new blocks by submitting their votes. It refers to the node itself, not a single person or a single account. In Stratos Chain, The protocol requires a fixed known set of validators, where each validator is identified by their public key. To get the node public key, run the following command.

$ ./stchaind tendermint show-validator
stvalconspub1zcjduepq86vgqerernqveqgyfky70j5dt0ld2t8770dgs3f6st2xdx40xq2savp5yc

5. create-validator command: Create a new validator and declare its flags

we can make a node as a validator by sending a create-validator transaction command, where some flags must be filled out:

  • pubKey: The private key associated with this Tendermint PubKey is used to sign prevotes and precommits. Got form step4

  • moniker: the validator's name

  • website: website(Optional)

  • description: description(Optional)

  • commission-rate: The commission rate on block rewards and fees charged to delegators

  • commission-max-rate: The maximum commission rate which this validator can charge. This flags cannot be changed after create-validator is processed

  • commission-max-change-rate: The maximum daily increase of the validator commission. This flags cannot be changed after create-validator is processed

  • min-self-delegation: Minimum amount of tokens the validator needs to have bonded at all time. If the validator's self-delegated stake falls below this limit, their entire staking pool will unbond. The minimum amount of tokens that must be delegated to be a bonded validator is "1" = 1000000ustos.

Example:

$ ./stchaincli tx staking create-validator --amount=100000000000ustos --pubkey=stvalconspub1zcjduepq86vgqerernqveqgyfky70j5dt0ld2t8770dgs3f6st2xdx40xq2savp5yc --moniker="myValidator" --chain-id=test-chain --keyring-backend=test --commission-rate=0.10 --commission-max-rate=0.20 --commission-max-change-rate=0.01 --min-self-delegation=1 --from=st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw --gas=auto

Response:

gas estimate: 535912
{"chain_id":"test-chain","account_number":"8","sequence":"0","fee":{"amount":[],"gas":"535912"},"msgs":[{"type":"cosmos-sdk/MsgCreateValidator",
"value":{"description":{"moniker":"myValidator","identity":"","website":"","security_contact":"","details":""},
"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},
"min_self_delegation":"1","delegator_address":"st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw",
"validator_address":"stvaloper14a2h6ldd947c52j796u66ywrfuvkk6mxmvcv39",
"pubkey":"stvalconspub1zcjduepq86vgqerernqveqgyfky70j5dt0ld2t8770dgs3f6st2xdx40xq2savp5yc","value":{"denom":"ustos","amount":"100000000000"}}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: AC22D9AB4C796EFCD4F8466CDFD76279013B179B463BDCB18055C18DF6CEA796
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

We can also take a look at the blockchain log

I[2021-12-11|15:16:43.970] Executed block                               module=state height=226 validTxs=1 invalidTxs=0
I[2021-12-11|15:16:43.972] Updates to validators                        module=state updates=9317ECE5736ED833D26F0ACD1BDB09EFD74D8A26:100
I[2021-12-11|15:16:43.975] Committed state                              module=state height=226 txs=1 appHash=C371280DBD77B25853A19EDCE5D0F3449C39EE73D3AAC2E2016EADE3B144DAF2

From the above information, we noticed the create-validator transaction was committed successfully at height=226, with its initial voting-power=100.

6. Different Validator States

After a validator is created with a create-validator transaction, the validator is in one of three states:

  • In validator set: Validator is in the active set and participates in consensus. Validator can be slashed for misbehavior.

  • Jailed: Validator misbehaved and is in jail.

  • Unbonded: Validator is not in the active set. Validator cannot be slashed. It is still possible to delegate tokens to an unbonded validator. Undelegating from an unbonded validator is immediate.

In the response of query staking validators command in Step7, the value of jailed implies if a validator is in jail, while the value of status implies its bonding status:

  Unbonded  BondStatus = 0
  Unbonding BondStatus = 1
  Bonded    BondStatus = 2

7. Verify myValidator in the staking validators list

$ ./stchaincli query staking validators --chain-id=test-chain
- |
  operatoraddress: stvaloper1qzx8na3ujlaxstgcyguudaecr6mpsemfgm7zqk
  conspubkey: stvalconspub1zcjduepqavypwyzg9dprzus43vjz8c60uvh5869parfns5sy4tsksdckauasnqpudk
  jailed: false
  status: 2
  tokens: "500000000000"
  delegatorshares: "500000000000.000000000000000000"
  description:
    moniker: node
    identity: ""
    website: ""
    security_contact: ""
    details: ""
  unbondingheight: 0
  unbondingcompletiontime: 1970-01-01T00:00:00Z
  commission:
    commission_rates:
      rate: "0.100000000000000000"
      max_rate: "0.200000000000000000"
      max_change_rate: "0.010000000000000000"
    update_time: 2021-11-10T19:25:56.064418053Z
  minselfdelegation: "1"
- |
  operatoraddress: stvaloper14a2h6ldd947c52j796u66ywrfuvkk6mxmvcv39
  conspubkey: stvalconspub1zcjduepq86vgqerernqveqgyfky70j5dt0ld2t8770dgs3f6st2xdx40xq2savp5yc
  jailed: false
  status: 2
  tokens: "100000000"
  delegatorshares: "100000000.000000000000000000"
  description:
    moniker: myValidator
    identity: ""
    website: ""
    security_contact: ""
    details: ""
  unbondingheight: 0
  unbondingcompletiontime: 1970-01-01T00:00:00Z
  commission:
    commission_rates:
      rate: "0.100000000000000000"
      max_rate: "0.200000000000000000"
      max_change_rate: "0.010000000000000000"
    update_time: 2021-12-11T20:16:38.846449796Z
  minselfdelegation: "1"

As an active validator, the value of status should be 2 and jailed is false.

From all validator candidates, only the top 64 validators with the highest total stake are the designated validators. If a validator's total stake falls below the top 64, then that validator loses their validator privileges. The validator cannot participate in consensus until the stake is high enough to be in the top 64. In BIG DIPPER, the validator is shown in inactive list, but not in active list.

We listed some examples of commonly used commands for validators:

responsible for the proof of stake (PoS) layer of the Stratos-chain. It contains create/edit validator parameters as well as bond/unbond delegation operations.

  • Create new validator initialized with a self-delegation to it.

stchaincli tx staking create-validator --amount=100000000ustos --pubkey=stvalconspub1zcjduepq86vgqerernqveqgyfky70j5dt0ld2t8770dgs3f6st2xdx40xq2savp5yc --moniker="myValidator" --chain-id=test-chain --keyring-backend=test --commission-rate=0.10 --commission-max-rate=0.20 --commission-max-change-rate=0.01 --min-self-delegation=1 --from=st14a2h6ldd947c52j796u66ywrfuvkk6mxvq3vdw --gas=auto
  • Edit(modify) an existing validator Info(params). You can add more information to the validator, such as --website, or --memo.

stchaincli tx staking edit-validator --chain-id=test-chain --keyring-backend=test --min-self-delegation=100 --from=st1gamc7ajhzukp08nle9z9asyfx4u4dlz5xpfu7e --memo="Change min-self-delegation to 100" --gas=auto
  • Delegate an amount of liquid coins to a validator from your wallet.

stchaincli tx staking delegate stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k 1000ustos --from st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain --keyring-backend=test --gas=auto
  • Unbond an amount of bonded shares from a validator.

stchaincli tx staking unbond stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u 10000ustos --from=st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh --keyring-backend=test --chain-id=test-chain --gas=auto
  • Query delegations for an individual delegator on all validators.

stchaincli query staking delegations st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain
  • Query details about an individual validator.

stchaincli query staking validator stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --chain-id=test-chain
  • Query values for amounts stored in the staking pool.

stchaincli query staking validators --chain-id=test-chain

responsible for distributing staking rewards between validators, delegators, and the Community Pool. It contains operations to claim rewards form a validator and specially, query all slashes of a validator. You cannot withdraw a part of reward. Every time you withdraw, all reward will be withdrawn.

  • Withdraw rewards from a given delegation address and optionally withdraw validator's commission if the delegation address given is a validator operator.

stchaincli tx distribution withdraw-rewards stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain --keyring-backend=test --gas=auto
  • Withdraw all delegation rewards for a delegator.

stchaincli tx distribution withdraw-all-rewards --from=st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain --keyring-backend=test --gas=auto
  • Query all rewards earned by a delegator, optionally restrict to reward from a single validator.

stchaincli query distribution rewards st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain --height=9765
  • Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations.

stchaincli query distribution validator-outstanding-rewards stvaloper1fmdh9vf262qxe5ehmp9jvgkqzaeye4qmxjrr3k --chain-id=test-chain --height=9765
  • Query all coins in the community pool.

stchaincli query distribution community-pool --chain-id=test-chain --height=9765
  • Query all slashes of a validator for a given block range.

stchaincli query distribution slashes stvaloper1095s2f3m60qz48spy3wr52gw8xmy7xqywnxnrq 0 5000 --chain-id=test-chain

responsible for enabling Stratos Chain to penalize any validator for an attributable violation of protocol rules by slashing (i.e. partially destroying) the bonded tokens. We usually use unjail command to un-jail a validator and Information about validator's liveness activity is tracked through signing-info.

  • Unjail a jailed validator.

stchaincli tx slashing unjail --from st1fmdh9vf262qxe5ehmp9jvgkqzaeye4qm372rda --chain-id=test-chain --keyring-backend=test --gas=auto
  • Use a validators' consensus public key to find the signing-info for that validator.

stchaincli query slashing signing-info stvalconspub1zcjduepqsnwlx7rv0ghyvh9tm99zle39df99jt8hccwt8jdrvjs26zqrzh9shdmgyc  --chain-id=test-chain

9. Slashing

slashing is a validator punishment mechanism. If a validator misbehaves, its bonded stake along with its delegators' stake will be slashed. As Cosmos states, there are 3 main faults that can result in slashing of funds for a validator and its delegators:

  • Double signing: occurs when a validating entity (private key) submits two signed messages for the same block. double signing makes it more difficult for the network to reach consensus. The system will then permanently burn ("slash") that validator's total delegations (stake-backing) by the parameter SlashFractionDoubleSign(5% currently). All delegators to an offending validator will lose 5% of all STOSs delegated to this validator. At this point the validator will be "tombstoned," which means the validator will be permanently removed from the active validator set, and can never unjail.

  • Unavailability(Downtime): It occurs when a validator is unavailable to sign transactions on a blockchain for a certain period of time. for example, if a validator in the active set is offline for too long(missing more than 95% of the last 10.000 blocks), the validator will be slashed by the parameter SlashFractionDowntime(0.01%) and temporarily removed from the active set(jailed) for at least the DowntimeJailDuration(10 minutes currently). If the jailing is due to being offline for too long, the validator can send an unjail transaction in order to re-join the validator set.

  • Non-voting: If a validator did not vote on a proposal and once the fault is reported, its stake will receive a minor slash.

Even if a validator does not intentionally misbehave, it can still be slashed if

Validators FAQ

Why the validator status is 0 and cannot find it in active list?

Validator status is 0 means that the validator stake is Unbonded. When using create-validator transaction, you have defined the flag min-self-delegation, the minimum amount of stake the validator needs to have bonded at all time. If the validator's self-delegated stake falls below this limit, their entire staking pool will unbond and the validator status is 0. Although this validator has been created, it will not show in the validator set.

You need to delegate more tokens to this validator until the amount of stake is above min-self-delegation. Note, min-self-delegation=1 means the minimum amount of stake is 1000000ustos.

Why my validator is jailed? What can I do next?

Sometimes, you may see your validator is jailed and the voting power become 0. The shares of the validator are unbonded in order to not affecting the running of the network. If this happens, check your validator information and see if your validator was jailed.

$ stchaincli q staking validator <your_validator_operator_address>
...
jailed: true
status: 1
...

This means the validator is jailed and the validator status is unbonding.

A lot of scenarios may lead to a validator jailing, like:

  • Double signing. Validator cannot re-join to validator set.

  • Unbond too many stake, making the bonded stake is lower than the min-self-delegation

  • Downtime: unavailable to sign transactions on a blockchain for a certain period of time

  • Non-voting

  • Low on disk space

  • node crashes(node does not start or does not catch up to the latest block)

Except for double signing, you have to wait for your node finishes catch-up and wait for at least 10 minutes(downtime jail duration). Then, you can unjail your validator. Finally, check your validator again to see if the validator's voting-power is back.

How can I check my validator info such as voting-power?

There are three ways to check it:

  • status Command

    $ ./stchaincli status

    Response

      {
        "node_info": {
          "protocol_version": {
            "p2p": "7",
            "block": "10",
            "app": "0"
          },
          "id": "e42cffed3a983ec3c4517a3ef271efa21625cce7",
          "listen_addr": "tcp://0.0.0.0:26756",
          "network": "test-chain",
          "version": "0.33.9",
          "channels": "4020212223303800",
          "moniker": "myValidator",
          "other": {
            "tx_index": "on",
            "rpc_address": "tcp://127.0.0.1:26757"
          }
        },
        "sync_info": {
          "latest_block_hash": "E6870B97B193F6291701036E81AA910B8FACD8DA50CA568FA2BA40F2C3925697",
          "latest_app_hash": "8B06091734AC6D40A3BFF320BB79157AD6636DB47A8C47D653B4D4487225FD2E",
          "latest_block_height": "136",
          "latest_block_time": "2021-12-13T22:08:04.275202136Z",
          "earliest_block_hash": "E2E3A6098D5F8F8FDF388ED269945721C7CB90732B927EC32E487499BEA37953",
          "earliest_app_hash": "",
          "earliest_block_height": "1",
          "earliest_block_time": "2021-11-10T19:25:56.064418053Z",
          "catching_up": false
        },
        "validator_info": {
          "address": "8117C2E99E89DD82E3BE167C79C299BE46128BB2",
          "pub_key": {
              "type": "tendermint/PubKeyEd25519",
              "value": "b+7/uYYN2VWlL7vS+XLdr5OIeNjRHuz7sPB1uuH2S6o="
          },
          "voting_power": "100"
        }
      }
  • API

    curl localhost:26657/status

    Response

      {
        "jsonrpc": "2.0",
        "id": -1,
        "result": {
          "node_info": {
            "protocol_version": {
                "p2p": "7",
                "block": "10",
                "app": "0"
            },
            "id": "fb818c7333d2616fa024900c7cbbfa0444f6b411",
            "listen_addr": "tcp://0.0.0.0:26656",
            "network": "test-chain",
            "version": "0.33.9",
            "channels": "4020212223303800",
            "moniker": "node",
            "other": {
                "tx_index": "on",
                "rpc_address": "tcp://127.0.0.1:26657"
            }
          },
          "sync_info": {
            "latest_block_hash": "556FA57388C7D05D94A0E1A371E220C0D2DE30A16A8446EC661DF1A983EB73F9",
            "latest_app_hash": "9EC9FB3496B23AD65DE822373D1526516899AB401027FA025D9B93541705FAA2",
            "latest_block_height": "94",
            "latest_block_time": "2021-12-13T21:53:03.058858472Z",
            "earliest_block_hash": "E2E3A6098D5F8F8FDF388ED269945721C7CB90732B927EC32E487499BEA37953",
            "earliest_app_hash": "",
            "earliest_block_height": "1",
            "earliest_block_time": "2021-11-10T19:25:56.064418053Z",
            "catching_up": false
          },
          "validator_info": {
            "address": "539EC755EB5827FDD7EB64CB5219B8DFA7D1A300",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "6wgXEEgrQjFyFYskI+NP4y9D6KHo0zhSBKrhaDcW7zs="
            },
            "voting_power": "500000"
          }
        }
      }

Is there any minimum amount of stake to delegate to a validator? and is there a minimum amount of STOS that must be delegated to be an active (bonded) validator?

There's no limitation for delegating the validator, but a tiny amount of delegation may be ignored by the algorithm when distributing rewards.

When you use create-validator transaction to create a validator, the flag --min-self-delegation defines the minimum amount of stake. If a validator's bonded stake goes below the limit that it predefined, this validator and all of its delegators will unbond. In testing phase, the system takes only the top 64 validators with the highest weight(voting power) into the active list. The more bonded stake a validator has, the more possible to be an active one. We recommend 100,000,000,000ustos (100STOS) when you create your validator. Note, --min-self-delegation=1 means 1000,000ustos.

What is self-delegation? How can I increase my self-delegation?

Self-delegation is a delegation of stake from a validator to itself. The delegated amount can be increased by sending a delegate transaction from your validator's wallet address.

Last updated