Skip to content

Commit

Permalink
add option usage
Browse files Browse the repository at this point in the history
  • Loading branch information
forfreeday committed Sep 8, 2021
1 parent 0b9e37e commit 3bdbc80
Showing 1 changed file with 95 additions and 19 deletions.
114 changes: 95 additions & 19 deletions shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ If you have already downloaded `java-tron`, you can use `start.sh` to run `java-

* `-c`

configuration file path,default loading of `config.conf`
load the specified path configuration file, default load the `config.conf` at the same level as `FullNode.jar`

* `-d`

database output directory, default path `output-directory`
specify the database storage path, The default is in the current directory where `FullNode.jar` is located

* `-j`

jar package path,default package name `FullNode.jar `
specify the directory where the program is located, default package name `FullNode.jar `

* `-mem`

Expand Down Expand Up @@ -70,8 +70,21 @@ If you have already downloaded `java-tron`, you can use `start.sh` to run `java-

### How to use

* Local mode
* Online mode

#### 1.local mode

Format:

```
sh start.sh [option]
```

```
sh start.sh [-j <jarName>] [-d <db database-directory>] [-c <configFile>] [[--run] | [--stop]]
```

**start service**

```
Expand All @@ -80,6 +93,8 @@ sh start.sh

or



```
sh start.sh --run
```
Expand All @@ -90,54 +105,115 @@ sh start.sh --run
sh start.sh --stop
```

**Limit boot memory size**

Use `-mem` parameter to set the maximum memory usage of `FullNode.jar`

#### 2.online mode

**Get the latest release**

Format:

```
sh start.sh -mem 12000
sh start.sh --release [option]
```

Physical memory size in MB, here 12000 means 12000MB Start the service with `start.sh`
Download the latest version of java-tron, demo:

#### 2.online mode
```
sh start.sh --release
```

**release**
contains the following files:

Download the latest version of java-tron
```
├── ...
├── FullNode/
├── config.conf
├── FullNode.jar
├── start.sh
```

Get the latest version up and running, demo:

```
sh start.sh --release --run
```

**clone code and build**

Get the latest code from master branch of https://github.com/tronprotocol/java-tron and compile download the latest release.

Format:

```
sh start.sh -cb [option]
```

demo:

```
sh start.sh -cb
```

contains the following files:

```
FullNode-|
\--config.conf
\--FullNode.jar
\--start.sh
├── ...
├── java-tron/
├── actuator/
├── chainbase/
├── common/
├── config/
├── consensus/
├── crypto/
├── docker/
├── docs/
├── example/
├── framework/
├── gradle/
├── plugins/
├── protocol/
├── config.conf
├── FullNode.jar
├── start.sh
├── README.md
├── ...
```

**clone and build**
Download the code and compile and run it

Get the latest code from master branch of https://github.com/tronprotocol/java-tron and compile download the latest release
demo:

```
sh start.sh -cb --run
```

After using this command, the FullNode directory will be created and the compiled file FullNode.jar and related configuration files will be copied to this directory

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



#### 3.rebuild manifest

This tool provides the ability to reformat the manifest according to the current database.

Format:

```
sh start.sh -d /tmp/db/database -m 128 -b 64000
sh start.sh [-m <manifest size>] | [-b <batch size>] | [-d <db database-directory>]
```

For more design details, please refer to: [TIP298](https://github.com/tronprotocol/tips/issues/298) | [Leveldb Startup Optimization Plugins](https://github.com/tronprotocol/documentation-en/blob/master/docs/developers/archive-manifest.md)

Demo

```
sh start.sh -d /tmp/db/database -m 128 -b 64000
```

For more design details, please refer to: [TIP298](https://github.com/tronprotocol/tips/issues/298) | [Leveldb Startup Optimization Plugins](https://github.com/tronprotocol/documentation-en/blob/master/docs/developers/archive-manifest.md)

0 comments on commit 3bdbc80

Please sign in to comment.