Setup and Installation

Preparation

Install Go and set environment variables GOPATH , GOBIN, and PATH. The current code base should compile with Go 1.14.1 on a Linux like system (i.e. Ubuntu, Mac OS X). Below are the steps to install Go 1.14.1 and setup the environments on Ubuntu.

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install gcc
sudo apt-get install make
sudo apt-get install git
sudo apt-get install -y bzr
sudo apt-get install jq
sudo wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.14.1.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
echo 'export THETA_HOME=$GOPATH/src/github.com/thetatoken/theta' >> ~/.bashrc
source ~/.bashrc

Next, clone the release branch of the Theta Ledger repo https://github.com/thetatoken/theta-protocol-ledger into your $GOPATH with the following command. The path should look like this: $GOPATH/src/github.com/thetatoken/theta

git clone --branch release https://github.com/thetatoken/theta-protocol-ledger.git $GOPATH/src/github.com/thetatoken/theta

Special Note

the above command clones the release branch of the code base. The release branch has special settings for you to connect to the Theta Mainnet. If you instead want to connect to the Testnet, please clone the testnet branch. If you want to launch a local private net, please clone the privatenet branch.

Build and Install

Please execute the commands below. This should build the binaries and copy them into your $GOPATH/bin. Two binaries theta and thetacli are generated. theta can be regarded as the launcher of the Theta Ledger node, and thetacli is a wallet with command line tools to interact with the ledger.

export GO111MODULE=on
cd $THETA_HOME
make install