# Handling a validator

Once you've properly set up a validator node, it must be subject to certain rules and certain operations must be carried out to manage it.

# Downtime rules

The node can only stay offline for a certain amount of time.
In the case of Commercio Network this period has been fixed at 10,000 blocks lost, approximately corresponding to 17/18 hours.
If the node remains offline or fails to produce blocks for a period longer than the limit, it will incur slashing, i.e. an immediate loss of a certain amount of the staked tokens.
For "Commercio Network" the slashing percentage for downtime is set at 1%.

# Double sign rules

A validator node must be unique on the chain, so only a node can sign with that private key.
If there was another node with the same private key, this would result in a double signature, and therefore an immediate jail entry of the node with no exit possibility.
For "Commercio Network" the slashing percentage for double sing is set at 5%.
If you run into double signatures all tokens must be unbond and you must create a new validator node with new private keys.

WARNING

The unbond period is 21 days, so is necessary to wait this period to get back in possession of your tokens.

# Unjail procedure

In case a validator ended up jail for downtime, it is necessary that the wallet that created the validator performs a ujail transaction.
The follow command must be performed

cncli tx slashing \
  unjail \
  --from <your pub addr creator val> \
  --fees=10000ucommercio  \
  --chain-id="$CHAINID" \
  -y
1
2
3
4
5
6

If you are using the Ledger device you must first connect it to your computer, start the cosmos application and add --ledger flag to the command.

# Unbond procedure

Tokens can be delegated to any validator to increase its stake.
In case you want to remove all or part of the delegated tokens, an unbond transaction must be performed.
The undelegated period is 21 days, so is necessary to wait this period to get back in possession of your tokens.
To perform unbond transaction use the follow command

cncli tx staking \
  unbond \
  <validator-operator-addr> \
  50000000000ucommercio \
  --from <your pub addr delegator> \
  --fees=10000ucommercio  \
  --chain-id="$CHAINID" \
  -y
1
2
3
4
5
6
7
8

value of <validator-operator-addr> can be obtain from explorer:

Commercio.network explorer Testnet (opens new window).
Commercio.network explorer Mainnet (opens new window).

If you see your validator in the list click on its name.
The validator tab should have the value Operator. That value is your <validator-operator-addr>

If you are using the Ledger device you must first connect it to your computer, start the cosmos application and add --ledger flag to the command.

# Redelegate procedure

It is possible to perform a procedure of moving tokens in stake from one validator to another through the redelegate transaction.
To perform redelegate transaction use the follow command

cncli tx staking \
  redelegate \
  <source-validator-operator-addr> \
  <destination-validator-operator-addr> \
  50000000000ucommercio \
  --from <your pub addr delegator> \
  --fees=10000ucommercio \
  --chain-id="$CHAINID" \
  -y
1
2
3
4
5
6
7
8
9

value of <source-validator-operator-addr> and <destination-validator-operator-addr> can be obtains from explorer:

Commercio.network explorer Testnet (opens new window).
Commercio.network explorer Mainnet (opens new window).

Search your source validator in the list, i.e. the validator you want to move the tokens from, and click on its name.
The validator tab should have the value Operator. That value is your <source-validator-operator-addr>
Return to the list of validators and search your destination validator, i.e. the validator you want to move the tokens to, and click on its name.
The validator tab should have the value Operator. That value is your <destination-validator-operator-addr>

If you are using the Ledger device you must first connect it to your computer, start the cosmos application and add --ledger flag to the command.

# x% Loss of blocks

What does an x% loss of blocks mean for a validator?

In order to create blocks and extend the blockchain, active validators are selected in proportion to their stake by a pseudo-random mechanism that assigns at a time t a proposer (block proposer) and a fixed pool of validators (committee). The block proposer is assigned the task of proposing the block Bt (block at time t) while the committee is given the task of voting whether the block is hung on the chain or not.

Losing a block for a validator means that this validator was inactive at the time of the committee's choice or that it did not vote towards the execution of the block. Thus, having a validator with an x% loss of blocks means that the validator is only active (100 - x)% of the time when the Bt block is assigned.

# Common errors

# Account does not exists

# Problem

If I try to search for my address with the command

cncli query account did:com:1sl4xupdgsgptr2nr7wdtygjp5cw2dr8ncmdsyp --chain-id $CHAINID
1

returns the message

ERROR: unknown address: account did:com:1sl4xupdgsgptr2nr7wdtygjp5cw2dr8ncmdsyp does not exist
1

# Solution

Check if your node has completed the sync. On https://testnet.commercio.network you can view the height of the chain at the current state

Use the command

journal -u cnd -f | egrep " cnd+.*Committed state"
1

to check the height that reach your node

# Failed validator creation

# Problem

I executed the validator creation transaction but I don't appear in validators explorer page.

# Solution

It may be that by failing one or more transactions the tokens are not sufficient to execute the transaction.

Send more funds to your <your pub addr creator val> and repeat the validator creation transaction

# DB errors

# Problem

Trying to start the rest server or query the chain I get this error

panic: Error initializing DB: resource temporarily unavailable
1

# Solution

Maybe cnd and/or cncli services have been left active. Use the following commands

systemctl stop cnd
systemctl stop cncli
pkill -9 cnd
pkill -9 cncli
1
2
3
4

and repeat the procedure