Skip to content

Commit 480a97e

Browse files
committed
Add "Java-tron New Version Deployment Manual"
1 parent 8851832 commit 480a97e

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Java-tron New Version Deployment Manual
2+
For the mandatory upgrade versions, please strictly follow this guide to deploy the new version. For the non-mandatory upgrade ones, you can decide whether to deploy it according to your needs.
3+
4+
Please directly refer to [Java-tron New version deployment Process](#new-version-deployment-process) to upgrade your node. If you have deployed 'Active and Backup nodes', please follow the process of [Active and Backup Nodes Upgrade Guide](#active-and-backup-nodes-upgrade-guide).
5+
6+
7+
## New version deployment Process
8+
Please follow the below steps to upgrade your FullNode, FullNode that produces blocks to the latest version.
9+
10+
### 1. Prepare the executable file of the new version
11+
12+
You can directly download the Java-tron executable file, or download the code of the latest version and compile it to get the executable file of the new version. Please download the latest version of the code or jar file to a file directory other than the Java-tron running directory:
13+
14+
* Way 1: Download the published executable file
15+
16+
Directly download the latest version of the executable file FullNode.jar from the release page [https://github.com/tronprotocol/java-tron/releases](https://github.com/tronprotocol/java-tron/releases).
17+
18+
Before using it, please verify the file signature first to ensure the consistency and integrity of the jar file. For the verification steps, please refer to [Java-tron Consistency Verification](https://tronprotocol.github.io/documentation-en/releases/).
19+
20+
21+
* Way 2: Compile the source code
22+
23+
Download the source code and switch to the branch of the new version.
24+
```
25+
$ git clone https://github.com/tronprotocol/java-tron.git
26+
$ git checkout -b relase_vx.x.x
27+
```
28+
29+
Compile the project: In the code directory of the new version, execute the following command to compile the project, and the compiled executable file will be generated in the `build/libs` directory.
30+
```
31+
$ ./gradlew clean build -x test
32+
```
33+
34+
35+
### 2. Shut down the Java-tron process
36+
Shut down the node process.
37+
38+
* First, get the process ID of the Java-tron node through the following command
39+
```
40+
$ ps -ef | grep java
41+
```
42+
43+
* Shut down the node process
44+
```
45+
$ kill -15 the process id
46+
```
47+
48+
49+
### 3. Backup
50+
Please back up the executable file, database, and configuration file before the upgrade in sequence. The backup data is used to restore to the old version when a problem is encountered that leads to fail deploying during the upgrade.
51+
52+
* Backup the current executable jar file
53+
```
54+
$ mv $JAVA_TRON.jar $JAVA_TRON.jar.`date "+%Y%m%d%H%M%S"`
55+
```
56+
* Backup the current database `output-directory`
57+
```
58+
$ tar cvzf output-directory.`date "+%Y%m%d%H%M%S"`.etgz output-directory
59+
```
60+
* Backup the current configuration file
61+
```
62+
$ mv $config.conf $config.conf.`date "+%Y%m%d%H%M%S"`
63+
```
64+
65+
66+
### 4. Replace old version files
67+
After preparing the executable file of the new version and backing up the original node data, please follow the steps below to replace the old files:
68+
69+
1. Copy the newest jar package obtained in the previous step to the Java-tron working directory to replace the old executable file.
70+
2. Replace the old configuration file with the latest configuration file. If you need to modify the configuration, such as adding a keystore file, private key, etc, please modify it yourself.
71+
72+
Note: For the database file, you can use the original database file in the Java-tron working directory, or you can choose to use [database backup snapshot](https://tronprotocol.github.io/documentation-en/using_javatron/backup_restore/#public-backup-data).
73+
74+
75+
### 5. Start the nodes
76+
The startup commands of FullNode which produces blocks and ordinary FullNode are different, please choose the startup command according to the actual situation:
77+
78+
* For the super representative's FullNode, the startup command is:
79+
```
80+
nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -p private key --witness -c main_net_config.conf </dev/null &>/dev/null &
81+
```
82+
Note: It is not necessary to use the above command parameter to set the private key. If you use the keystore file or configure the private key in the configuration file, please set it up your way.
83+
84+
* For a FullNode, the startup command is:
85+
```
86+
nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -c main_net_config.conf </dev/null &>/dev/null &
87+
```
88+
89+
### 6. Wait for syncing completion
90+
After the node is successfully started, please wait patiently for the node block synchronization to complete.
91+
### 7. Upgrade completed
92+
After the node is synchronized to the latest block of the network, it means that the deployment of the new version is completed.
93+
94+
If you encounter any problems during the upgrade leading to fail deploying the new version, please use the data backed up in the third step to restore to the old version, and give your feedback in GitHub or the community in time to help you complete the deployment of the new version as soon as possible.
95+
96+
97+
## Active and Backup Nodes Upgrade Guide
98+
To upgrade the active and backup nodes, please follow the steps below:
99+
100+
1. Upgrade the backup node
101+
102+
Upgrade the backup node according to the [Java-tron new version deployment Process](#new-version-deployment-process).
103+
104+
2. Shut down the master node
105+
106+
After the backup node is successfully upgraded to the new version, please wait for the completion of synchronization of the backup node before shutting down the master node. At this time, the backup node will automatically take over from the master node and become the active node.
107+
108+
3. Upgrade the master node
109+
110+
If the backup node works normally, follow [Java-tron New Version Deployment Process](#new-version-deployment-process) to upgrade the master node. Otherwise, shut down the backup node and start the master node. If an error occurs during the upgrade, please contact TRON technical support team and send the node’s log for root cause analysis.
111+
112+
4. Shut down the backup node
113+
114+
After the master node is upgraded and fully synchronized, shut down the backup node. After the backup node shuts down, the master node will take over as the active node again.
115+
116+
5. Start the backup node

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ nav:
4444
- What is Wallet-CLI: clients/wallet-cli.md
4545
- Wallet Commands: clients/wallet-cli-command.md
4646
- Releases:
47+
- New Version Deployment Manual: releases/upgrade-instruction.md
4748
- History:
4849
- GreatVoyage-v4.6.0: releases/GreatVoyage-v460.md
4950
- GreatVoyage-v4.5.2: releases/GreatVoyage-v452.md

0 commit comments

Comments
 (0)