English / 中文
- This command wrapper web3.js and introduce simple cli commands to query balance and call contract with ETH, quorum, etc...
- Put long parameters in the config file, such as abi, private key, etc...
- The parameters fill in the console have a higher priority.
npm install tw-eth-cli -g
default config path is ~/tw-eth-cli-config.js
config | comment |
---|---|
url | url of web3.js |
fromAddress | from Address, used in transfer |
toAddress | to Address, used in transfer |
fromAddressPK | from Address private key, sign a transaction |
contractAddress | contract address, used in callContract |
raw | decode raw transaction |
hash | transaction hash, used in getTx |
password | transfer by personal account |
money | how many tokens to transfer |
abi | abi of contract |
tw-eth-cli
tw-eth-cli help <commmand>
tw-eth-cli <commmand> -h
tw-eth-cli transferWithPassword -t <address> -m <money>
transferWithPassword use accounts in the web3.eth.personal
tw-eth-cli transfer -t <address> -m <money>
this command design for ERC20, if you want to transfer ETH, please use transferEth
tw-eth-cli decode --config <config.js>
input raw, abi in config file. If you have abi, the data in raw can be decoded.
tw-eth-cli getTx --config <config.js>
You can config hash. abi in config file. If you have abi, the data in logs can be decoded.
tw-eth-cli getBlockTxs
default size is 100.
tw-eth-cli pool -c status
tw-eth-cli pool -c content
tw-eth-cli pool -c inspect
-u ,replace url in config.
tw-eth-cli recoverTx
tw-eth-cli balanceOf -f <address>
tw-eth-cli inspect -k <privateKey>
tw-eth-cli keystore -f <key.json>
tw-eth-cli transferEth -t <address> -m <money>
tw-eth-cli transferEthWithPassword -f <address> -t <address> -m <money>
tw-eth-cli callContract -m <method name> -p <parameter1>,<parameter2> --config <config file path>
tw-eth-cli callContractReturnValue -m <method name> -p <parameter1>,<parameter2> --config <config file path>
// sign
tw-eth-cli sign -m <message> -k <privateKey>
// verify
tw-eth-cli recover -m <message> -s <signature>
// get address and compare
tw-eth-cli inspect -k <privateKey>
tw-eth-cli signRawTx -m <method> -p <parameters>
after get raw tx, you can use decode cmd to parse it.