1.0.18 • Published 4 years ago

tw-eth-cli v1.0.18

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

How to use

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.

1. Install tw-eth-cli

npm install tw-eth-cli -g

2. config

default config path is ~/tw-eth-cli-config.js

configcomment
urlurl of web3.js
fromAddressfrom Address, used in transfer
toAddressto Address, used in transfer
fromAddressPKfrom Address private key, sign a transaction
contractAddresscontract address, used in callContract
rawdecode raw transaction
hashtransaction hash, used in getTx
passwordtransfer by personal account
moneyhow many tokens to transfer
abiabi of contract

3. Details, all commands

tw-eth-cli

4. Help

tw-eth-cli help <commmand>

tw-eth-cli <commmand> -h

5. Transfer ERC20

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

6. decode raw transaction

tw-eth-cli decode --config <config.js>

input raw, abi in config file. If you have abi, the data in raw can be decoded.

7. Get transaction by hash.

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.

8. Get block transactions.

tw-eth-cli getBlockTxs

default size is 100.

9. txpool, check pool status

tw-eth-cli pool -c status

tw-eth-cli pool -c content

tw-eth-cli pool -c inspect

-u ,replace url in config.

10. Verify signature.

tw-eth-cli recoverTx

11. Balance Of ETH and ERC20.

tw-eth-cli balanceOf -f <address>

12. Generate public key and address from private key.

tw-eth-cli inspect -k <privateKey>

13. Read Keystore.

tw-eth-cli keystore -f <key.json>

14. Transfer ETH.

tw-eth-cli transferEth -t <address> -m <money>

tw-eth-cli transferEthWithPassword -f <address> -t <address> -m <money>

15. Call Contract.

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>

16. Sign and verify

// 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>

17 Sign and return transaction

tw-eth-cli signRawTx -m <method> -p <parameters>

after get raw tx, you can use decode cmd to parse it.

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago