|
| 1 | +# Toolkit Manual |
| 2 | + |
| 3 | +This package contains a set of tools for Tron, the following is the documentation for each tool. |
| 4 | + |
| 5 | +## DB Archive |
| 6 | + |
| 7 | +DB archive provides the ability to reformat the manifest according to the current `database`, |
| 8 | +parameters are compatible with previous `ArchiveManifest`. |
| 9 | + |
| 10 | +Parameter explanation: |
| 11 | + |
| 12 | +- `-b | --batch-size`: [int] specify the batch manifest size,default:80000. |
| 13 | +- `-d | --database-directory`: [string] specify the database directory to be processed,default:output-directory/database. |
| 14 | +- `-m | --manifest-size`: [int] specify the minimum required manifest file size ,unit:M,default:0. |
| 15 | +- `-h | --help`: provide the help info |
| 16 | + |
| 17 | +Demo: |
| 18 | + |
| 19 | +```shell script |
| 20 | +# full command |
| 21 | + java -jar Toolkit.jar db archive [-h] [-b=<maxBatchSize>] [-d=<databaseDirectory>] [-m=<maxManifestSize>] |
| 22 | +# examples |
| 23 | + java -jar Toolkit.jar db archive #1. use default settings |
| 24 | + java -jar Toolkit.jar db archive -d /tmp/db/database #2. Specify the database directory as /tmp/db/database |
| 25 | + java -jar Toolkit.jar db archive -b 64000 #3. Specify the batch size to 64000 when optimizing Manifest |
| 26 | + java -jar Toolkit.jar db archive -m 128 #4. Specify optimization only when Manifest exceeds 128M |
| 27 | +``` |
| 28 | + |
| 29 | + |
| 30 | +## DB Convert |
| 31 | + |
| 32 | +DB convert provides a helper which can convert LevelDB data to RocksDB data, parameters are compatible with previous `DBConvert`. |
| 33 | + |
| 34 | +Parameter explanation: |
| 35 | + |
| 36 | +- `<src>`: Input path for leveldb. Default: output-directory/database |
| 37 | +- `<dest>`: Output path for rocksdb. Default: output-directory-dst/database |
| 38 | +- `--safe`: In safe mode, read data from leveldb then put rocksdb, it's a very time-consuming procedure. If not, just change engine.properties from leveldb to rocksdb,rocksdb |
| 39 | + is compatible with leveldb for current version.This may not be the case in the future.Default: false |
| 40 | +- `-h | --help`: provide the help info |
| 41 | + |
| 42 | +Demo: |
| 43 | + |
| 44 | +```shell script |
| 45 | +# full command |
| 46 | + java -jar Toolkit.jar db convert [-h] [--safe] <src> <dest> |
| 47 | +# examples |
| 48 | + java -jar Toolkit.jar db convert output-directory/database /tmp/databse |
| 49 | +``` |
| 50 | + |
| 51 | + |
| 52 | +## DB Lite |
| 53 | + |
| 54 | +DB Lite provides lite database, parameters are compatible with previous `LiteFullNodeTool`. |
| 55 | + |
| 56 | +Parameter explanation: |
| 57 | + |
| 58 | +- `-o | --operate`: [split,merge]. Default: split. |
| 59 | +- `-t | --type`: only used with operate=split: [snapshot,history]. Default: snapshot. |
| 60 | +- `-fn | --fn-data-path`: the database path to be split or merged. |
| 61 | +- `-ds | --dataset-path`: when operation is `split`,`dataset-path` is the path that store the `snapshot` or `history`,when |
| 62 | + operation is `split`,`dataset-path` is the `history` data path. |
| 63 | +- `-h | --help`: provide the help info |
| 64 | + |
| 65 | +Demo: |
| 66 | + |
| 67 | +```shell script |
| 68 | +# full command |
| 69 | + java -jar Toolkit.jar db lite [-h] -ds=<datasetPath> -fn=<fnDataPath> [-o=<operate>] [-t=<type>] |
| 70 | +# examples |
| 71 | + #split and get a snapshot dataset |
| 72 | + java -jar Toolkit.jar db lite -o split -t snapshot --fn-data-path output-directory/database --dataset-path /tmp |
| 73 | + #split and get a history dataset |
| 74 | + java -jar Toolkit.jar db lite -o split -t history --fn-data-path output-directory/database --dataset-path /tmp |
| 75 | + #merge history dataset and snapshot dataset |
| 76 | + java -jar Toolkit.jar db lite -o split -t history --fn-data-path /tmp/snapshot --dataset-path /tmp/history |
| 77 | +``` |
| 78 | + |
| 79 | +## DB Move |
| 80 | + |
| 81 | +DB Move provides a helper to move some dbs to pre-set new path. For example move `block`, `transactionRetStore` or `transactionHistoryStore` to HDD,reduce storage expenses |
| 82 | + |
| 83 | +Parameter explanation: |
| 84 | + |
| 85 | +- `-c | --config`: config file. Default: config.conf. |
| 86 | +- `-d | --database-directory`: database directory path. Default: output-directory. |
| 87 | +- `-h | --help`: provide the help info |
| 88 | + |
| 89 | +Demo: |
| 90 | + |
| 91 | +Take the example of moving `block` and `trans` |
| 92 | + |
| 93 | +```conf |
| 94 | +storage { |
| 95 | + ...... |
| 96 | + properties = [ |
| 97 | + { |
| 98 | + name = "block", |
| 99 | + path = "/data1/tron", |
| 100 | + }, |
| 101 | + { |
| 102 | + name = "trans", |
| 103 | + path = "/data1/tron", |
| 104 | + } |
| 105 | + ] |
| 106 | + ...... |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +```shell script |
| 111 | +# full command |
| 112 | + java -jar Toolkit.jar db mv [-h] [-c=<config>] [-d=<database>] |
| 113 | +# examples |
| 114 | + java -jar Toolkit.jar db mv -c main_net_config.conf -d /data/tron/output-directory |
| 115 | +``` |
0 commit comments