Become a Validator

Become a validator

This tutorial helps validators and full nodes quickly synchronize with the Oraichain mainnet by downloading a storage snapshot prepared by the team. The downloading speed is much faster than synchronizing from the first block, which allows fast set up to join the network in no time!
If you want to synchronize your node using the traditional method, please follow this tutorial instead.

Hardware specifications for an Oraichain node:

A dedicated node that can run Docker amd64.
Minimum requirements
1
The number of CPUs: 2vCPUs
2
RAM: 2GB
3
Storage: 200GB SSD
Copied!
Recommended requirements
1
The number of CPUs: 2vCPUs
2
RAM: 2GB
3
Storage: 200GB SSD
Copied!
Estimated cost for a node with minimum requirements using Digital Ocean: $25/month
droplet
disk

Setup the validator node

1. Download and run the setup file

1
curl -OL https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/mainnet-static-files/docker-compose.fast.yml && curl -OL https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/mainnet-static-files/orai.env && mv docker-compose.fast.yml docker-compose.yml
Copied!

2. Edit wallet name and moniker you prefer to create a new wallet and validator in the orai.env file you have just downloaded

3. Build and enter the container

With docker, your validator can run on any platforms. As a result, it is a must to install and download Docker & docker-compose. Afterward, please type:
1
docker-compose pull && docker-compose up -d --force-recreate
Copied!

4. Initiate the node

Please enter the container and type:
1
oraid init "$MONIKER" --home /workspace/.oraid
Copied!
then, you need to download the network's genesis file by using the following command inside your container:
1
wget -O /workspace/.oraid/config/genesis.json https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/mainnet-static-files/genesis.json
Copied!

5. Download Chain Data

Download the latest chain data from a snapshot provider. Select the tab to the desired node type (Default or Pruned). A Pruned node will have the smallest disk size possible, but it will only keep the latest network state, which is recommended for sentry, seed nodes & light clients. Meanwhile, a Default node will store more network state history, but it will have larger size, which is suitable for validators.
  • Default:
1
docker-compose exec orai bash -c 'wget -O - https://orai.s3.us-east-2.amazonaws.com/oraid-ms2-bk.tar.gz | tar -zxvf -'
Copied!
  • Pruned:
1
docker-compose exec orai bash -c 'wget -O - https://orai.s3.us-east-2.amazonaws.com/oraid-data-pruned-wasm-bk.tar.gz | tar -zxvf -'
Copied!
After extracting the chain data, you need to move such data into the .oraid/ directory:
1
docker-compose exec orai bash -c 'mv /workspace/data/* /workspace/.oraid/data && mv /workspace/wasm/ /workspace/.oraid && rmdir /workspace/data'
Copied!

6. Initiate your validator wallet

Please enter your container and type:
1
oraid keys add $USER 2>&1 | tee account.txt && exit
Copied!
After running, there will be an account.txt file generated, which stores your account information as well as its mnemonic. Please keep it safe, and remove the file when you finish storing your account information.

Start the network

Please exit the container and follow the below steps to start the nodes

List of seed & sentry nodes that you can connect to

1. Start the node

1
docker-compose restart orai && docker-compose exec -d orai bash -c 'oraivisor start --p2p.pex false --p2p.persistent_peers "<node-id1>@<pubclic-ip1>:26656,<node-id2>@<public-ip2>:26656"'
Copied!
If you do not specify the --p2p.persistent_peers flags, you must add at least a persistent peer connection in the .oraid/config/config.toml file before running the below command, otherwise your node will not be able to connect to the Oraichain network.
The above commands run as the background process so when you turn off your Terminal, it is still running. You can always run them in the foreground process by removing the "-d" flag.

3. Wait until your node is synchronized

Please wait until your node is fully synchronized by typing: oraid status &> status.json && cat status.json | jq '{catching_up: .SyncInfo.catching_up}'. If the catching up status is false, you can continue.

4. Create validator transaction

