Small console toolset for getting information about Substrate nodes and working with smart contracts.
At the moment, implemented in Typescript. In future, it is going to be ported to Rust with usage of substrate-subxt.
Add yarn binaries folder into yout PATH:
echo "export PATH=$(yarn global bin):$PATH'" >> ~/.bashrc
source ~/.bashrc
Link binaries into yarn folder:
cd typescript
yarn install
yarn run tsc
./bind.sh
All binaries accept --url option for selecting node.
E.g. rpc-info --url $(cat kusama.url) will grab metadata from Kusama network.
By default, ws://127.0.0.1:9944 is used.
rpc-info: metadata and couple of other bits
rpc-events: log of emitted events
Any argument is treated as module name to filter events with.
It must be prefixed with + or - to determine mode of filtering.
Use --decode-bytes MyEvent or --decode-bytes [Event1 Event2 Event3]
to decode byte fields with UTF-8 encoded text into human-readable text.
rpc-balances: subscribe to balances changes
Provide a list of accounts to monitor, URIs like //Alice are also supported.
--evmfor monitoring EVM balances
rpc-blocks: log of produced blocks
--newfor subscribing to fresh blocks--oldfor dumping historical blocks--allfor both historical blocks and new ones--headerfor displaying headers instead of hashes--fullfor displaying full content of blocks--prettyfor pretty-printing jsons
rpc-transfer: transfer funds between accounts
Example: rpc-transfer //Alice 1DEV //Bob
rpc-contracts: uploading, instantiating and calling smart contracts
-s,--seed: specifies key to sign transactions-g,--gas: specifies gas limit for any supported operationdeployuploads contract code to the chain-f,--file: path to the codeinstantiateuses uploaded code and creates an instance of the contract-h,--hash: refers to the code stored on-chain-e,--endowment: amount to transfer with this operation-d,--data: SCALE-encoded data to transfer with this operationcallruns a method attached to the contract, possibly transfers funds as well-a,--address: address of the contract to call-e,--endowment: amount to transfer with this operation-d,--data: SCALE-encoded data to transfer with this operationinforetrieves information and all storage entries of the contract-a,--address: address of the contract to inspect
rpc-evm: creating/calling contracts and depositing/withdrawing EVM accounts
-s,--seed: specifies key to sign transactionscreateuploads contract code to the chain-f,--file: path to the code (you can use-cas well)-c,--code: hex-encoded code (you can use-fas well)-e,--endowment: amount to transfer with this operation-p,--price: gas price-g,--gas: gas limitcallruns a method attached to the contract, possibly transfers funds as well-a,--address: address of the contract to call-d,--data: data to transfer with this operation-e,--endowment: amount to transfer with this operation-p,--price: gas price-g,--gas: gas limitinforetrieves a single (so far) storage entry by its index-a,--address: address of the contract to inspect-i,--index: index of the entry to retrievedepositrefills EVM balance using Substrate balance-a,--amount: amount to depositwithdrawrefills Substrate balance using EVM balance-a,--amount: amount to withdrawselectoremits first 10 characters of Keccak hash,
use this with function signatures likeflip()
To remove binaries from PATH:
yarn unlink