Skip to content

Commit d7c7f87

Browse files
authored
fix(doc): fix trond tools guidance (#40)
1 parent 3cf5cfb commit d7c7f87

File tree

5 files changed

+81
-17
lines changed

5 files changed

+81
-17
lines changed

tools/trond/README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55

66
## Prerequisites
77
- Shell Environment: Required for running shell scripts.
8-
- Golang Build Environment: The [build_trond.sh](../../build_trond.sh) script will attempt to install the necessary Golang environment.
8+
- **Go Language (v1.21.4+)**
9+
- Official download: <https://go.dev/dl>
10+
- Note: If Go is not installed, the [build_trond.sh](../../build_trond.sh) script will attempt to install it automatically, but it is recommended to configure it manually in advance.
11+
- **Docker and Docker Compose**
12+
- Minimum version requirements:
13+
- Docker Engine ≥ 20.10.13
14+
- Docker Compose ≥ 1.29.2
15+
- Official installation guides: Check [prerequiesites](../../README.md#prerequisites)
16+
- **Python 3.11.0+**
17+
- Official download: <https://www.python.org/downloads/release/python-3110/>
918

1019
## Installation
1120

@@ -41,7 +50,7 @@ Now it supports the following commands:
4150
### Examples
4251
4352
Here we show examples of downloading the mainnet database snapshot, then deploy a java-tron node based on it.
44-
It is recommended to run these commands in `tron-docker` root directory.
53+
You need to run these commands in `tron-docker` root directory.
4554
4655
#### 1. Download the Mainnet database snapshot
4756
@@ -56,22 +65,41 @@ After the download completes, the database will be extracted to `./output-direct
5665
Notice: The snapshot is large(46G on 24-Jan-2025). It may take above 1 hour to finish. You could add `nohup` to make it continue running even after you log out of your terminal session.
5766
The full command will be `nohup ./trond snapshot download default-main &`
5867
59-
#### 2. Deploy a java-tron node on Mainnet
68+
#### 2. Check configure files
69+
Next, check the configuration files and Docker compose files required for deploying a node:
70+
```
71+
./trond node env
72+
```
73+
As running a mainnet node,
74+
you need file [docker-compose.fullnode.main.yml](../../single_node/docker-compose.fullnode.main.yml) and [main_net_config.conf](../../conf/main_net_config.conf).
75+
76+
#### 3. Deploy a java-tron node on Mainnet
6077
61-
Next, start a node connecting to the Mainnet:
78+
Then, start a node connecting to the Mainnet:
6279
6380
```
6481
./trond node run-single -t full-main
6582
```
6683
67-
This command will trigger execution of the [docker-compose](../../single_node/docker-compose.fullnode.main.yml). It will use the database at `./output-directory/mainnet/database`.
84+
This command will trigger execution of the [docker-compose](../../single_node/docker-compose.fullnode.main.yml).
85+
It will use the database at `./output-directory/mainnet/database` of the command trigger directory.
6886
If the directory is empty, the node will sync transaction data from the genesis block. If you don’t need the snapshot, you can skip the download step.
6987
7088
To view the node logs, you can access them at `./logs/mainnet`, or you can use the command `docker exec tron-node tail -f ./logs/tron.log`.
7189
72-
For more detailed usage instructions, refer to the help command or the [command documentation](./docs/trond.md).
90+
#### 4. Stop the java-tron node
91+
As java-tron service supports application shutdown with `kill -15`, which sends a `SIGTERM` signal to the application, allowing it to gracefully shut down. java-tron is also compatible with force shutdown using `kill -9`, which sends a `SIGKILL` signal.
92+
You could stop the node in multiple ways.
7393
94+
Here is an example of stopping the node using `trond`:
95+
```
96+
./trond node run-single stop -t full-main
97+
```
98+
99+
100+
For more detailed usage instructions, refer to the help command or the [command documentation](./docs/trond.md).
74101
75-
## Note
102+
## TroubleShooting
103+
If you have any issues starting a java-tron node, please refer to the corresponding [TroubleShooting](../../single_node/README.md#troubleshot) guide.
76104
77-
This tool has been tested on **macOS** and **Linux** only. If you encounter any issues, please report them on [GitHub](https://github.com/tronprotocol/tron-docker/issues).
105+
This tool has been tested on **macOS** and **Linux** only. If you encounter any other issues, please report them on [GitHub](https://github.com/tronprotocol/tron-docker/issues).

tools/trond/cmd/node/node.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,26 @@ var NodeCmd = &cobra.Command{
2828
# Help information for node command
2929
$ ./trond node
3030
31-
# Check and configure node local environment
31+
# Check and configure node local environment. Make sure run this first before starting the node.
3232
$ ./trond node env
3333
3434
# Run single java-tron fullnode for main network
3535
$ ./trond node run-single -t full-main
3636
37+
# Stop
38+
$ ./trond node run-single stop -t full-main
39+
3740
# Run single java-tron fullnode for nile network
3841
$ ./trond node run-single -t full-nile
3942
43+
# Stop
44+
$ ./trond node run-single stop -t full-nile
45+
4046
# Run single java-tron witness node for private network
4147
$ ./trond node run-single -t witness-private
48+
49+
# Stop
50+
$ ./trond node run-single stop -t witness-private
4251
`),
4352
}
4453

