TRON Developer Hub

The TRON Developer Hub

Welcome to the TRON developer hub. You'll find comprehensive guides and documentation to help you start working with TRON as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Solidity Node

Hardware Requirements
Full & Solidity Node Minimum Requirements

  • CPU: 16 Core
  • RAM: 32 G
  • Bandwidth: 100 M
  • Disk Space: 1 T

Full & Solidity Node Recommended

  • CPU: 64+ Cores
  • RAM: 64+ G

Initial Setup

Setting up Folders
In your desired directory, create the directory deploy and the sub-directory soliditynode. If you have already gone through the Full Node setup guide, you can create the soliditynode sub-directory in the same deploy directory.

First Steps

For the initial setup steps, follow the instructions for Full Node up until the Mainnet Integration step in order to build the Solidity Node. You can use either the executable script (Linux/MacOS only), the command line, or IntelliJ IDEA to build the node. If you have already followed the Full Node build process, then the executable SolidityNode.jar file is located in your java-tron/build/libs directory. Next, follow the below steps to deploy the Solidity Node.

Node Deployment

  1. Copy the SolidityNode.jar file into your /deploy/soliditynode directory. Download the config files from the Tron-Deployment github repository. The file main_net_config.conf is the mainnet config and test_net_config.conf is the testnet config file. Rename the file as config.conf, and store it as a replacement to the existing config.conf files located in java-tron/src/main/resources as well as java-tron/build/resources/main.

  2. Make the following modifications to the newly created config.conf file in order to connect it to the local FullNode: Modify trustNode in node to local 127.0.0.1:50051, which is the default rpc port:

  1. Set listen.port to any number within the range of 1024-65535. Please don't use any ports between 0-1024 since you'll most likely hit conflicts with other system services. Change rpc port to 50052 to avoid conflicts. Please forward the UDP port 18888 for FullNode.
rpc {
      port = 50052
    }
  1. Navigate to the /deploy/soliditynode directory. Run the SolidityNode using the following command:
java -jar SolidityNode.jar -c config.conf

Mainnet Integration

The Solidity Node supports both a gRPC Service and a HTTP Gateway on the ports specified in the configuration files. You can use either method to communicate with the nodes. Please refer to the HTTP APIs.

gRPC

gRPC uses Protobuf and the TRON protocol.

HTTP Gateway

The Full Node also offers an alternate RESTful HTTP Gateway. Below is a demo conversion between base58check and hexString:

Java: Transaction Sign Demo

PHP: TRX_CN PHP

Custom Integration

Take a look at the Common Patterns guide for some basic assistance.

Network Connection Verification

Logs for the Solidity Node are located in /deploy/\*/logs/tron.log. Use tail -f /logs/tron.log/ to follow along with the block syncing.

12:00:40.691 INFO  [pool-17-thread-1] [o.t.p.SolidityNode](SolidityNode.java:88) sync solidity block, lastSolidityBlockNum:209671, remoteLastSolidityBlockNum:2118

Stop Node

To stop the node gracefully, create a stop.sh file. Use kill -15 to close java-tron.jar, FullNode.jar, or SolidityNode.jar. You need to modify pid=ps -ef |grep java-tron.jar |grep -v grep |awk '{print $2}' to find the correct pid.

#!/bin/bash
count=1
while [ $count -le 60 ]; do
  pid=`ps -ef |grep java-tron.jar |grep -v grep |awk '{print $2}'`
  if [ -n "$pid" ]; then
    kill -15 $pid
    echo "kill -15 java-tron, counter $count"
    sleep 1
  else
    echo "java-tron killed"
    break
  fi
  count=$[$count+1]
  if [ $count -ge 60 ]; then
    kill -9 $pid
  fi
done

What's Next

SR Full Node