You need to store two following files: .oraid/config/node_key.json, .oraid/config/priv_validator_key.json. They contain your validator information for voting. Create backups for these files, otherwise you will lose your validator node if something wrong happens.
You can check your wallet information by typing: oraid query auth account <your-validator-wallet-address> inside of the container or through the explorer, where you import your wallet. To prevent spamming, your wallet is not activated by default. As a result, it needs to receive at least one MsgSend transaction from a different account. In other words, you should receive some ORAI tokens (minimum of 10^-6 ORAI) to continue. When your wallet has some tokens, please enter the container and type:
1
wget -O /usr/bin/fn https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/mainnet-static-files/fn.sh && chmod +x /usr/bin/fn && fn createValidator
Copied!

5. Check your node status with voting power

Type the following command to check your voting power:
1
oraid status &> status.json && cat status.json | jq '{catching_up: .SyncInfo.catching_up, voting_power: .ValidatorInfo.VotingPower}'
Copied!
If you see that your VotingPower is greater than 0, and the catching_up is false, then congratulations, you are a validator now!

Tips

You should monitor your nodes frequently. Make sure it has the correct tendermint public key to vote. To check, you should take a look at your tendermint public key in the ValidatorInfo attribute after typing:
1
oraid status
Copied!
Please compare the tendermint public key to the one when you type:
1
oraid query staking validator <operator address>
Copied!
If they match, then your node is still running fine. If not, then you should remove the .oraid/config/node_key.json, .oraid/config/priv_validator_key.json files, replace them with your backup files and restart the node.

IMPORTANT NOTE

YOU MUST NOT RUN TWO VALIDATOR NODES WITH THE SAME NODE KEY AND VALIDATOR KEY AT THE SAME TIME. OTHERWISE, YOUR VALIDATOR WILL BE TOMBSTONED BECAUSE OF DOUBLE SIGNING, AND IT WILL NEVER BE ABLE TO JOIN THE VALIDATORSET EVER AGAIN.

Setup your sentry nodes (optional)

This section is optional if you want to follow the sentry architecture. For more information about the sentry architecture, please click here.
Setting up a fast sync sentry node is the same to that of a validator node but without the steps 4 and 5

Setup the sentry architecture (optional)

This section is optional if you want to follow the sentry architecture. You can set the following configurations in the file .oraid/config/config.toml directly. Some pairs can be configured through the start command. This architecture will help you connect your genesis nodes with your sentry nodes, and your sentry nodes are responsible for connecting to other nodes within the network. To start using flags, please type:
1
oraivisor start --help
Copied!
You also need to prepare your own VPC network beforehand.

1. Validator node configuration

1
pex = false
2
persistent_peers = <list of sentry nodes with node id, private ips, port 26656>
3
addr_book_strict = false
4
unconditional_peer_ids (optional) = <list of sentry node ids>
Copied!
To get a node id, type:
1
oraid tendermint show-node-id
Copied!
some configuration values can only be changed in the .oraid/config/config.toml file, like addr_book_strict
Example:
1
pex = false
2
persistent_peers = "[email protected]:26656,[email protected]:26656"
3
addr_book_strict = false
4
unconditional_peer_ids (optional) = "014b6fa1fd8d14fa7e08c353497baa1f5581a089,bc806159212529879b42c737c2338042e396b1dd"
Copied!

2. Sentry node configuration

1
pex = true
2
unconditional_peer_ids = <validator node id>
3
persistent_peers = <validator nodes, optionally other sentry nodes>
4
private_peer_ids = <validator node ids>
5
addr_book_strict = false
6
external_address = <your-public-address. Eg: tcp://1.2.3.4:26656>
7
when starting, set flag --rpc.laddr tcp://0.0.0.0:26657
Copied!
Example:
1
pex = true
2
unconditional_peer_ids = "cc433de0f3d7e8e125ca40396e7cedb12a5d68bc"
3
persistent_peers = "[email protected]:26656"
4
private_peer_ids = "cc433de0f3d7e8e125ca40396e7cedb12a5d68bc"
5
addr_book_strict = false
6
external_address = "tcp://1.2.3.4:26656"
7
when starting: oraivisor start --rpc.laddr tcp://0.0.0.0:26657
Copied!
You should also set up firewalls for your genesis nodes.
Please join the Oraichain validators group on Telegram to discuss ideas and problems!