Anatha Validator Guide

Infrastructure

Recommended configuration:
  • Number of CPUs: 2
  • Memory: 8GB
  • Disk: 250GB SSD
  • OS: Ubuntu 20.04 LTS
  • Allow all incoming connections from TCP port 26656 and 26657
  • Static IP address
The recommended configuration from AWS is the equivalent of a t3.large machine with 250GB EBS attached storage.

Prerequisites

Update the system and install dependencies:
1
sudo apt update
2
sudo apt upgrade -y
3
sudo apt install build-essential jq -y
Copied!
Install Golang:
1
# Install latest go version https://golang.org/doc/install
2
wget -q -O - https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh | bash -s -- --version 1.15.3
3
4
source ~/.profile
Copied!
To verify that Golang is installed:
1
go version
2
# Should return go version go1.15.3 linux/amd64
Copied!

Running a Validator Node

Install the executables

1
git clone https://github.com/anathatech/project-anatha.git
2
cd project-anatha
3
git checkout v0.1.1
4
5
# install executables
6
make install
Copied!

Initialize the validator

1
# Replace <your-moniker> with the publicly viewable name for your validator.
2
anathad init --chain-id mainnet <your-moniker>
Copied!

Set up your keys

1
# Create a wallet for your node. <your-wallet-name> is just a human-readable name you can use to remember your wallet. It can be the same or different than your moniker.
2
anathacli keys add <your_wallet_name> --keyring-backend test
3
4
# If you have a wallet with a balance assigned to it, you need to import it by. You will be prompted to enter your bip39 mnemonic
5
anathacli keys add <your_wallet_name> --recover --keyring-backend test
Copied!

Create the upgrade manager directory structure

1
mkdir -p ~/.anathad/upgrade_manager/genesis/bin && mkdir -p ~/.anathad/upgrade_manager/upgrades
Copied!

Copy the genesis binary to the upgrade manager

1
cp $(which anathad) ~/.anathad/upgrade_manager/genesis/bin
Copied!

Verify that the binary has been copied

1
ls -las ~/.anathad/upgrade_manager/genesis/bin
2
3
# Should return the anathad binary in the correct location
Copied!

Fetch the genesis file

1
# Copy the genesis file to the anathad directory
2
curl https://guardians.mainnet.anatha.net:26657/genesis | jq ".result.genesis" > ~/.anathad/config/genesis.json
Copied!

Create the service file with the following content

1
sudo nano /etc/systemd/system/anathad.service
Copied!
1
[Unit]
2
Description=anathad
3
Requires=network-online.target
4
After=network-online.target
5
6
[Service]
7
Restart=on-failure
8
RestartSec=3
9
User=ubuntu
10
Group=ubuntu
11
Environment=DAEMON_NAME=anathad
12
Environment=DAEMON_HOME=/home/ubuntu/.anathad
13
Environment=DAEMON_ALLOW_DOWNLOAD_BINARIES=on
14
Environment=DAEMON_RESTART_AFTER_UPGRADE=on
15
PermissionsStartOnly=true
16
ExecStart=/home/ubuntu/go/bin/anathad-manager start --pruning="nothing"
17
StandardOutput=file:/var/log/anathad/anathad.log
18
StandardError=file:/var/log/anathad/anathad_error.log
19
ExecReload=/bin/kill -HUP $MAINPID
20
KillSignal=SIGTERM
21
LimitNOFILE=4096
22
23
[Install]
24
WantedBy=multi-user.target
Copied!
If you are not logged in as the ubuntu user and/or if your home directory is not /home/ubuntu, please change the User, Group, Environment, and ExecStart variables in the service config above appropriately.

Start the Daemon service

