How to set up a Tron MainNet Solidity Node on Ubuntu AWS Server

Published By: Sukanya Parashar


Tron solidity node is responsible for broadcasting validated and non-reversible transactions. This tutorial will make you learn to set up a Tron solidity node on the mainnet. Let us first go through the prerequisites.

Prerequisites:
Ubuntu 16.04 LTS AWS Server with minimum 16 CPUs, 64 GB RAM, 250GB Storage.

Update the Ubuntu server:

$ apt-get update
$ sudo apt-get upgrade

Install Oracle JDK on the Ubuntu server:
You will first need to install java runtime environment on the server. It is recommended to use Oracle JDK 8 for Tron node. Run the following commands -

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

There can be multiple JDK installations on the server. You can choose your version using this command -

$ sudo update-alternatives --config java

You can then choose the version you want to use. After the choosing the jdk version, you will need to set JAVA_HOME environment variable using this command -

$ sudo nano /etc/environment

Add the following at the end of the file -

JAVA_HOME=”/usr/lib/jvm/java-8-oracle/jre”

Make sure you put your own jdk path within the quotes. Then save and exit the file and reload it using this command -

$ source /etc/environment

You can check the environment variable by using this command -

$ echo $JAVA_HOME

Install screen:
You can install screen using the following command -

$ sudo apt-get update && sudo apt-get install screen -y

Download and run the script to deploy the node:
You can download the script from github using this command -

$ wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_tron.sh -0 deploy_tron.sh
$ bash deploy_tron.sh --app SolidityNode --net mainnet --trust-node <grpc-ip:grpc-port>
(You can configure your ip address and the grpc port)

Since the newer versions does not display the nodes running on the same screen, you will need to tail the logs to see the nodes syncing with the main network. Open another terminal and use these commands -

$ cd SolidityNode/logs
$ screen
$ tail -f tron.log

Now you can see the node syncing on the Tron mainnet !!!