Skip to content

Commit 80f04d8

Browse files
authored
Merge pull request tronprotocol#4508 from halibobo1205/feature/optimization_readme
doc(readme): update Running java-tron
2 parents 2f20cf3 + 14cca93 commit 80f04d8

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ TRON is a project dedicated to building the infrastructure for a truly decentral
6363
TRON enables large-scale development and engagement. With over 2000 transactions per second (TPS), high concurrency, low latency, and massive data transmission. It is ideal for building decentralized entertainment applications. Free features and incentive systems allow developers to create premium app experiences for users.
6464

6565
# Building the source
66-
Building java-tron requires `git` and `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet. It is recommended to operate on `Linux` and `OSX` operating systems.
66+
Building java-tron requires `git` and `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet. Make sure you operate on `Linux` and `MacOS` operating systems.
6767

6868
## Getting the Source Code
6969

@@ -85,13 +85,33 @@ The `FullNode.jar` file can be found in `java-tron/build/libs/FullNode.jar` afte
8585

8686
Get the mainnet configurate file: [main_net_config.conf](https://github.com/tronprotocol/tron-deployment/blob/master/main_net_config.conf), other network configuration files can be find [here](https://github.com/tronprotocol/tron-deployment).
8787

88+
Running java-tron requires `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet. Make sure you operate on `Linux` and `MacOS` operating systems.
8889

89-
* **Running a full node for mainnet**
90+
## Hardware Requirements
91+
* Minimum:
92+
* CPU with 8 cores
93+
* 16GB RAM
94+
* 1TB free storage space to sync the Mainnet
95+
* Recommended:
96+
* CPU with 16+ cores(32+ cores for a super representative)
97+
* 32+ GB RAM(64+ GB for a super representative)
98+
* High Performance SSD with at least 1.5TB free space
99+
* 100+ MB/s download Internet service
100+
101+
102+
## Running a full node for mainnet
90103
Full node has full historical data, it is the entry point into the TRON network , it can be used by other processes as a gateway into the TRON network via HTTP and GRPC endpoints. You can interact with the TRON network through full node:transfer assets, deploy contracts, interact with contracts and so on. `-c ` parameter specifies a configuration file to run a full node:
91104
```bash
92-
$ java -jar FullNode.jar -c main_net_config.conf
105+
$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \
106+
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:MaxDirectMemorySize=1G \
107+
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log \
108+
-XX:+UseConcMarkSweepGC -XX:NewRatio=2 \
109+
-XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
110+
-XX:+HeapDumpOnOutOfMemoryError \
111+
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
112+
-jar FullNode.jar -c main_net_config.conf >> start.log 2>&1 &
93113
```
94-
* **Running a super representative node for mainnet**
114+
## Running a super representative node for mainnet
95115
Adding the `--witness` parameter to the startup command, full node will run as a super representative node. The super representative node supports all the functions of the full node and also supports block production. Before running, make sure you have a super representative account and get votes from others,once the number of obtained votes ranks in the top 27, your super representative node will participate in block production.
96116

97117
Fill in the private key of super representative address into the `localwitness` list in the `main_net_config.conf`, here is an example:
@@ -102,9 +122,16 @@ Get the mainnet configurate file: [main_net_config.conf](https://github.com/tron
102122
```
103123

104124
then run the following command to start the node:
105-
```bash
106-
$ java -jar FullNode.jar --witness -c main_net_config.conf
107-
```
125+
```bash
126+
$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \
127+
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:MaxDirectMemorySize=1G \
128+
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc.log \
129+
-XX:+UseConcMarkSweepGC -XX:NewRatio=2 \
130+
-XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
131+
-XX:+HeapDumpOnOutOfMemoryError \
132+
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
133+
-jar FullNode.jar --witness -c main_net_config.conf >> start.log 2>&1 &
134+
```
108135

109136
## Quick Start Tool
110137
An easier way to build and run java-tron is to use `start.sh`, `start.sh` is a quick start script written in shell language, you can use it to build and run java-tron quickly and easily.

0 commit comments

Comments
 (0)