1
# Create log files for anathad
2
make log-files
3
4
# Enable the anathad service
5
sudo systemctl enable anathad
6
7
# Add seed nodes to ~/.anathad/config/config.toml, replace line 172 with
8
seeds = "[email protected]net:26656,[email protected]net:26656,[email protected]net:26656"
9
10
# Start the node
11
sudo systemctl start anathad
Copied!
To check on the status of the node use:
1
anathacli status
2
# or
3
sudo journalctl -u anathad -f
Copied!
To view the logs use:
1
# Standard output of anathad
2
tail -f /var/log/anathad/anathad.log
3
4
# Standard error of anathad
5
tail -f /var/log/anathad/anathad_error.log
Copied!

Applying for being a validator

1
# Create the validator
2
# Be sure to replace <your-wallet-name>, <your-moniker>
3
anathacli tx astaking create-validator --from <your-wallet-name> --moniker <your-moniker> --pubkey $(anathad tendermint show-validator) --chain-id mainnet --keyring-backend test
Copied!

Verify the node is in the validator list

1
# Check all validators
2
anathacli q astaking validators
3
4
# Check current validator
5
# Be sure to replace <your-wallet-name>
6
anathacli q astaking validator $(anathacli keys show <your-wallet-name> --keyring-backend test --bech val -a) --chain-id mainnet
Copied!

Recovering From a Slashing Infraction

First, you need to verify the state of your validator by running:
1
# Check current validator
2
# Be sure to replace <your-wallet-name>
3
anathacli q astaking validator $(anathacli keys show <your-wallet-name> --keyring-backend test --bech val -a) --chain-id mainnet
Copied!
The response would be similar to the following:
1
operatoraddress: anathavaloper1q9se95mxzmckc3drtrc4facayn8l408w0avqrk
2
conspubkey: anathavalconspub1zcjduepqjl5uxahun435923psjzuf8epeuung5gyjs5gtdxkg902qqzlzrvs2xx797
3
jailed: true
4
status: 1
5
tokens: "9900000000000"
6
delegatorshares: "10000000000000.000000000000000000"
7
description:
8
moniker: node1
9
identity: ""
10
website: ""
11
security_contact: ""
12
details: ""
13
unbondingheight: 194
14
unbondingcompletiontime: 2020-05-29T08:28:58.089254769Z
15
minselfdelegation: "10000000000000"
16
ticket: 16
Copied!
As you can see the jailed status is set to true and the delegation tokens are below the needed amount. You need to perform top up your token balance and send an unjail transaction.
To check when is the earliest time the validator can be unjailed run:
1
anathacli q slashing signing-info $(anathad tendermint show-validator) --chain-id mainnet
Copied!
The response will return the jailed_until parameter in the UTC time zone:
1
address: anathavalcons1jw0yhuzpqrqxlnxu44lu3vsu0246md6eeak0eg
2
start_height: 0
3
index_offset: 2
4
jailed_until: 2020-05-29T08:28:58.089254769Z
5
tombstoned: false
6
missed_blocks_counter: 2
Copied!
To top up your validator balance, run:
1
# Be sure to replace <your-wallet-name>
2
anathacli tx astaking delegate $(anathacli keys show <your-wallet-name> --keyring-backend test --bech val -a) --from <your-wallet-name> --chain-id mainnet --keyring-backend test
Copied!
To unjail your validator run:
1
# Be sure to replace <your-wallet-name>
2
anathacli tx slashing unjail --from <your-wallet-name> --keyring-backend test --chain-id mainnet
Copied!

Stopping a Validator Node

To gracefully shutdown a validator node which is in the active validator set, the operator must first unbond their tokens before being able to shut down the node and withdraw their stake.
1
# Be sure to replace <your-wallet-name>
2
anathacli tx astaking unbond --from <your-wallet-name> --chain-id mainnet --keyring-backend test
Copied!
After running the unbonding transaction, you need to check the length of the unbonding time by running:
1
anathacli q astaking params
Copied!
After that period of time, your stake will be returned to your account. During the unbounding period, you can be slashed for any infraction that happened before the unbonding transaction.
As soon as you run the unbond transaction, you are free to shut down your validator node.
1
sudo systemctl stop anathad
Copied!
Last modified 8mo ago