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    

Super Representative Full Node

Introduction

The following are steps for setting up a Super Representative (SR) Full Node. This is an essential step in becoming an SR candidate.

Guide Overview
This guide walks through the following steps in building the node:

  • Dependencies
  • Configuration Files
  • Initial Setup
  • Build the Node from IntelliJ IDEA
  • Mainnet Integration
  • Network Connection Verification
  • How to Stop the Node

Dependencies

Hardware Requirements
Full & Solidity Node Minimum Requirements

  • CPU: 16 Core
  • RAM: 32 GB
  • Bandwidth: 100 MB
  • Disk Space: 1 TB

Full & Solidity Node Recommended

  • CPU: 64+ Cores
  • RAM: 64+ GB

Java Environment

  • JDK 1.8 (JDK 1.9+ not yet supported)
  • On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure the machine has Oracle JDK 8, instead of Open JDK 8 in the system. Building the source code using Open JDK 8 results in Build Failed.

IDEs & Editors

Useful Tools

Configuration Files

The SR Full Node build process uses configuration files located in this GitHub repository. Please clone this repository for easy access as you go through the Node build process.

Initial Setup

Setting up Folders

Create directories for Full Node and Solidity Node in your working directory. Once the .jar files are downloaded, they will be moved into these folders.

Download the JAR files

Download the latest FullNode.jar and SolidityNode.jar files from the Odyssey Release link:

https://github.com/tronprotocol/java-tron/releases/latest

Download the FullNode.jar and SolidityNode.jar files.

Download the FullNode.jar and SolidityNode.jar files.

Move the .jar files into their respective full and solidity node directories.

Build the Node

Network Connection Verification

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

12:00:57.658 INFO  [pool-7-thread-1] [o.t.c.n.n.NodeImpl](NodeImpl.java:830) Success handle block Num:236610,ID:0000000000039c427569efa27cc2493c1fff243cc1515aa6665c617c45d2e1bf

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

Running a Private Testnet

Modify the config.conf file. This file is located in the directory /java-tron/build/resources/main/config.conf.

Modify witnesses under genesis.block to your own address:

Modify ip.list under seed.node to your own ip list:

On the first Super Node start, set needSyncCheck as false:

Under p2p, set version to 61:

Under rpc, add minEffectiveConnection and set to 0, the minimum effective connections configuration is for broadcasting transactions if you use v3.2.1 or above. Transactions can only be broadcast if the number of effective connections is reached in the config file.

Use the executable JAR. Add your private key under localwitness.

cd build/libs
java -jar java-tron.jar -p yourself private key --witness -c yourself config.conf

Example:

cd build/libs
java -jar java-tron.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf

In the Terminal run:

./gradlew run -Pwitness=true

In IntelliJ IDEA

  1. Open the configuration panel.

  2. In the Program arguments option, fill in --witness

  3. Run FullNode::main() again.

Running an SR Node

  • Use the executable JAR(Recommended way)
cd build/libs
java -jar java-tron.jar -p yourself private key --witness -c yourself config.conf(Example:/data/java-tron/config.conf)
Example:
java -jar java-tron.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf

It is almost the same as that does in the private testnet, except that the IPs in the config.conf are officially declared by TRON.

Super Representative Full Node


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.