Skip to main content

A command line tool to monitor and manage tron nodes.

Project description

TRON-CLI

 _________  ____  _  __    _______   ____
/_  __/ _ \/ __ \/ |/ /___/ ___/ /  /  _/
 / / / , _/ /_/ /    /___/ /__/ /___/ /  
/_/ /_/|_|\____/_/|_/    \___/____/___/

A command line tool, to quick set up, turn on/off (multiple) tron nodes(full/solidity), and monitor running status.

Python JDK
3.7+ 1.8

Install

pip

pip install --upgrade pip

pip install troncli

FAQs on installation

  1. How to fix "fail to build a wheel for psutil" error?

    a. please check if you installed clang correctly, or install it using homebrew:

    brew install --with-toolchain llvm
    

    b. please check if you are using python 3.x

  2. How to test in virtual environment?

    a. create virtual environment

    python3 -m venv venv
    

    b. activate venv

    . ./venv/bin/activate
    

    c. install troncli in venv

    pip install troncli
    

    d. when done testing, or using the venv - to deactivate venv

    deactivate
    

Usage

Command Functions Example1 Example2
tron-cli init --version Init dirs and fetch code. tron-cli init tron-cli init --version 3.1.3
tron-cli config --nettype --fullhttpport --solhttpport --fullgrpcport --solgrpcport Create and customize config files. tron-cli config tron-cli config --nettype main --fullhttpport 8500 --solhttpport 8600 --fullgrpcport 50051 --solgrpcport 5001
tron-cli run --nodetype Run node. tron-cli run tron-cli run --nodetype sol
tron-cli stop --pid Stop node. tron-cli stop tron-cli stop --pid 7777
tron-cli status --node Monitor nodes status. tron-cli status tron-cli status --node 777
tron-cli quick Quick start. tron-cli quick tron-cli quick
tron-cli -h, --help Check help manual. tron-cli -h tron-cli --help

overall

tron-cli -h
usage: tron-cli [-h] {init,config,run,stop,status,quick} ...

which subcommand do you want?

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  {init,config,run,stop,status,quick}
    init                Init dirs and fetch code.
    config              Create customize config files.
    run                 Run node.
    stop                Stop node.
    status              Monitor nodes status.
    quick               Quick start. (run a full private node by one command)
subcommand: init
tron-cli init -h
usage: tron-cli init [-h] [--version VERSION]

optional arguments:
  -h, --help         show this help message and exit
  --version VERSION  specify java-tron version
subcommand: config
tron-cli config -h
usage: tron-cli config [-h] [--nettype NETTYPE] [--fullhttpport FULLHTTPPORT]
                       [--solhttpport SOLHTTPPORT]
                       [--eventhttpport EVENTHTTPPORT]
                       [--fullrpcport FULLRPCPORT] [--solrpcport SOLRPCPORT]
                       [--eventrpcport EVENTRPCPORT]
                       [--enablememdb ENABLEMEMDB] [--dbsyncmode DBSYNCMODE]
                       [--saveintertx SAVEINTERTX]
                       [--savehistorytx SAVEHISTORYTX] [--gridport GRIDPORT]
                       [--dbname DBNAME] [--dbusername DBUSERNAME]
                       [--dbpassword DBPASSWORD]

optional arguments:
  -h, --help            show this help message and exit
  --nettype NETTYPE     specify net type [main, private]
  --fullhttpport FULLHTTPPORT
                        specify full node http port
  --solhttpport SOLHTTPPORT
                        specify solidity node http port
  --eventhttpport EVENTHTTPPORT
                        specify event node http port
  --fullrpcport FULLRPCPORT
                        specify full node rpc port
  --solrpcport SOLRPCPORT
                        specify solidity node rpc port
  --eventrpcport EVENTRPCPORT
                        specify event node rpc port
  --enablememdb ENABLEMEMDB
                        enable/disable in memory db
  --dbsyncmode DBSYNCMODE
                        specify either db async or sync mode
  --saveintertx SAVEINTERTX
                        enable/disable save internal transcation
  --savehistorytx SAVEHISTORYTX
                        enable/disable save history transcation
  --gridport GRIDPORT   specify grid api port
  --dbname DBNAME       specify db name
  --dbusername DBUSERNAME
                        specify db user name
  --dbpassword DBPASSWORD
                        specify db password name
