Install through Command Line

This page provides instructions to install a Guardian Node on a Linux server through the command line.

1. Install the guardian node

Please follow the instructions below to download the latest 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 guardian_mainnet/node
curl -k --output bin/theta `curl -k ''`
curl -k --output bin/thetacli `curl -k ''`
wget -O guardian_mainnet/node/snapshot `curl -k`
curl -k --output guardian_mainnet/node/config.yaml `curl -k ''`
chmod +x bin/theta
chmod +x bin/thetacli
cd bin/

The steps to install the binary on macOS (only supports 10.15.x catalina) and Windows are similar (on Windows you can use Cygwin, but make sure curl is installed). The only difference is that the os parameter for downloading the macOS and Windows binary are macos and windows, respectively.

2. Launch the guardian node

Now launch the Theta with the following commands.

ulimit -n 4096; ./theta start --config=../guardian_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 guardian 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 10 minutes). 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 lastest block.

3. Stake to the guardian node

After the node is synced (i.e. syncing is false), we can proceed with staking to make it a full Guardian Node. First we'd need the "fingerprint" of this node. In another console, execute the following command

./thetacli query guardian

The output should look something like this:

    "Address": "0x8f3B...E819",
    "BlsPubkey": "a1225b...16ebe",
    "BlsPop": "b49fd2a...d025c",
    "Signature": "14deb5e...52500",
    "Summary": "0x8f3Bc...952500"

The summary part is the "fingerprint" we need for staking. Next, please follow the steps here to stake some mainnet Theta tokens from the Theta Wallet. Each guardian staking transaction requires at least 1,000 Theta tokens.

If everything works out, this node will start to send out guardian votes for the checkpoint blocks (i.e. the blocks whose height%100 == 1). In a few minutes we should start to see guardian votes in the log.

[2019-10-10 10:01:46] DEBUG [guardian] Boardcasting guardian vote vote=AggregatedVotes{Block: 0xab2a360ed292a14bb675837d1b1fe26de87414bdd8b9838d8d3646ca2c004844, Gcp: 0xd717f1d2bbdf0d8314341afcb30dc0d7d5419914c59754158cfa7a830c9d4c74,  Multiplies: [1, 3, 0, ...., 1, 2]}

4. TFUEL earning

You can also see all of your TFUEL earnings earned by checking your wallet address in the Mainnet block explorer. Guardian Node TFUEL earnings are awarded every 100 blocks, or approximately every 10 minutes in a probabilistic method. At each 100 block checkpoint, there are 200–300 stakers randomly selected (weighted by their stake) to divide the block rewards. A large staker (ex. with 100K+ THETA stake) should expect to receive a reward every 2.5–3 hours or so (not guaranteed, just expectation). A 100K staker should have at least 98% likelihood to receive a reward every 10 hours. Conversely, a 1,000 THETA staker may only see a TFUEL reward once per month, analogous to a small Bitcoin miner with low hashrate. For the same block though, two stakers with the same stake may NOT receive the same amount of reward. While all nodes will earn TFUEL proportional to their stake over time, it means there can be significant variations in the timing and size of TFUEL rewards between different users.