Full Node

Run nodes on TRON MainNet

Test environment:

Operating system: macOS Mojave 10.14.2 8G 256G SSD
JDK 1.8 (Recommend using Oracle JDK version)

Recommended configuration:

  • CPU: 16 cores
  • Memory: 32G
  • Bandwidth: 100M
  • SSD: 500G or more

Deployment guide

1. Obtain FullNode.jar, Soliditynode.jar through compiling or release

a. Compile by downloading the source code

1). Create the code directory

mkdir -p /project/tron/

2). Download java tron ​​source code

cd /project/tron/
git clone -b master https://github.com/tronprotocol/java-tron.git

3). Compile the java-tron project

cd ./java-tron 
./gradlew build

b. Get the latest version of the jar package directly through release page

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

You need to download FullNode.jar and SolidityNode.jar.

Binary verification

📘

Note

All released files after 3.7 will provide signatures signed by the Tron Account: TKeAcHxgErbVXrG3N3TZiSV6AT566BHTj2.

You can verify the signature by tronweb.

const Trx = require('tronweb').Trx;

console.log(Trx.verifySignature(SHA256, ADDRESS, SIGNATURE));

Suppose we got a FullNode.jar with a SHA256 hash 2fca93b09da4ac62641e03838e77fce99b4711ddb0c09aa91656c80fc9556d2e, and a Tron signature 21435e32131feb6d00ba8048df04e112e02569ec851064d8ecad2d4dd5da44b7628ddce16823dadfff6fd683fc58cee74964970621a845ee459e2c96a750de551b.

To verify the integrity of the released file:

# First calculate the sha256 hash

sha256sum FullNode.jar  # or shasum -a 256 FullNode.jar (macOS)
# 2fca93b09da4ac62641e03838e77fce99b4711ddb0c09aa91656c80fc9556d2e  FullNode.jar

# Then check the signature

npm install -g tronweb
node -e 'console.log(require("tronweb").Trx.verifySignature(
    "2fca93b09da4ac62641e03838e77fce99b4711ddb0c09aa91656c80fc9556d2e",
    "TKeAcHxgErbVXrG3N3TZiSV6AT566BHTj2",
    "21435e32131feb6d00ba8048df04e112e02569ec851064d8ecad2d4dd5da44b7628ddce16823dadfff6fd683fc58cee74964970621a845ee459e2c96a750de551b"
  ))'
# true

# Now you've verified the integrity of the binary release file.

2. Configuration file

main_net_config.conf

3. Deploy Node

a. Start the node

🚧

Warning

Starting the node to synchronize data is slow. After downloading the recent data directly through the backup database, decompress it to the output-directory directory under the Tron project, and then synchronize. The backup database address can be clicked
[Backup Database] (https://backup.trongrid.io/).

nohup java -Xmx6g -XX:+HeapDumpOnOutOfMemoryError -jar FullNode.jar -c main_net_config.conf </dev/null &>/dev/null &

To start the super representative node, the command is as follows:

nohup java -XX:+UseConcMarkSweepGC -jar FullNode.jar  -p  private key --witness -c main_net_config.conf </dev/null &>/dev/null &

After the node is started, logs and output-directory will be generated on the sibling directory of java-tron.jar

  • logs: node log files
  • output-directory: node data storage directory

Command-line parameter description:

--witness: enable the witness function
--log-config: Specify the log configuration file path, i.e .: --log-config logback.xml
-c: Specify the configuration file path, i.e.: -c config.conf.

The use of the log file:

You can modify the level of the module to control the output of the log. The default level of each module is INFO. For example, printing only the information above the warning level of the network module, you can modify it as follows.

<logger name = "net" level = "WARN" />

📘

Note

  • Fullnode already supports the query of solidified blocks. By default, the solidity data can be queried through the walletsolidty / interface of port 8091, so there is no need to build a solidity node.
  • You can use the latest data for synchronization. https://backups.trongrid.io/

b. Stop the node

Use kill -15 to close the fullnode.jar or soliditynode.jar process.