This package contains a set of tools for TRON, the followings are the documentation for each tool.
DB archive provides the ability to reformat the manifest according to the current database, parameters are compatible with the previous ArchiveManifest.
-b | --batch-size: Specify the batch manifest size, default: 80000.-d | --database-directory: Specify the database directory to be processed, default: output-directory/database.-m | --manifest-size: Specify the minimum required manifest file size, unit: M, default: 0.-h | --help: Provide the help info.
# full command
java -jar Toolkit.jar db archive [-h] [-b=<maxBatchSize>] [-d=<databaseDirectory>] [-m=<maxManifestSize>]
# examples
java -jar Toolkit.jar db archive #1. use default settings
java -jar Toolkit.jar db archive -d /tmp/db/database #2. specify the database directory as /tmp/db/database
java -jar Toolkit.jar db archive -b 64000 #3. specify the batch size to 64000 when optimizing manifest
java -jar Toolkit.jar db archive -m 128 #4. specify optimization only when Manifest exceeds 128MDB convert provides a helper which can convert LevelDB data to RocksDB data, parameters are compatible with previous DBConvert.
<src>: Input path for leveldb, default: output-directory/database.<dest>: Output path for rocksdb, default: output-directory-dst/database.-h | --help: Provide the help info.
# full command
java -jar Toolkit.jar db convert [-h] <src> <dest>
# examples
java -jar Toolkit.jar db convert output-directory/database /tmp/databaseDB copy provides a helper which can copy LevelDB or RocksDB data quickly on the same file systems by creating hard links.
<src>: Source path for database. Default: output-directory/database<dest>: Output path for database. Default: output-directory-cp/database-h | --help: provide the help info
# full command
java -jar Toolkit.jar db cp [-h] <src> <dest>
# examples
java -jar Toolkit.jar db cp output-directory/database /tmp/databseDB lite provides lite database, parameters are compatible with previous LiteFullNodeTool.
-o | --operate: [split,merge], default: split.-t | --type: Only used with operate=split: [snapshot,history], default: snapshot.-fn | --fn-data-path: The database path to be split or merged.-ds | --dataset-path: When operation issplit,dataset-pathis the path that store thesnapshotorhistory, when operation issplit,dataset-pathis thehistorydata path.-h | --help: Provide the help info.
# full command
java -jar Toolkit.jar db lite [-h] -ds=<datasetPath> -fn=<fnDataPath> [-o=<operate>] [-t=<type>]
# examples
#split and get a snapshot dataset
java -jar Toolkit.jar db lite -o split -t snapshot --fn-data-path output-directory/database --dataset-path /tmp
#split and get a history dataset
java -jar Toolkit.jar db lite -o split -t history --fn-data-path output-directory/database --dataset-path /tmp
#merge history dataset and snapshot dataset
java -jar Toolkit.jar db lite -o merge --fn-data-path /tmp/snapshot --dataset-path /tmp/historyDB move provides a helper to move some dbs to a pre-set new path. For example move block, transactionRetStore or transactionHistoryStore to HDD for reducing storage expenses.
-c | --config: config file. Default: config.conf.-d | --database-directory: database directory path. Default: output-directory.-h | --help: provide the help info
Take the example of moving block and trans.
Set path for block and trans.
storage {
......
properties = [
{
name = "block",
path = "/data1/tron",
},
{
name = "trans",
path = "/data1/tron",
}
]
......
}
Execute move command.
# full command
java -jar Toolkit.jar db mv [-h] [-c=<config>] [-d=<database>]
# examples
java -jar Toolkit.jar db mv -c main_net_config.conf -d /data/tron/output-directoryDB root provides a helper which can compute merkle root for tiny db.
NOTE: large db may GC overhead limit exceeded.
<src>: Source path for database. Default: output-directory/database--db: db name.-h | --help: provide the help info
Keystore provides commands for managing account keystore files (Web3 Secret Storage format).
Migrating from
--keystore-factory: The legacyFullNode.jar --keystore-factoryinteractive mode is deprecated. Use the Toolkit keystore commands below instead. The mapping is:
GenKeystore→keystore newImportPrivateKey→keystore import- (new)
keystore list— list all keystores in a directory- (new)
keystore update— change the password of a keystore
Generate a new keystore file with a random keypair.
# full command
java -jar Toolkit.jar keystore new [-h] [--keystore-dir=<dir>] [--password-file=<file>] [--sm2] [--json]
# examples
java -jar Toolkit.jar keystore new # interactive prompt
java -jar Toolkit.jar keystore new --keystore-dir /data/keystores # custom directory
java -jar Toolkit.jar keystore new --password-file pass.txt --json # non-interactive with JSON outputImport a private key into a new keystore file.
# full command
java -jar Toolkit.jar keystore import [-h] [--keystore-dir=<dir>] [--password-file=<file>] [--key-file=<file>] [--sm2] [--force] [--json]
# examples
java -jar Toolkit.jar keystore import # interactive prompt
java -jar Toolkit.jar keystore import --key-file key.txt --json # from file with JSON outputList all keystore files in a directory.
# full command
java -jar Toolkit.jar keystore list [-h] [--keystore-dir=<dir>] [--json]
# examples
java -jar Toolkit.jar keystore list # list default ./Wallet directory
java -jar Toolkit.jar keystore list --keystore-dir /data/keystores # custom directoryNote:
listdisplays theaddressfield as declared in each keystore JSON without decrypting the file. A tampered keystore can claim an address that does not correspond to its encrypted private key. The address is only cryptographically verified at decryption time (e.g. byupdateor by tools that load the credentials). Only trust keystores from sources you control.
Change the password of a keystore file.
# full command
java -jar Toolkit.jar keystore update [-h] <address> [--keystore-dir=<dir>] [--password-file=<file>] [--sm2] [--json]
# examples
java -jar Toolkit.jar keystore update TXyz...abc # interactive prompt
java -jar Toolkit.jar keystore update TXyz...abc --keystore-dir /data/ks # custom directoryWhen using --password-file with update, the file must contain exactly two lines: the current password on the first line and the new password on the second line. Both leading/trailing whitespace within a line is preserved (passphrases with spaces are supported).
--keystore-dir: Keystore directory, default:./Wallet.--password-file: Read password from a file instead of interactive prompt. Forkeystore update, the file must contain exactly two lines (current password, then new password).--key-file: Read the private key (hex, with or without0xprefix) from a file instead of the interactive prompt (keystore importonly).--force: Forkeystore import, allow importing a private key whose address already has a keystore in the directory (creates an additional file).--sm2: Use SM2 algorithm instead of ECDSA (fornewandimport).--json: Output in JSON format for scripting.-h | --help: Provide the help info.