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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ metric_monitor/datadir
private_net/datadir
tron-docker.iml
bin/
/single_node/output-directory/
/metric_monitor/logs/
/private_net/logs/
2 changes: 1 addition & 1 deletion metric_monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Please download and install the latest version of Docker from the official Docke
* Docker Installation for [Windows](https://docs.docker.com/docker-for-windows/install/)
* Docker Installation for [Linux](https://docs.docker.com/desktop/setup/install/linux/)

Then check the Docker resource settings to ensure it has at least 16GB of memory.
Then check the Docker resource settings to ensure it has at least 16GB of memory per FullNode container.

## Quick start
Download the `tron-docker` repository, enter the `metric` directory, and start the services defined in [docker-compose.yml](./docker-compose.yml) using the following command:
Expand Down
3 changes: 2 additions & 1 deletion metric_monitor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ services:
volumes:
- ../conf:/java-tron/conf
- ./datadir:/java-tron/data # mount a local directory to make the blocks data persistent.
- ./logs:/java-tron/logs
command: >
-jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC -XX:+PrintGC}" -c ./conf/main_net_config.conf -d /java-tron/data
-jvm "{-Xmx12g -Xmn2g -XX:+UseConcMarkSweepGC -XX:+PrintGC -Xloggc:./logs/gc.log }" -c ./conf/main_net_config.conf -d /java-tron/data

prometheus:
image: prom/prometheus:latest
Expand Down
2 changes: 1 addition & 1 deletion private_net/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Please download and install the latest version of Docker from the official Docke

Then check the Docker resource settings to ensure it has at least 3GB of memory per TRON node.

**Notice:** The actual memory consumption for a FullNode depends heavily on your configurations and use case. Factors such as block generation frequency, transactions per second (TPS), and external API request QPS can significantly impact memory usage. To help you get started quickly, the memory consumption under the following guidance should remain below **3GB**. However, for a TRON Mainnet Super Representative (SR) FullNode capable of supporting **2000 TPS**, the maximum memory consumption can reach up to **12GB**.
**Notice:** The actual memory consumption for a FullNode depends heavily on your configurations and use case. Factors such as block generation frequency, transactions per second (TPS), and external API request QPS can significantly impact memory usage. To help you get started quickly, the memory consumption under the following guidance is within **3GB**. However, for a TRON Mainnet Super Representative (SR) FullNode capable of supporting **2000 TPS**, the memory resource per FullNode container should set above **16GB**.


## Quick-Start using Docker
Expand Down
20 changes: 12 additions & 8 deletions private_net/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ services:
deploy:
resources:
limits:
memory: 12g
memory: 16g
ports:
- "8090:8090" # for external http API request
- "50051:50051" # for external rpc API request
volumes:
- ../conf:/java-tron/conf
- ./datadir:/java-tron/data # mount a local directory to make the blocks data persistent.
- ./logs/tron-witness1:/java-tron/logs # map to host logs
command: >
-jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_witness1.conf -d /java-tron/data -w
-jvm "{-Xmx12g -Xmn2g -XX:+UseConcMarkSweepGC -Xloggc:./logs/gc.log}" -c /java-tron/conf/private_net_config_witness1.conf -d /java-tron/data -w

# tron-witness2:
# image: tronprotocol/java-tron:latest
Expand All @@ -26,11 +27,12 @@ services:
# deploy:
# resources:
# limits:
# memory: 12g
# memory: 16g
# volumes:
# - ../conf:/java-tron/conf
# - ./logs/tron-witness2:/java-tron/logs
# command: >
# -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}"
# -jvm "{-Xmx12g -Xmn2g -XX:+UseConcMarkSweepGC -Xloggc:./logs/gc.log}"
# -c /java-tron/conf/private_net_config_witness2.conf
# -w
tron-node1:
Expand All @@ -41,11 +43,12 @@ services:
deploy:
resources:
limits:
memory: 12g
memory: 16g
volumes:
- ../conf:/java-tron/conf
- ./logs/tron-node1:/java-tron/logs
command: >
-jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_others.conf
-jvm "{-Xmx12g -Xmn2g -XX:+UseConcMarkSweepGC -Xloggc:./logs/gc.log}" -c /java-tron/conf/private_net_config_others.conf

# tron-node2:
# image: tronprotocol/java-tron:latest
Expand All @@ -55,11 +58,12 @@ services:
# deploy:
# resources:
# limits:
# memory: 12g
# memory: 16g
# volumes:
# - ../conf:/java-tron/conf
# - ./logs/tron-node2:/java-tron/logs
# command: >
# -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}"
# -jvm "{-Xmx12g -Xmn2g -XX:+UseConcMarkSweepGC -Xloggc:./logs/gc.log}"
# -c /java-tron/conf/private_net_config_others.conf
networks:
tron_private_network:
Expand Down
6 changes: 3 additions & 3 deletions single_node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please download and install the latest version of Docker from the official Docke
* Docker Installation for [Windows](https://docs.docker.com/docker-for-windows/install/)
* Docker Installation for [Linux](https://docs.docker.com/desktop/setup/install/linux/)

Then check the Docker resource settings to ensure it has at least 16GB of memory.
Then check the Docker resource settings to ensure it has at least 16GB of memory per FullNode container.

## Get Docker image
There are two ways to obtain the TRON image:
Expand Down Expand Up @@ -69,7 +69,7 @@ docker run --name tron-node -d -p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888
-v /host/path/datadir:/java-tron/data \
-v /host/path/logs:/java-tron/logs \
tronprotocol/java-tron \
-jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}" \
-jvm "{-Xmx12g -XX:+UseConcMarkSweepGC}" \
-c /java-tron/conf/config-localtest.conf \
-d /java-tron/data \
-w
Expand All @@ -79,7 +79,7 @@ In the example above, the host file `/host/path/conf/config-localtest.conf` will
Logs generated by docker container will be mapped to your `/host/path/logs`.

Flags after `tronprotocol/java-tron` are used for java-tron start-up arguments:
- `-jvm` used for java virtual machine, the parameters must be enclosed in double quotes and braces. `"{-Xmx16g -Xms12g}"` sets the maximum heap size to 16GB. If you want to set up a long run FullNode, please use the best practice jvm flags with `"{-Xmx16g -Xms12g 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:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70}"`.
- `-jvm` used for java virtual machine, the parameters must be enclosed in double quotes and braces. `"{-Xmx12g}"` sets the maximum heap size to 12GB. If you want to set up a long run FullNode, please use the best practice jvm flags with `"{-Xmx12g -Xmn2g 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:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70}"`.
- `-c` defines the configuration file to use.
- `-d` defines the database file to use. You can mount a directory for `datadir` with snapshots. This can save time by syncing from a near-latest block number. Please refer to [**Fullnode and Lite-Fullnode**](https://tronprotocol.github.io/documentation-en/using_javatron/backup_restore/#fullnode-data-snapshot) for Mainnet data. For the Nile testnet, you can download the snapshot [here](https://database.nileex.io/).
- `-w` means to start as a witness. You need to fill the `localwitness` field with private keys in configure file. Refer to the [**Run as Witness**](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode-that-produces-blocks). If you want to use keystore + password method, make sure the keystore is inside the mounted directory and remove `-d` to interact with console for password input.
Expand Down