Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Make sure you operate on `Linux` or `MacOS` operating systems, other operating s
## Architecture

### x86_64
64-bit version of `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet.
64-bit version of `Oracle JDK 8` to be installed, other JDK versions are not supported yet.

### ARM64
64-bit version of `JDK 17` to be installed, other JDK versions are not supported yet.
Expand Down Expand Up @@ -98,7 +98,7 @@ Make sure you operate on `Linux` or `MacOS` operating systems, other operating s
## Architecture

### X86_64
Requires 64-bit version of `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet.
Requires 64-bit version of `Oracle JDK 8` to be installed, other JDK versions are not supported yet.

### ARM64
Requires 64-bit version of `JDK 17` to be installed, other JDK versions are not supported yet.
Expand All @@ -109,38 +109,32 @@ Get the mainnet configuration file: [config.conf](framework/src/main/resources/c

## Hardware Requirements

Minimum:

- CPU with 8 cores
- 16GB RAM
- 3TB free storage space to sync the Mainnet

Recommended:

- CPU with 16+ cores(32+ cores for a super representative)
- 32GB+ RAM(64GB+ for a super representative)
- High Performance SSD with at least 4TB free space
- 100+ MB/s download Internet service
| Deployment Tier | CPU Cores | Memory | High-performance SSD Storage | Network Downstream |
|-----------------|-----------|--------|----------------------------------|--------------------|
| FullNode (Minimum) | 8 | 16 GB | 200 GB ([Lite](https://tronprotocol.github.io/documentation-en/using_javatron/litefullnode/#lite-fullnode)) | ≥ 5 MB/s |
| FullNode (Stable) | 8 | 32 GB | 200 GB ([Lite](https://tronprotocol.github.io/documentation-en/using_javatron/litefullnode/#lite-fullnode))<br>3.5 TB (Full Sync) | ≥ 5 MB/s |
| FullNode (Recommended) | 16+ | 32 GB+ | 4 TB | ≥ 50 MB/s |
| Super Representative | 32+ | 64 GB+ | 4 TB | ≥ 50 MB/s |

## Running a full node for mainnet

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:

### x86_64 JDK 1.8
### x86_64 (JDK 8)
```bash
$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \
$ nohup java -Xms9G -Xmx12G -XX:ReservedCodeCacheSize=256m \
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
-XX:MaxDirectMemorySize=1G -XX:+PrintGCDetails \
-XX:+PrintGCDateStamps -Xloggc:gc.log \
-XX:+UseConcMarkSweepGC -XX:NewRatio=2 \
-XX:+UseConcMarkSweepGC -XX:NewRatio=3 \
-XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
-jar FullNode.jar -c main_net_config.conf >> start.log 2>&1 &
```
### ARM64 JDK 17
### ARM64 (JDK 17)
```bash
$ nohup java -Xms9G -Xmx9G -XX:+UseZGC \
$ nohup java -Xmx9G -XX:+UseZGC \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why delete -Xms9G for ZGC just for fullnode?
  2. If so, the same changes are required for SR and start.sh.sample

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in normal case FullNode don't need minimum 9G,as JDK 17 use RocksDB, which will take more space. It is not directly related with ZGC.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SR don't need change, as the minimum requirement for SR machine is 64G, so it does not matter. This remove Xms9G is used more for 16G machines.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I changed start.sh.sample

-Xlog:gc,gc+heap:file=gc.log:time,tags,level:filecount=10,filesize=100M \
-XX:ReservedCodeCacheSize=256m \
-XX:+UseCodeCacheFlushing \
Expand All @@ -151,6 +145,9 @@ $ nohup java -Xms9G -Xmx9G -XX:+UseZGC \
-jar FullNode.jar -c main_net_config.conf >> start.log 2>&1 &
```

> **Memory Tuning**
> - For 16 GB RAM servers: JDK 8 use `-Xms9G -Xmx12G`; JDK 17 use `-Xmx9G`.
> - For servers with ≥32 GB RAM, suggest setting the maximum heap size (`-Xmx`) to 40 % of total RAM.

## Running a super representative node for mainnet

Expand All @@ -166,19 +163,19 @@ Fill in the private key of a super representative address into the `localwitness

then run the following command to start the node:

### x86_64 JDK 1.8
### x86_64 (JDK 8)
```bash
$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \
$ nohup java -Xms9G -Xmx12G -XX:ReservedCodeCacheSize=256m \
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
-XX:MaxDirectMemorySize=1G -XX:+PrintGCDetails \
-XX:+PrintGCDateStamps -Xloggc:gc.log \
-XX:+UseConcMarkSweepGC -XX:NewRatio=2 \
-XX:+UseConcMarkSweepGC -XX:NewRatio=3 \
-XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
-jar FullNode.jar --witness -c main_net_config.conf >> start.log 2>&1 &
```
### ARM64 JDK 17
### ARM64 (JDK 17)
```bash
$ nohup java -Xms9G -Xmx9G -XX:+UseZGC \
-Xlog:gc,gc+heap:file=gc.log:time,tags,level:filecount=10,filesize=100M \
Expand All @@ -193,7 +190,7 @@ $ nohup java -Xms9G -Xmx9G -XX:+UseZGC \

## Quick Start Tool

### x86_64 JDK 1.8
### x86_64 (JDK 8)
An easier way to build and run java-tron is to use `start.sh`. `start.sh` is a quick start script written in the Shell language. You can use it to build and run java-tron quickly and easily.

Here are some common use cases of the scripting tool
Expand All @@ -204,7 +201,7 @@ Here are some common use cases of the scripting tool

For more details, please refer to the tool [guide](./shell.md).

### ARM64 JDK 17
### ARM64 (JDK 17)
You can refer to the [start.sh.simple](start.sh.simple).

```bash
Expand Down
2 changes: 1 addition & 1 deletion framework/src/main/resources/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ localwitness = [
block = {
needSyncCheck = true
maintenanceTimeInterval = 21600000 // 6 hours: 21600000(ms)
proposalExpireTime = 259200000 // 3 days: 259200000(ms)
proposalExpireTime = 259200000 // default value: 3 days: 259200000(ms), Note: this value is controlled by committee proposal
# checkFrozenTime = 1 // for test only
}

Expand Down
4 changes: 1 addition & 3 deletions start.sh.simple
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@


# adjust JVM start
# Set the minimum heap size to 9G, adjust as needed
VM_XMS="9G"
# Set the maximum heap size to 9G, adjust as needed
VM_XMX="9G"
# adjust JVM end
Expand Down Expand Up @@ -131,7 +129,7 @@ startService() {
fi

nohup "$JAVACMD" \
-Xms"$VM_XMS" -Xmx"$VM_XMX" \
-Xmx"$VM_XMX" \
-XX:+UseZGC \
-Xlog:gc,gc+heap:file=gc.log:time,tags,level:filecount=10,filesize=100M \
-XX:ReservedCodeCacheSize=256m \
Expand Down