tools/trond/cmd/node/runSingle.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ var runSingleCmd = &cobra.Command{
3636
# Run single java-tron fullnode for main network
3737
$ ./trond node run-single -t full-main
3838
39+
# Stop
40+
$ ./trond node run-single stop -t full-main
41+
3942
# Run single java-tron fullnode for nile network
4043
$ ./trond node run-single -t full-nile
4144
45+
# Stop
46+
$ ./trond node run-single stop -t full-nile
47+
4248
# Run single java-tron witness node for private network
4349
$ ./trond node run-single -t witness-private
50+
51+
# Stop
52+
$ ./trond node run-single stop -t witness-private
4453
`),
4554
Run: func(cmd *cobra.Command, args []string) {
4655
if checkEnvFailed() {
@@ -95,14 +104,14 @@ var runSingleStopCmd = &cobra.Command{
95104
Long: heredoc.Doc(`
96105
The following configuration files are required:
97106
98-
- Configuration file(by default, these exist in the current repository directory)
99-
main network: ./conf/main_net_config.conf
100-
nile network: ./conf/nile_net_config.conf
101-
private network: ./conf/private_net_config_*.conf
102107
- Docker compose file(by default, these exist in the current repository directory)
103108
main network: ./single_node/docker-compose.fullnode.main.yml
104109
nile network: ./single_node/docker-compose.fullnode.nile.yml
105110
private network: ./single_node/docker-compose.witness.private.yml
111+
- Configuration file(by default, these exist in the current repository directory)
112+
main network: ./conf/main_net_config.conf, used by main network
113+
nile network: ./conf/nile_net_config.conf, used by nile network
114+
private network: ./conf/private_net_config_*.conf, used by private network
106115
`),
107116
Example: heredoc.Doc(`
108117
# Stop single java-tron fullnode for main network

tools/trond/docs/trond_node.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,21 @@ $ ./trond node env
3131
# Run single java-tron fullnode for main network
3232
$ ./trond node run-single -t full-main
3333
34+
# Stop
35+
$ ./trond node run-single stop -t full-main
36+
3437
# Run single java-tron fullnode for nile network
3538
$ ./trond node run-single -t full-nile
3639
40+
# Stop
41+
$ ./trond node run-single stop -t full-nile
42+
3743
# Run single java-tron witness node for private network
3844
$ ./trond node run-single -t witness-private
3945
46+
# Stop
47+
$ ./trond node run-single stop -t witness-private
48+
4049
```
4150

4251
### Options

tools/trond/docs/trond_node_run-single.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ You need to make sure the local environment is ready before running the node. Ru
88

99
The following files are required:
1010

11-
- Configuration file(by default, these exist in the current repository directory)
12-
main network: ./conf/main_net_config.conf
13-
nile network: ./conf/nile_net_config.conf
14-
private network: ./conf/private_net_config_*.conf
1511
- Docker compose file(by default, these exist in the current repository directory)
1612
main network: ./single_node/docker-compose.fullnode.main.yml
1713
nile network: ./single_node/docker-compose.fullnode.nile.yml
1814
private network: ./single_node/docker-compose.witness.private.yml
15+
- Configuration file(by default, these exist in the current repository directory)
16+
main network: ./conf/main_net_config.conf, used by main network
17+
nile network: ./conf/nile_net_config.conf, used by nile network
18+
private network: ./conf/private_net_config_*.conf, used by private network
1919

2020

2121
The following directory will be created after you start any type of java-tron fullnode:
@@ -34,12 +34,21 @@ trond node run-single [flags]
3434
# Run single java-tron fullnode for main network
3535
$ ./trond node run-single -t full-main
3636
37+
# Stop
38+
$ ./trond node run-single stop -t full-main
39+
3740
# Run single java-tron fullnode for nile network
3841
$ ./trond node run-single -t full-nile
3942
43+
# Stop
44+
$ ./trond node run-single stop -t full-nile
45+
4046
# Run single java-tron witness node for private network
4147
$ ./trond node run-single -t witness-private
4248
49+
# Stop
50+
$ ./trond node run-single stop -t witness-private
51+
4352
```
4453

4554
### Options

0 commit comments

Comments
 (0)