subcommand: run
tron-cli run -h
usage: tron-cli run [-h] [--nodetype NODETYPE]

optional arguments:
  -h, --help           show this help message and exit
  --nodetype NODETYPE  specify node type [full, sol, event]
subcommand: stop
tron-cli stop -h
usage: tron-cli stop [-h] [--node NODE]

optional arguments:
  -h, --help   show this help message and exit
  --node NODE  stop node by given node id or all
subcommand: status
tron-cli status -h
usage: tron-cli status [-h] [--node NODE]

optional arguments:
  -h, --help   show this help message and exit
  --node NODE  check specific node detail by pid

Changelog

In doing

[ ] run - filter nodes

[ ] dump - fetch a dump

[ ] init - add option to build from source code

[ ] run - multiple (full) nodes

[ ] robust - catch more errors and provide better error msg

[ ] config -- add option to config to sync with newly deployed shasta testnet

[ ] status -- add config setting in status json

[ ] db - check and trim db

[ ] add more instruction in command

[ ] db - mongodb create db and set user name, user role, db name, and psd

[ ] improve stop/config/status according to feedback

[ ] build util method to store more info and provide for status

Version 0.2.0

highlight:

Support event-node and tron-grid set up/config/run/stop/monitor.

details:

[X] support java-tron 3.2.2 with more config

[X] add stop all feature

[X] update logo and change node list structure

[X] fix private net init account pk and address does not match

Version 0.1.6

[X] fix error on download progress bar when network not available

Version 0.1.5

highlight:

Pre-release of support event-node and tron-grid set up/config/run/stop/monitor.

details:

[X] init - change file structure for event-node and tron-grid

[X] init - add reset option and handler

[X] init - fetch event-node code

[X] init - fetch tron-grid code

[X] utils - make git_clone a util function

[X] utils - build util method to store more info and provide for status

[X] config - add options and handlers for event-node

[X] config - add options and handlers for tron-grid

[X] config - add event-node build and raise errors

[X] run - add event-node run

[X] run - fire up tron-grid

Version 0.1.4

[X] update to support version 3.2 fetch release, check version

[X] compatible check with version 3.2 release, and update config handler

[X] add more info message;

[X] provide a more neat yet detail help info and command

Version 0.1.3

[X] run - check single ps status

[X] keep track of all running nodes

[X] run - monitor overall system status

[X] set default value for all subcommand options

Version 0.1.2

[X] catch download errors

[X] add progress bar for download

[X] colorful logo and msg

[X] add more progress msg on ports config

[X] add more progress msg on net_type config

[X] add info msg type for instructions

[X] move changelog to file

[X] optimize progress bar

Version 0.1.0

[X] init - set up file folders, and get builds based on given version number

[X] config - init basic config file in json format, and convert to java properties format and export

[X] run - run a single main net full node

[X] quick start

[X] run - move 'run' to its handler, and async the call

[X] stop - add sub cmd and its handler to stop all nodes (kill -15)

[X] run - change log and data store location

[X] config - add custom method to fire up private/shasta testnet

[X] config - add custom method to change port number

[X] config - add custom method to fire up solidity node

[X] run - add option to run solidity node

[X] pack to pip

[X] Doc - add more instruction in readme file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

troncli-0.2.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

troncli-0.2.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file troncli-0.2.0.tar.gz.

File metadata

  • Download URL: troncli-0.2.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for troncli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 57c1c5784fb0e8894f83af4ed4a363c0c367aa2301939c33b73d5bdf048ba341
MD5 1f55497da7097499edcec85b5d8739fb
BLAKE2b-256 45443099570b07946739623a198b7fdb46a0709ede249805c05ff07fdb9d27dd

See more details on using hashes here.

File details

Details for the file troncli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: troncli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for troncli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 756e457485137622797ca2f181d5b067514b31f170bf2c5cd24898a7390cf802
MD5 24f9f26efdff27c7b0f0bfeae1e3e60a
BLAKE2b-256 a7f7178ea35d8e8420f7984b5dc5bb3160d6a43413d662470bd4424f6e58b995

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page