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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ The java-tron project comes with several runnable artifacts and helper scripts f
| **`FullNode.jar`** | Main TRON node executable (generated in `build/libs/` after a successful build following the above guidance). Runs as a full node by default. `java -jar FullNode.jar --help` for command line options|
| **`Toolkit.jar`** | Node management utility (generated in `build/libs/`): partition, prune, copy, convert DBs; shadow-fork tool. [Usage](https://tronprotocol.github.io/documentation-en/using_javatron/toolkit/#toolkit-a-java-tron-node-maintenance-suite) |
| **`p2p-standalone.jar`** | Peer discovery, connection management and DNS-based node lists (generated in `build/libs/`). See the [p2p guide](./p2p/README.md). |
| **`start.sh`** | Quick start script (x86_64, JDK 8) to download/build/run `FullNode.jar`. See the tool [guide](./shell.md). |
| **`start.sh.simple`** | Quick start script template (ARM64, JDK 17). See usage notes inside the script. |
| **`start.sh`** | Quick start script to download/build/run `FullNode.jar` on x86_64 (JDK 8) and ARM64 (JDK 17). See the tool [guide](./shell.md). |

# Running java-tron

Expand Down Expand Up @@ -246,6 +245,7 @@ Thank you for considering to help out with the source code! If you'd like to con
pub: 1254 F859 D2B1 BD9F 66E7 107D F859 BCB4 4A28 290B
uid: build@tron.network
```
- `start.sh` only accepts release jars signed by this key, whose fingerprint is written into the script. This protects against tampered release files, but not against a compromise of this repository, which hosts both the script and the release files: a `start.sh` taken from a compromised repository could carry a different fingerprint.

# License

Expand Down
42 changes: 33 additions & 9 deletions shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ If you already downloaded the `FullNode.jar`, you can use `start.sh` to run it,

The script is available in the java-tron project at [github](https://github.com/tronprotocol/java-tron), or if you need a separate script: [start.sh](https://github.com/tronprotocol/java-tron/blob/develop/start.sh)

The script runs on x86_64 with JDK 8 and on ARM64 with JDK 17. It picks the JVM options for the Java version it finds, and downloads the release jars built for that architecture (`FullNode-aarch64.jar` on ARM64).

Downloaded release jars are verified against the GPG signature published with each release, made by the key listed under "Integrity Check" in the [README](./README.md), so `gpg` must be installed; a jar that fails verification is not used. The mainnet config is downloaded from java-tron and the Nile testnet config from [nile-testnet](https://github.com/tron-nile-testnet/nile-testnet).
Comment thread
SeriousCoding789 marked this conversation as resolved.

For each download the release key is fetched by its fingerprint from keys.openpgp.org, or from keyserver.ubuntu.com if the first server does not answer, so installing a release jar needs outbound HTTPS access (port 443) to one of these key servers. If neither can be reached, the signature cannot be checked and the downloaded jar is removed.

***

# Usage
Expand All @@ -32,6 +38,8 @@ The script is available in the java-tron project at [github](https://github.com/
sh start.sh --stop
```

`--run` records the process id in `<jar name>.pid` (`FullNode.jar.pid` by default) next to `start.log`, and `--stop` reads it. Run `--stop` in the directory the node was started from, with the same `-j` name if one was given. After `--release` or `-cb` the node runs in `FullNode/`; `--stop` finds it there from the parent directory as well. A node started by an earlier version of the script (a `start.log` but no pid file) is still found by its jar name.

* Get the latest version of `FullNode.jar` and start it

```
Expand All @@ -58,17 +66,21 @@ The script is available in the java-tron project at [github](https://github.com/

start the service

* `--stop`
* `--stop` or `-s`

stop the service started from the current directory

stop the service
* `--`

Everything after it is passed to `FullNode.jar` unchanged. Options the script does not know are passed on as well, so `--` is only needed when a value of such an option looks like a script option or a jar name.

* `-c`

Specify the configuration file, by default it will load the `config.conf` in the same directory as `FullNode.jar`
Specify the configuration file, by default it will load the `config.conf` in the current directory

* `-d`

Specify the database storage path, The default path is the same directory where `FullNode.jar` is located.
Specify the database storage path. The default is `output-directory` in the directory the script is run from (`FullNode/` after `--release` or `-cb`).

* `-j`

Expand All @@ -79,7 +91,7 @@ The script is available in the java-tron project at [github](https://github.com/
Specify the maximum memory of the `FullNode.jar` service in`MB`, jvm's startup maximum memory will be adjusted according to this parameter.

* `--net`
Select test and private networks.
Select test (Nile) and private networks.

### build project

Expand All @@ -91,6 +103,14 @@ The script is available in the java-tron project at [github](https://github.com/

Get the latest released version of the `jar` package from github.

* `--upgrade`

Replace the local `jar` package with the latest release; the previous one is kept as `FullNode.jar_bak`.

* `--download`

Download the latest released `jar` package into the current directory without starting it.


### rebuild the manifest

Expand All @@ -100,7 +120,7 @@ The script is available in the java-tron project at [github](https://github.com/

* `-m`

specify the minimum required manifest file size ,unit:M,default:0
specify the minimum required manifest file size ,unit:M,default:128

* `-b`

Expand Down Expand Up @@ -152,7 +172,7 @@ sh start.sh --stop
Format:

```
sh start.sh <[--release | -cb]> <--run> [-m <manifest size>] | [-b <batch size>] | [-d <db database-directory> | [-dr | --disable-rewrite-manifes]]
sh start.sh <[--release | -cb]> <--run> [-m <manifest size>] | [-b <batch size>] | [-d <db database-directory> | [-dr | --disable-rewrite-manifest]]
```

Get the latest released version.
Expand All @@ -162,13 +182,15 @@ Get the latest released version.
sh start.sh --release --run
```

Following file structure will be generated after executing the above command and the `FullNode.jar` will be started.
Following file structure will be generated after executing the above command and the `FullNode.jar` will be started. The node runs from `FullNode/`, so later `--run` commands are executed there with the copied script; `--stop` works both there and from the parent directory.

```
├── ...
├── FullNode/
├── config.conf
├── FullNode.jar
├── FullNode.jar.pid
├── start.log
├── start.sh
```

Expand Down Expand Up @@ -214,12 +236,14 @@ Following file structure will be created:
├── FullNode/
|── config.conf
├── FullNode.jar
├── FullNode.jar.pid
├── start.log
├── start.sh
```

### 3. rebuild manifest tool

This tool provides the ability to reformat the manifest based on current database, Enabled by default.
This tool provides the ability to reformat the manifest based on current database, Enabled by default. It applies to LevelDB only and is skipped on ARM64, which runs RocksDB.

1.Local mode:

Expand Down
Loading
Loading