Running a Theta Validator

1. Introduction

Theta is a permissionless blockchain, which means anyone can run a Validator node without approval from the Theta Labs. The Validator Nodes propose, vote for, and finalize new blocks in the chain, while Guardian Nodes seal blocks and act as a check on malicious or otherwise non-functional Validator Nodes.

Currently, the minimum staking requirement is 200K Theta. Meanwhile, there is a maximum of 31 validators that can run at one time. When there are more than 31 nodes staked as validators, only the 31 nodes with the highest number of THETA staked are eligible for proposing and voting for new blocks. The remainder nodes are candidates which neither propose nor vote for new blocks. Also, these candidates do NOT receive staking rewards. This limit can in theory be increased to ~100 before communications overhead becomes a barrier. After further testing and observation, the 31 node limit may be increased.

2. Hardware Specs

Recommended minimum Validator Node hardware specs:

Memory: 32GB RAM
CPU: 8 cores
Disk: 2TB SSD
Network: 200Mbps symmetric commercial network

Important Note: Please do NOT replicate/mirror the same validator (i.e. use the same private key for multiple nodes) on multiple machines. This is because multiple VN instances with the same private key may propose conflicting blocks for the same height, which is considered as a malicious behavior and may lead to penalty.

3. Setup A New Validator Node on Ubuntu Linux

3.1 Installation

We recommend running the validator node on Ubuntu Linux machines. If you are setting up a validator for the first time, please follow the instructions below to download the precompiled Linux binary and the necessary data. If you prefer to compile from the source code, please follow the steps here. If you are running the node on a Linux server, you'd need to run the node in a screen or tmux session, so that after you've logged off, the Theta node can continue to run.

screen -S theta_mainnet # if you run the node on a Linux server
mkdir ~/theta_mainnet
cd ~/theta_mainnet
mkdir bin
mkdir -p validator_mainnet/node
curl -k --output bin/theta `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=theta'`
curl -k --output bin/thetacli `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=thetacli'`
wget -O validator_mainnet/node/snapshot `curl -k https://mainnet-data.thetatoken.org/snapshot`
curl -k --output validator_mainnet/node/config.yaml `curl -k 'https://mainnet-data.thetatoken.org/config?is_guardian=true'`
chmod +x bin/theta
chmod +x bin/thetacli
cd bin/

3.2 Launch the Validator Node

Next, launch the Theta with the following commands.

ulimit -n 4096; ./theta start --config=../validator_mainnet/node

NOTE: When the Theta node launches for the first time, you need to choose a password to encrypt the signing key of the validator node. Please choose a secure password and keep it in a safe place. The next time when you restart the node, you will need the password to unlock it.

It might take some time for the node to sync up with the network (typically should be less than one hour). To check if the node is already in-sync with the network, you can execute the following command in another console:

./thetacli query status

The syncing field in the return indicates whether the node is still in the synchronization mode. If it is false, it means the node is already synced to the latest block.

3.3 Stake to the Validator Node

You can stake to a Theta Validator node through the Theta Web Wallet. On the staking tab, click on "Deposit Stake". Then, on the pop-up dialog, select "Validator Node" on the STAKE TYPE drop down menu. For VALIDATOR NODE HOLDER, fill in the validator address returned by the ./thetacli query status command. For THETA STAKE AMOUNT, enter the amount you would like to stake (at least 200,000 THETA). Then, click on the "Next" button to deposit the THETA stake.

4. Upgrades

Please pay close attention to the release page of the Theta blockchain repo. We will post the version number/hash and hardfork height (if any) there.

If you are running the validator node using the precompiled theta binary, simply stop the validator with Ctrl+C, and then run the following commands to download the latest theta and thetacli binary:

curl -k --output bin/theta `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=theta'`
curl -k --output bin/thetacli `curl -k 'https://mainnet-data.thetatoken.org/binary?os=linux&name=thetacli'`

If you are compiling the binaries from the source code, simply pull the latest code in the release branch and do make install.

Then, restart the validator node.

ulimit -n 4096; ./theta start --config=../validator_mainnet/node

Note that for upgrades, you do NOT need to download the snapshot like you did when setting up the validator for the first time. After the node is in sync, please run the following command to make sure that the version code printed matches with the version code on the Github release page:

./thetacli query version

Please upgrade the validator at your earliest convenience whenever a new version is released. Failing to do so might cause the validator to fall out of sync (especially for the hardforks), which may lead to potential penalty.