From 53afb2601bbc10d3ba59a5907bfe1dd5d3cc2049 Mon Sep 17 00:00:00 2001
From: YAaron <4241080+yuekun0707@users.noreply.github.com>
Date: Fri, 24 Jan 2025 18:01:54 +0800
Subject: [PATCH 1/5] merge main to develop (#20)
---
.github/workflows/codeql.yml | 2 +-
.pre-commit-config.yaml | 7 +-
tools/docker/docker.sh | 291 -----------------------------------
3 files changed, 5 insertions(+), 295 deletions(-)
delete mode 100644 tools/docker/docker.sh
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 81151e92..314c24a0 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -4,7 +4,7 @@ run-name: Lint sources
on:
push:
pull_request:
- branches: [main, develop]
+ branches: [main, develop, release_*]
jobs:
lint:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index adb36937..05fc6fee 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -8,17 +8,18 @@ repos:
- id: check-yaml
- id: double-quote-string-fixer
- id: check-shebang-scripts-are-executable
- exclude: tools/docker/docker.sh
- id: check-executables-have-shebangs
- id: detect-private-key
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
rev: 3.0.0
hooks:
- - id: shellcheck
- exclude: tools/docker/docker.sh
- id: script-must-have-extension
- id: git-dirty
- id: git-check
+ - repo: 'https://github.com/koalaman/shellcheck-precommit'
+ rev: v0.7.2
+ hooks:
+ - id: shellcheck
- repo: local # check java files format use a customized script
hooks:
- id: checkstyle
diff --git a/tools/docker/docker.sh b/tools/docker/docker.sh
deleted file mode 100644
index bf4961f0..00000000
--- a/tools/docker/docker.sh
+++ /dev/null
@@ -1,291 +0,0 @@
-#!/bin/bash
-#############################################################################
-#
-# GNU LESSER GENERAL PUBLIC LICENSE
-# Version 3, 29 June 2007
-#
-# Copyright (C) [2007] [TRON Foundation], Inc.
-# Everyone is permitted to copy and distribute verbatim copies
-# of this license document, but changing it is not allowed.
-#
-#
-# This version of the GNU Lesser General Public License incorporates
-# the terms and conditions of version 3 of the GNU General Public
-# License, supplemented by the additional permissions listed below.
-#
-# You can find java-tron at https://github.com/tronprotocol/java-tron/
-#
-##############################################################################
-
-BASE_DIR="/java-tron"
-DOCKER_REPOSITORY="tronprotocol"
-DOCKER_IMAGES="java-tron"
-# latest or version
-DOCKER_TARGET="latest"
-
-HOST_HTTP_PORT=8090
-HOST_RPC_PORT=50051
-HOST_LISTEN_PORT=18888
-
-DOCKER_HTTP_PORT=8090
-DOCKER_RPC_PORT=50051
-DOCKER_LISTEN_PORT=18888
-
-VOLUME=`pwd`
-CONFIG="$VOLUME/config"
-OUTPUT_DIRECTORY="$VOLUME/output-directory"
-
-CONFIG_PATH="/java-tron/config/"
-CONFIG_FILE="main_net_config.conf"
-MAIN_NET_CONFIG_FILE="main_net_config.conf"
-TEST_NET_CONFIG_FILE="test_net_config.conf"
-PRIVATE_NET_CONFIG_FILE="private_net_config.conf"
-
-# update the configuration file, if true, the configuration file will be fetched from the network every time you start
-UPDATE_CONFIG=true
-
-LOG_FILE="/logs/tron.log"
-
-JAVA_TRON_REPOSITORY="https://raw.githubusercontent.com/tronprotocol/java-tron/develop/"
-DOCKER_FILE="Dockerfile"
-ENDPOINT_SHELL="docker-entrypoint.sh"
-
-if test docker; then
- docker -v
-else
- echo "warning: docker must be installed, please install docker first."
- exit
-fi
-
-docker_ps() {
- containerID=`docker ps -a | grep "$DOCKER_REPOSITORY-$DOCKER_IMAGES" | awk '{print $1}'`
- cid=$containerID
-}
-
-docker_image() {
- image_name=`docker images |grep "$DOCKER_REPOSITORY/$DOCKER_IMAGES" |awk {'print $1'}| awk 'NR==1'`
- image=$image_name
-}
-
-download_config() {
- mkdir -p config
- if test curl; then
- curl -o config/$CONFIG_FILE -LO https://raw.githubusercontent.com/tronprotocol/tron-deployment/master/$CONFIG_FILE -s
- elif test wget; then
- wget -P -q config/ https://raw.githubusercontent.com/tronprotocol/tron-deployment/master/$CONFIG_FILE
- fi
-}
-
-
-check_download_config() {
- if [[ ! -d 'config' || ! -f "config/$CONFIG_FILE" ]]; then
- mkdir -p config
- if test curl; then
- curl -o config/$CONFIG_FILE -LO https://raw.githubusercontent.com/tronprotocol/tron-deployment/master/$CONFIG_FILE -s
- elif test wget; then
- wget -P -q config/ https://raw.githubusercontent.com/tronprotocol/tron-deployment/master/$CONFIG_FILE
- fi
- fi
-}
-
-run() {
- docker_image
-
- if [ ! $image ] ; then
- echo 'warning: no java-tron mirror image, do you need to get the mirror image?[y/n]'
- read need
-
- if [[ $need == 'y' || $need == 'yes' ]]; then
- pull
- else
- echo "warning: no mirror image found, go ahead and download a mirror."
- exit
- fi
- fi
-
- volume=""
- parameter=""
- tron_parameter=""
- if [ $# -gt 0 ]; then
- while [ -n "$1" ]; do
- case "$1" in
- -v)
- volume="$volume -v $2"
- shift 2
- ;;
- -p)
- parameter="$parameter -p $2"
- shift 2
- ;;
- -c)
- tron_parameter="$tron_parameter -c $2"
- UPDATE_CONFIG=false
- shift 2
- ;;
- --net)
- if [[ "$2" = "main" ]]; then
- CONFIG_FILE=$MAIN_NET_CONFIG_FILE
- elif [[ "$2" = "test" ]]; then
- CONFIG_FILE=$TEST_NET_CONFIG_FILE
- elif [[ "$2" = "private" ]]; then
- CONFIG_FILE=$PRIVATE_NET_CONFIG_FILE
- fi
- shift 2
- ;;
- --update-config)
- UPDATE_CONFIG=$2
- shift 2
- ;;
- *)
- echo "run: arg $1 is not a valid parameter"
- exit
- ;;
- esac
- done
- if [ $UPDATE_CONFIG = true ]; then
- download_config
- fi
-
- if [ -z "$volume" ]; then
- volume=" -v $CONFIG:/java-tron/config -v $OUTPUT_DIRECTORY:/java-tron/output-directory"
- fi
-
- if [ -z "$parameter" ]; then
- parameter=" -p $HOST_HTTP_PORT:$DOCKER_HTTP_PORT -p $HOST_RPC_PORT:$DOCKER_RPC_PORT -p $HOST_LISTEN_PORT:$DOCKER_LISTEN_PORT"
- fi
-
- if [ -z "$tron_parameter" ]; then
- tron_parameter=" -c $CONFIG_PATH$CONFIG_FILE"
- fi
-
- # Using custom parameters
- docker run -d -it --name "$DOCKER_REPOSITORY-$DOCKER_IMAGES" \
- $volume \
- $parameter \
- --restart always \
- "$DOCKER_REPOSITORY/$DOCKER_IMAGES:$DOCKER_TARGET" \
- $tron_parameter
- else
- if [ $UPDATE_CONFIG = true ]; then
- download_config
- fi
- # Default parameters
- docker run -d -it --name "$DOCKER_REPOSITORY-$DOCKER_IMAGES" \
- -v $CONFIG:/java-tron/config \
- -v $OUTPUT_DIRECTORY:/java-tron/output-directory \
- -p $HOST_HTTP_PORT:$DOCKER_HTTP_PORT \
- -p $HOST_RPC_PORT:$DOCKER_RPC_PORT \
- -p $HOST_LISTEN_PORT:$DOCKER_LISTEN_PORT \
- --restart always \
- "$DOCKER_REPOSITORY/$DOCKER_IMAGES:$DOCKER_TARGET" \
- -c "$CONFIG_PATH$CONFIG_FILE"
- fi
-}
-
-build() {
- echo 'docker build'
- if [ ! -f "Dockerfile" ]; then
- echo 'warning: Dockerfile not exists.'
- if test curl; then
- DOWNLOAD_CMD="curl -LJO "
- elif test wget; then
- DOWNLOAD_CMD="wget "
- else
- echo "Dockerfile cannot be downloaded, you need to install 'curl' or 'wget'!"
- exit
- fi
- # download Dockerfile
- `$DOWNLOAD_CMD "$JAVA_TRON_REPOSITORY$DOCKER_FILE"`
- `$DOWNLOAD_CMD "$JAVA_TRON_REPOSITORY$ENDPOINT_SHELL"`
- chmod u+rwx $ENDPOINT_SHELL
- fi
- docker build -t "$DOCKER_REPOSITORY/$DOCKER_IMAGES:$DOCKER_TARGET" .
-}
-
-pull() {
- echo "docker pull $DOCKER_REPOSITORY/$DOCKER_IMAGES:$DOCKER_TARGET"
- docker pull "$DOCKER_REPOSITORY/$DOCKER_IMAGES:$DOCKER_TARGET"
-}
-
-start() {
- docker_ps
- if [ $cid ]; then
- echo "containerID: $cid"
- echo "docker stop $cid"
- docker start $cid
- docker ps
- else
- echo "container not running!"
- fi
-}
-
-stop() {
- docker_ps
- if [ $cid ]; then
- echo "containerID: $cid"
- echo "docker stop $cid"
- docker stop $cid
- docker ps
- else
- echo "container not running!"
- fi
-}
-
-rm_container() {
- stop
- if [ $cid ]; then
- echo "containerID: $cid"
- echo "docker rm $cid"
- docker rm $cid
- docker_ps
- else
- echo "image not exists!"
- fi
-}
-
-log() {
- docker_ps
-
- if [ $cid ]; then
- echo "containerID: $cid"
- docker exec -it $cid tail -100f $BASE_DIR/$LOG_FILE
- else
- echo "container not exists!"
- fi
-
-}
-
-case "$1" in
- --pull)
- pull ${@: 2}
- exit
- ;;
- --start)
- start ${@: 2}
- exit
- ;;
- --stop)
- stop ${@: 2}
- exit
- ;;
- --build)
- build ${@: 2}
- exit
- ;;
- --run)
- run ${@: 2}
- exit
- ;;
- --rm)
- rm_container ${@: 2}
- exit
- ;;
- --log)
- log ${@: 2}
- exit
- ;;
- *)
- echo "arg: $1 is not a valid parameter"
- exit
- ;;
-esac
From 684764071854bc854c9150387d849762fe62f1aa Mon Sep 17 00:00:00 2001
From: YAaron <4241080+yuekun0707@users.noreply.github.com>
Date: Sun, 26 Jan 2025 09:09:06 +0800
Subject: [PATCH 2/5] merge main to develop (#21)
From d9d3475cfff454351f8029b317f69cb29e184cc8 Mon Sep 17 00:00:00 2001
From: abc-x-t
Date: Mon, 27 Jan 2025 11:05:05 +0800
Subject: [PATCH 3/5] fix doc error
---
.gitignore | 1 +
.pre-commit-config.yaml | 5 +----
CONTRIBUTING.md | 27 +++++++++++++++++----------
tools/docker/README.md | 2 +-
4 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/.gitignore b/.gitignore
index 153ddeb1..b52cbe9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ libs/
metric_monitor/datadir
private_net/datadir
tron-docker.iml
+bin/
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 05fc6fee..bcfcac31 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,13 +13,10 @@ repos:
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
rev: 3.0.0
hooks:
+ - id: shellcheck
- id: script-must-have-extension
- id: git-dirty
- id: git-check
- - repo: 'https://github.com/koalaman/shellcheck-precommit'
- rev: v0.7.2
- hooks:
- - id: shellcheck
- repo: local # check java files format use a customized script
hooks:
- id: checkstyle
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 333339c1..434f4c6c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,15 +3,22 @@
tron-docker is an open-source project designed to facilitate the usage of the TRON network. We understand that there is much left to be desired, and if you see any room for improvement, please let us know. Thank you. All contributed code will be covered by the [LGPLv3 license](https://github.com/tronprotocol/tron-docker/blob/main/LICENSE) of this project.
Here are some guidelines to get started quickly and easily:
-- [Before contribution](#Before-contribution)
-- [Contribute to tron-docker](#Contribute-to-tron-docker)
- - [Key Branches](#Key-Branches)
- - [Submitting Code Steps](#Submitting-Code-Steps)
- - [Commit Messages](#Commit-Messages)
- - [Branch Naming Conventions](#Branch-Naming-Conventions)
- - [Pull Request Best Practise](#Pull-request-best-practise)
- - [Special Situations And How To Deal With Them](#Special-Situations-And-How-To-Deal-With-Them)
-- [Conduct](#Conduct)
+- [Contributing](#contributing)
+ - [Before contribution](#before-contribution)
+ - [Ask a question](#ask-a-question)
+ - [Reporting an issue](#reporting-an-issue)
+ - [Request a feature](#request-a-feature)
+ - [Contribute to tron-docker](#contribute-to-tron-docker)
+ - [Key branches](#key-branches)
+ - [Submitting code steps](#submitting-code-steps)
+ - [Fork then make changes](#fork-then-make-changes)
+ - [Linting](#linting)
+ - [Push code](#push-code)
+ - [Commit messages](#commit-messages)
+ - [Branch naming conventions](#branch-naming-conventions)
+ - [Pull request best practise](#pull-request-best-practise)
+ - [Special situations and how to deal with them](#special-situations-and-how-to-deal-with-them)
+ - [Conduct](#conduct)
## Before contribution
@@ -94,7 +101,7 @@ Commit the new branch to your personal remote repository.
#### Linting
- tron-docker CI uses [pre-commit](https://pre-commit.com/) to lint all code within the repo. Add it to your local following the [installation](https://pre-commit.com/#installation). Check [.pre-commit-config.yaml](.pre-commit-config-fix.yaml) for existing validators.
+ tron-docker CI uses [pre-commit](https://pre-commit.com/) to lint all code within the repo. Add it to your local following the [installation](https://pre-commit.com/#installation). And ensure ShellCheck is also installed, refer to [installation](https://github.com/koalaman/shellcheck?tab=readme-ov-file#installing). Check [.pre-commit-config.yaml](.pre-commit-config-fix.yaml) for existing validators.
#### Push code
diff --git a/tools/docker/README.md b/tools/docker/README.md
index 4301ad76..1edbb7c2 100644
--- a/tools/docker/README.md
+++ b/tools/docker/README.md
@@ -7,7 +7,7 @@ If you encounter any problems during the build or testing process, please refer
Follow the [getting-started](https://github.com/tronprotocol/tron-docker/blob/main/README.md#getting-started) guide to download Docker and the tron-docker repository. Then, navigate to the gradlew directory.
```
-cd /java-tron/tools/gradlew
+cd ./tools/gradlew
```
Container testing uses the [Goss](https://github.com/goss-org/goss/blob/v0.4.9/README.md) tool, a YAML-based testing framework for validating service states. While no additional installation is required, it is beneficial to learn the basic usage of [Goss with container](https://goss.readthedocs.io/en/stable/container_image/) to help you better understand the following testing scripts.
From 55c1309a899e8b1cc488e93eb084b6b439843be3 Mon Sep 17 00:00:00 2001
From: 3for <287494524@qq.com>
Date: Thu, 6 Feb 2025 16:00:25 +0800
Subject: [PATCH 4/5] Rename upload image (#25)
* rename upload image
* rename default version
---
tools/docker/build.gradle | 25 ++-----------------------
1 file changed, 2 insertions(+), 23 deletions(-)
diff --git a/tools/docker/build.gradle b/tools/docker/build.gradle
index 77a98c5d..e3dd7de6 100644
--- a/tools/docker/build.gradle
+++ b/tools/docker/build.gradle
@@ -57,7 +57,7 @@ def buildTime() {
// set the shell command to use according to os
def shell = org.gradle.internal.os.OperatingSystem.current().isWindows() ? "${projectDir}\\wslsh.bat" : '/bin/bash'
-def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.getProperty('release.releaseVersion') : "${version}"
+def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.getProperty('release.releaseVersion') : "latest"
def dockerOrgName = project.hasProperty('dockerOrgName') ? project.getProperty("dockerOrgName") : "tronprotocol"
def dockerArtifactName = project.hasProperty("dockerArtifactName") ? project.getProperty("dockerArtifactName") : "java-tron"
def dockerImageName = "${dockerOrgName}/${dockerArtifactName}"
@@ -92,13 +92,6 @@ task sourceDocker {
}
}
-// Takes the version and if it contains SNAPSHOT, alpha, beta or RC in version then return true indicating an interim build
-def isInterimBuild(dockerBuildVersion) {
- return (dockerBuildVersion ==~ /.*-SNAPSHOT/) || (dockerBuildVersion ==~ /.*-alpha/)
- || (dockerBuildVersion ==~ /.*-beta/) || (dockerBuildVersion ==~ /.*-RC.*/)
- || (dockerBuildVersion ==~ /.*develop.*/)
-}
-
task testDocker {
dependsOn sourceDocker
@@ -121,25 +114,11 @@ task testDocker {
// Make sure to `docker login` first
task dockerUpload {
dependsOn sourceDocker
- def architecture = System.getenv('architecture')
- if (architecture == null) {
- architecture = "amd64" //set default as amd64
- }
def image = "${dockerImageName}:${dockerBuildVersion}"
- def additionalTags = []
-
- if (project.hasProperty('branch') && project.property('branch') == 'main') {
- additionalTags.add('develop')
- }
-
- if (!isInterimBuild(dockerBuildVersion)) {
- additionalTags.add(dockerBuildVersion.split(/\./)[0..1].join('.'))
- }
doLast {
exec {
- def archVariantImage = "${image}-${architecture}"
- def cmd = "docker tag '${image}' '${archVariantImage}' && docker push '${archVariantImage}'"
+ def cmd = "docker push '${image}'"
println "Executing '${cmd}'"
executable shell
args "-c", cmd
From 78f921f6bf21412dbc98a466790ce803ec572d7d Mon Sep 17 00:00:00 2001
From: Edward
Date: Fri, 7 Feb 2025 11:24:35 +0800
Subject: [PATCH 5/5] fix(doc): update readme (#27)
---
CONTRIBUTING.md | 2 +-
README.md | 57 +++++++++----------
conf/main_net_config.conf | 6 +-
conf/nile_net_config.conf | 4 +-
conf/private_net_config_others.conf | 8 +--
conf/private_net_config_witness1.conf | 2 +-
conf/private_net_config_witness2.conf | 4 +-
metric_monitor/README.md | 5 +-
metric_monitor/docker-compose.yml | 4 +-
.../grafana_dashboard_tron_server.json | 15 +++--
metric_monitor/metric_conf/prometheus.yml | 4 +-
private_net/README.md | 25 ++++----
private_net/docker-compose.yml | 32 +++++------
single_node/README.md | 39 +++++--------
tools/dbfork/README.md | 6 +-
15 files changed, 104 insertions(+), 109 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 434f4c6c..4e348419 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -155,7 +155,7 @@ Here is an example:
```
fix(private_net): update docker-compose
-1. fix docker-compose container tron_node1 command paramters, add more JVM GC flags
+1. fix docker-compose container tron-node1 command paramters, add more JVM GC flags
2. update the corresponding JVM flags explanation in README.md
Closes #1234
diff --git a/README.md b/README.md
index 10e4a6b5..c4473594 100644
--- a/README.md
+++ b/README.md
@@ -1,57 +1,54 @@
# TRON Docker
-This repository provides guidance and tools for the community to quickly get started with TRON network and development.
+This repository provides tools and guidance to help the community quickly get started with the TRON network and development.
## Features
-### Quick start for single FullNode
+### 🚀 Quick start for single FullNode
+Easily deploy a single TRON FullNode connected to **Mainnet** or **Nile testnet** using Docker. Follow the instructions to get your node up and running in minutes.
-This repository includes Docker configurations to quickly start a single TRON FullNode connected to the Mainnet or NileNet. Simply follow the instructions to get your node up and running in no time.
+### 🔗 Private chain setup
+Set up your own private TRON blockchain network for development and testing. The provided configurations simplify deployment and management, making it ideal for custom use cases.
-### Private chain setup
-
-You can also use this repository to set up a private TRON blockchain network. This is useful for development and testing purposes. The provided configurations make it straightforward to deploy and manage your own private chain.
-
-### Node monitoring with Prometheus and Grafana
-
-Monitoring the health and performance of your TRON nodes is made easy with integrated Prometheus and Grafana services. The repository includes configurations to set up these monitoring tools, allowing you to visualize and track various metrics in real time.
-
-### Tools
+### 📊 Node monitoring with Prometheus and Grafana
+Monitor the health and performance of your TRON nodes with integrated **Prometheus** and **Grafana** services. Real-time metrics and visualizations are just a few steps away.
+### 🛠️ Tools
We also provide tools to facilitate the CI and testing process:
-- Gradle Docker: Using Gradle to automate the build and test processes for java-tron image.
-- DB Fork: This tool helps launch a private Java-Tron network based on the state of the Mainnet database to support shadow fork testing.
+- **Gradle Docker**: Automate the build and testing of the `java-tron` Docker image using Gradle.
+- **DBFork**: Launch a private java-tron network based on the Mainnet database state, enabling shadow fork testing.
## Getting Started
### Prerequisites
-
- Docker
- Docker Compose
-### Installation
+### Start the services
+First clone the repository:
+
+```sh
+git clone https://github.com/tronprotocol/tron-docker.git
+cd tron-docker
+```
-1. **Clone the repository:**
- ```sh
- git clone https://github.com/tronprotocol/tron-docker.git
- cd tron-docker
- ```
+Then, navigate to the relevant directory and follow the instructions in the respective README to start the services:
+- **TRON network deployment related:**
+ - **Single FullNode**: Use the [single_node](./single_node) folder.
+ - **Private TRON network**: Use the [private_net](./private_net) folder.
+ - **Node monitoring**: Use the [metric_monitor](./metric_monitor) folder.
-2. **Start the services:**
- Navigate to the corresponding directory and follow the instructions in the respective README. Then you can easily start the services.
- - To start a single FullNode, use the folder [single_node](./single_node).
- - To set up a private TRON network, use the folder [private_net](./private_net).
- - To monitor the TRON node, use the folder [metric_monitor](./metric_monitor).
- - To use Gradle with Docker, check [gradle docker](./tools/docker/README.md).
- - To do shadow fork testing, check [db fork guidance](./tools/dbfork/README.md).
+- **Tools**:
+ - **Gradle Docker**: Automate Docker image builds and testing. Check the [gradle docker](./tools/docker/README.md) documentation.
+ - **DBFork**: Perform shadow fork testing. Follow the [DBFork guidance](./tools/dbfork/README.md).
## Troubleshooting
If you encounter any difficulties, please refer to the [Issue Work Flow](https://tronprotocol.github.io/documentation-en/developers/issue-workflow/#issue-work-flow), then raise an issue on [GitHub](https://github.com/tronprotocol/tron-docker/issues). For general questions, please use [Discord](https://discord.gg/cGKSsRVCGm) or [Telegram](https://t.me/TronOfficialDevelopersGroupEn).
-# Contributing
+## Contributing
All contributions are welcome. Check [contribution](CONTRIBUTING.md) for more details.
-# License
+## License
This repository is released under the [LGPLv3 license](https://github.com/tronprotocol/tron-docker/blob/main/LICENSE).
diff --git a/conf/main_net_config.conf b/conf/main_net_config.conf
index 671117b3..291dba2f 100644
--- a/conf/main_net_config.conf
+++ b/conf/main_net_config.conf
@@ -174,7 +174,7 @@ node {
isOpenFullTcpDisconnect = false
p2p {
- version = 11111 # 11111: mainnet; 20180622: testnet
+ version = 11111 # 11111: Mainnet; 20180622: Nile testnet
}
active = [
@@ -660,8 +660,8 @@ vm = {
}
committee = {
- allowCreationOfContracts = 0 //mainnet:0 (reset by committee),test:1
- allowAdaptiveEnergy = 0 //mainnet:0 (reset by committee),test:1
+ allowCreationOfContracts = 0 //Mainnet:0 (reset by committee),test:1
+ allowAdaptiveEnergy = 0 //Mainnet:0 (reset by committee),test:1
}
event.subscribe = {
diff --git a/conf/nile_net_config.conf b/conf/nile_net_config.conf
index 460adcc8..e53499db 100644
--- a/conf/nile_net_config.conf
+++ b/conf/nile_net_config.conf
@@ -516,8 +516,8 @@ vm = {
}
committee = {
- allowCreationOfContracts = 0 //mainnet:0 (reset by committee),test:1
- allowAdaptiveEnergy = 0 //mainnet:0 (reset by committee),test:1
+ allowCreationOfContracts = 0 //Mainnet:0 (reset by committee),test:1
+ allowAdaptiveEnergy = 0 //Mainnet:0 (reset by committee),test:1
}
event.subscribe = {
diff --git a/conf/private_net_config_others.conf b/conf/private_net_config_others.conf
index 8f70dbce..129cf2b2 100644
--- a/conf/private_net_config_others.conf
+++ b/conf/private_net_config_others.conf
@@ -96,7 +96,7 @@ node {
isOpenFullTcpDisconnect = true
p2p {
- version = 1 # 11111: mainnet; 20180622: testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
+ version = 1 # 11111: Mainnet; 20180622: Nile testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
}
active = [
@@ -198,9 +198,9 @@ seed.node = {
# "ip:port",
# ]
ip.list = [
- # used for docker deployment, to connect container named in tron_witness, defined in docker-compose.yml
- "tron_witness1:18888",
- #"tron_witness2:18888",
+ # used for docker deployment, to connect container named in tron-witness, defined in docker-compose.yml
+ "tron-witness1:18888",
+ #"tron-witness2:18888",
# used for local deployment
"127.0.0.1:18888"
diff --git a/conf/private_net_config_witness1.conf b/conf/private_net_config_witness1.conf
index f4688c64..d09cda69 100644
--- a/conf/private_net_config_witness1.conf
+++ b/conf/private_net_config_witness1.conf
@@ -96,7 +96,7 @@ node {
isOpenFullTcpDisconnect = true
p2p {
- version = 1 # 11111: mainnet; 20180622: testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
+ version = 1 # 11111: Mainnet; 20180622: Nile testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
}
active = [
diff --git a/conf/private_net_config_witness2.conf b/conf/private_net_config_witness2.conf
index 1c2dcb16..b1a50c07 100644
--- a/conf/private_net_config_witness2.conf
+++ b/conf/private_net_config_witness2.conf
@@ -96,7 +96,7 @@ node {
isOpenFullTcpDisconnect = true
p2p {
- version = 1 # 11111: mainnet; 20180622: testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
+ version = 1 # 11111: Mainnet; 20180622: Nile testnet; you can set other number when you deploy one private net, but the node must have the same number in some private net.
}
active = [
@@ -196,7 +196,7 @@ seed.node = {
# "ip:port"
# ]
ip.list = [
- "tron_witness1:18888",
+ "tron-witness1:18888",
]
}
diff --git a/metric_monitor/README.md b/metric_monitor/README.md
index c35518e9..69e8e211 100644
--- a/metric_monitor/README.md
+++ b/metric_monitor/README.md
@@ -19,7 +19,6 @@ Download the `tron-docker` repository, enter the `metric` directory, and start t
```sh
docker-compose up -d
```
-Then check the Docker resource settings to ensure it has at least 16GB of memory.
It will start a TRON FullNode that connects to the Mainnet, along with Prometheus and Grafana services. Note that in [main_net_config.conf](../conf/main_net_config.conf), it contains the configuration below to enable metrics.
```
metrics{
@@ -34,7 +33,7 @@ metrics{
The Prometheus service will use the configuration file [prometheus.yml](metric_conf/prometheus.yml). It uses the configuration below to add targets for monitoring.
```
- targets:
- - tron_node1:9527 # use container name
+ - tron-node1:9527 # use container name
labels:
group: group-tron
instance: fullnode-01
@@ -45,7 +44,7 @@ You can view the running status of the Prometheus service at `http://localhost:9
If you want to monitor more nodes, simply add more targets following the same format. Click on "Status" -> "Targets" to view the status of each monitored java-tron node.

-**Notice**: If you want to check metrics, please use `http://localhost:9527/metrics` on host machine instead of `http://tron_node1:9527/metrics`, as the latter is used for container access inside Docker.
+**Notice**: If you want to check metrics, please use `http://localhost:9527/metrics` on host machine instead of `http://tron-node1:9527/metrics`, as the latter is used for container access inside Docker.
### Grafana service
After startup, you can log in to the Grafana web UI through [http://localhost:3000/](http://localhost:3000/). The initial username and password are both `admin`. After logging in, change the password according to the prompts, and then you can enter the main interface.
diff --git a/metric_monitor/docker-compose.yml b/metric_monitor/docker-compose.yml
index 4d9b57c3..2619460c 100644
--- a/metric_monitor/docker-compose.yml
+++ b/metric_monitor/docker-compose.yml
@@ -1,8 +1,8 @@
version: '3.8'
services:
- tron_node1:
+ tron-node1:
image: tronprotocol/java-tron:latest
- container_name: tron_node1
+ container_name: tron-node1
networks:
- tron_network
deploy:
diff --git a/metric_monitor/metric_conf/grafana_dashboard_tron_server.json b/metric_monitor/metric_conf/grafana_dashboard_tron_server.json
index 32d27fdc..6631cf93 100644
--- a/metric_monitor/metric_conf/grafana_dashboard_tron_server.json
+++ b/metric_monitor/metric_conf/grafana_dashboard_tron_server.json
@@ -1479,17 +1479,22 @@
"pluginVersion": "11.4.0",
"targets": [
{
- "exemplar": true,
- "expr": " rate(tron:block_generate_latency_seconds_sum{group=`$group`,instance=`$instance`,sync =\"false\"}[$__interval])\n/\n rate(tron:block_generate_latency_seconds_count{group=`$group`,instance=`$instance`,sync =\"false\"}[$__interval])",
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": " rate(tron:block_generate_latency_seconds_sum{group=`$group`,instance=`$instance`}[$__interval])\n/\n rate(tron:block_generate_latency_seconds_count{group=`$group`,instance=`$instance`}[$__interval])",
+ "format": "time_series",
"hide": false,
- "interval": "1m",
- "legendFormat": "avg",
+ "interval": "12s",
+ "legendFormat": "__auto",
+ "range": true,
"refId": "B"
},
{
+ "editorMode": "code",
"exemplar": true,
- "expr": "histogram_quantile(0.99, sum(rate(tron:block_generate_latency_seconds_bucket{group=`$group`,instance=`$instance`,sync =\"false\"}[$__interval])) by (le))",
+ "expr": "histogram_quantile(0.99, sum(rate(tron:block_generate_latency_seconds_bucket{group=`$group`,instance=`$instance`}[$__interval])) by (le))",
"format": "time_series",
+ "hide": false,
"instant": false,
"interval": "1m",
"intervalFactor": 1,
diff --git a/metric_monitor/metric_conf/prometheus.yml b/metric_monitor/metric_conf/prometheus.yml
index bb432e2a..6de05fed 100644
--- a/metric_monitor/metric_conf/prometheus.yml
+++ b/metric_monitor/metric_conf/prometheus.yml
@@ -12,12 +12,12 @@ scrape_configs:
follow_redirects: true
static_configs:
- targets:
- - tron_node1:9527 # use container name
+ - tron-node1:9527 # use container name
labels:
group: group-tron
instance: fullnode-01
# - targets: # to add more fullnodes
-# - tron_node2:9527
+# - tron-node2:9527
# labels:
# group: group-tron
# instance: fullnode-01
diff --git a/private_net/README.md b/private_net/README.md
index c52f25cf..da5aa964 100644
--- a/private_net/README.md
+++ b/private_net/README.md
@@ -8,7 +8,7 @@ A private chain needs at least one fullnode run by a [Super Representative (SR)]
### Minimum hardware requirements
- CPU with 8+ cores
-- 32GB RAM
+- 16GB RAM
- 100GB free storage space
### Docker
@@ -18,7 +18,10 @@ 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 12GB of memory per TRON node.
+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**.
+
## Quick-Start using Docker
Download the folder [private_net](../private_net) from GitHub. Enter the directory and run the docker-composer.
@@ -30,7 +33,7 @@ A TRON private network will be started with one [SR](https://tronprotocol.github
Check the witness logs by running the command below:
```
-docker exec -it tron_witness1 tail -f ./logs/tron.log
+docker exec tron-witness1 tail -f ./logs/tron.log
```
Normally, it should show the witness initializing the database and network, then starting to produce blocks every 3 seconds.
```
@@ -47,7 +50,7 @@ Peer stats: channels 1, activePeers 1, active 0, passive 1
Check the other fullnode logs by running the command below:
```
-docker exec -it tron_node1 tail -f ./logs/tron.log
+docker exec tron-node1 tail -f ./logs/tron.log
```
After initialization, it should show messages about syncing blocks, just following the SR.
@@ -55,10 +58,10 @@ After initialization, it should show messages about syncing blocks, just followi
Check the docker-compose.yml, the two container services use the same TRON image with different configurations.
-- `ports`: Used in the tron_witness1 service are exposed for API requests to interact with the TRON private network.
+- `ports`: Used in the tron-witness1 service are exposed for API requests to interact with the TRON private network.
- `command`: Used for java-tron image start-up arguments.
- - `-jvm` is used for Java Virtual Machine parameters, which must be enclosed in double quotes and braces. `"{-Xmx16g -Xms12g}"` sets the maximum heap size to 16GB.
+ - `-jvm` is used for Java Virtual Machine parameters, which must be enclosed in double quotes and braces. `"{-Xmx12g -Xms3g}"` sets the maximum and minimum heap size to 12GB and 3GB.
- `-c` defines the configuration file to use.
- `-d` defines the database file to use. By mounting a local data directory, it ensures that the block data is persistent.
- `-w` means to start as a witness. You need to fill the `localwitness` field with private keys in the configuration file. Refer to [**Run as Witness**](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode-that-produces-blocks).
@@ -69,7 +72,7 @@ If you want to add more witness or other syncing fullnodes, you need to make bel
**Add more services in docker-compose.yml**
-Inside the docker-compose.yml, refer to the commented containers `tron_witness2` and `tron_node2`. Make sure the configuration files are changed accordingly, following the details below.
+Inside the docker-compose.yml, refer to the commented containers `tron-witness2` and `tron-node2`. Make sure the configuration files are changed accordingly, following the details below.
**Common settings**
@@ -77,7 +80,7 @@ For all configurations, you need to set `node.p2p.version` to the same value and
```
node {
p2p {
- version = 1 # 11111: mainnet; 20180622: nilenet; others for private networks.
+ version = 1 # 11111: Mainnet; 20180622: Nile testnet; others for private networks.
}
...
}
@@ -144,9 +147,9 @@ Then, in other configuration files, add witness `container_name:port` to connect
```
seed.node = {
ip.list = [
- # used for docker deployment, to connect containers in tron_witness defined in docker-compose.yml
- "tron_witness1:18888",
- "tron_witness2:18888",
+ # used for docker deployment, to connect containers in tron-witness defined in docker-compose.yml
+ "tron-witness1:18888",
+ "tron-witness2:18888",
...
]
}
diff --git a/private_net/docker-compose.yml b/private_net/docker-compose.yml
index d03857f6..14891f95 100644
--- a/private_net/docker-compose.yml
+++ b/private_net/docker-compose.yml
@@ -1,14 +1,14 @@
version: '3.8'
services:
- tron_witness1:
+ tron-witness1:
image: tronprotocol/java-tron:latest
- container_name: tron_witness1
+ container_name: tron-witness1
networks:
- tron_private_network
deploy:
resources:
limits:
- memory: 16g
+ memory: 12g
ports:
- "8090:8090" # for external http API request
- "50051:50051" # for external rpc API request
@@ -16,50 +16,50 @@ services:
- ../conf:/java-tron/conf
- ./datadir:/java-tron/data # mount a local directory to make the blocks data persistent.
command: >
- -jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_witness1.conf -d /java-tron/data -w
+ -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_witness1.conf -d /java-tron/data -w
- # tron_witness2:
+ # tron-witness2:
# image: tronprotocol/java-tron:latest
- # container_name: tron_witness2 # change container_name
+ # container_name: tron-witness2 # change container_name
# networks:
# - tron_private_network
# deploy:
# resources:
# limits:
- # memory: 16g
+ # memory: 12g
# volumes:
# - ../conf:/java-tron/conf
# command: >
- # -jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}"
+ # -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}"
# -c /java-tron/conf/private_net_config_witness2.conf
# -w
- tron_node1:
+ tron-node1:
image: tronprotocol/java-tron:latest
- container_name: tron_node1
+ container_name: tron-node1
networks:
- tron_private_network
deploy:
resources:
limits:
- memory: 16g
+ memory: 12g
volumes:
- ../conf:/java-tron/conf
command: >
- -jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_others.conf
+ -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}" -c /java-tron/conf/private_net_config_others.conf
-# tron_node2:
+# tron-node2:
# image: tronprotocol/java-tron:latest
-# container_name: tron_node2 # just need change container_name
+# container_name: tron-node2 # just need change container_name
# networks:
# - tron_private_network
# deploy:
# resources:
# limits:
-# memory: 16g
+# memory: 12g
# volumes:
# - ../conf:/java-tron/conf
# command: >
-# -jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}"
+# -jvm "{-Xmx12g -Xms3g -XX:+UseConcMarkSweepGC}"
# -c /java-tron/conf/private_net_config_others.conf
networks:
tron_private_network:
diff --git a/single_node/README.md b/single_node/README.md
index ac30be17..916107ae 100644
--- a/single_node/README.md
+++ b/single_node/README.md
@@ -41,25 +41,13 @@ Notice: To ensure your download has not been tampered with, you can use `docker
### Build from source code
-Building java-tron requires the git package. Clone the repository and switch to the master branch with the following commands:
-```
-git clone https://github.com/tronprotocol/java-tron.git
-cd java-tron
-git checkout -t origin/master
-```
-
-Then use the following command to navigate to the docker directory and start the build:
-```
-cd docker
-docker build -t tronprotocol/java-tron .
-```
-Check the Dockerfile for build details. Essentially, Docker will pull the java-tron repository and build it using JDK 1.8.
+Check [Gradlew Docker](../tools/docker/README.md) for instructions on building a Docker image from source code using Gradle.
## Run the container
You can run the following command to start java-tron:
```
-docker run -it --name tron -d --memory="16g" \
+docker run --name tron-node -d --memory="16g" \
-p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888:18888/udp -p 50051:50051 \
tronprotocol/java-tron
```
@@ -67,18 +55,19 @@ The `-p` flag specifies the ports that the container needs to map to the host ma
`--memory="16g"` sets the memory limit to 16GB, ensuring that the TRON container gets enough memory.
By default, it will use the [configuration](https://github.com/tronprotocol/java-tron/blob/develop/framework/src/main/resources/config.conf),
-which sets the fullNode to connect to the mainnet with genesis block settings in `genesis.block`.
+which sets the fullNode to connect to the Mainnet with genesis block settings in `genesis.block`.
Once the fullnode starts, it will begin to sync blocks with other peers starting from genesis block.
-Check the logs using command `docker exec -it tron tail -f ./logs/tron.log`. It will show the fullnode handshaking with peers successfully and then syncing for blocks.
+Check the logs using command `docker exec tron-node tail -f ./logs/tron.log`. It will show the fullnode handshaking with peers successfully and then syncing for blocks.
For abnormal cases, please check the troubleshooting section below.
### Run with customized configure
This image also supports customizing some startup parameters. Here is an example for running a FullNode as a witness with a customized configuration file:
```
-docker run -it --name tron -d -p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888:18888/udp -p 50051:50051 --memory="16g" \
- -v /host/path/java-tron/conf:/java-tron/conf \
- -v /host/path/java-tron/datadir:/java-tron/data \
+docker run --name tron-node -d -p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888:18888/udp -p 50051:50051 --memory="16g" \
+ -v /host/path/conf:/java-tron/conf \
+ -v /host/path/datadir:/java-tron/data \
+ -v /host/path/logs:/java-tron/logs \
tronprotocol/java-tron \
-jvm "{-Xmx16g -Xms12g -XX:+UseConcMarkSweepGC}" \
-c /java-tron/conf/config-localtest.conf \
@@ -86,16 +75,17 @@ docker run -it --name tron -d -p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888:
-w
```
The `-v` flag specifies the directory that the container needs to map to the host machine.
-In the example above, the host file `/host/path/java-tron/conf/config-localtest.conf` will be used. For example, you can refer to the java-tron [config-localtest](https://github.com/tronprotocol/java-tron/blob/develop/framework/src/main/resources/config-localtest.conf).
+In the example above, the host file `/host/path/conf/config-localtest.conf` will be used. For example, you can refer to the java-tron [config-localtest](https://github.com/tronprotocol/java-tron/blob/develop/framework/src/main/resources/config-localtest.conf).
+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}"`.
- `-c` defines the configuration file to use.
-- `-d` defines the database file to use. You can mount a directory for `datadir` with snapshots. Please refer to [**Lite-FullNode**](https://tronprotocol.github.io/documentation-en/using_javatron/backup_restore/#_5). This can save time by syncing from a near-latest block number.
+- `-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.
Inside the `config-localtest.conf` file `node.p2p.version` is used to set the P2P network id. Only nodes with the same network id can shake hands successfully.
-- TRON mainnet: node.p2p.version=11111
+- TRON Mainnet: node.p2p.version=11111
- Nile testnet: node.p2p.version = 201910292
- Private network:set to other values
@@ -103,7 +93,7 @@ Please note that if you want to switch to a different network, such as Mainnet o
- **Configuration File**:
- For Mainnet, use [main_net_config.conf](https://github.com/tronprotocol/tron-docker/blob/main/conf/main_net_config.conf).
- - For NileNet, use the configuration file available on this [page](https://nileex.io/join/getJoinPage) or [nile_net_config.conf](https://github.com/tronprotocol/tron-docker/blob/main/conf/nile_net_config.conf).
+ - For Nile Testnet, use the configuration file available on this [page](https://nileex.io/join/getJoinPage) or [nile_net_config.conf](https://github.com/tronprotocol/tron-docker/blob/main/conf/nile_net_config.conf).
The main differences between these two files are:
- `genesis.block`: Used for initial account asset and witness setup.
@@ -150,7 +140,8 @@ Response:
**Notice**: Before the local full node has synced with the latest block transactions, requests for account state or transaction information may be outdated or empty.
## Troubleshot
-After starting the Docker container, use `docker exec -it tron tail -f ./logs/tron.log` to check if the full node is functioning as expected and to identify any errors when interacting with the full node.
+After starting the Docker container, use `docker exec tron-node tail -f ./logs/tron.log` to check if the full node is functioning as expected and to identify any errors when interacting with the full node.
+If you go through the **Run with Customized Configuration** section, you can also directly open and check the locally mapped `tron.log` file.
If the following error cases do not cover your issue, please refer to [Issue Work Flow](https://tronprotocol.github.io/documentation-en/developers/issue-workflow/#issue-work-flow), then raise issue in [Github](https://github.com/tronprotocol/tron-docker/issues).
diff --git a/tools/dbfork/README.md b/tools/dbfork/README.md
index fee2cc6b..8d1ffd1b 100644
--- a/tools/dbfork/README.md
+++ b/tools/dbfork/README.md
@@ -1,6 +1,6 @@
## Database Fork Tool
Database fork tool can help launch a private java-tron FullNode or network based on the state of public chain database to support shadow fork testing.
-The public chain database can come from the Mainnet, Nile Testnet, or Shasta Testnet.
+The public chain database can come from the Mainnet, Nile or Shasta testnet.
Database fork tool provides the ability to modify the witnesses and other related data in the database to
implement shadow fork testing, which includes:
@@ -132,11 +132,11 @@ Launch the FullNode against the modified state. To launch the node smoothly, we
needSyncCheck = false
minParticipationRate = 0
minEffectiveConnection = 0
-node.p2p.version = 202501 // arbitrary number except for 11111(mainnet) and 20180622(testnet)
+node.p2p.version = 202501 // arbitrary number except for 11111(Mainnet) and 20180622(Nile testnet)
```
*Note*: please remember to comment `node.shutdown.BlockHeight` in the config if you have modified it previously.
-To isolate from the mainnet and other testnets, The `node.p2p.version` can be arbitrary number different from the mainnet and testnets.
+To isolate from the Mainnet and other testnets, The `node.p2p.version` can be arbitrary number different from the Mainnet and other testnets.
To produce the blocks, we also need to configure the private keys of the witness addresses in the config and run the FullNode with the `--witness` parameter, please refer [startup a fullnode that produces blocks](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode-that-produces-blocks).
```config