docs
Search…
Dncli
dncli (dfinance node CLI) is a CLI application developed to work with dnode. With dncli you can query blockchain data, post transactions, and query network status.
It comes as binary application and can be downloaded from GitHub release page. Alternatively you can build it from sources.

Usage

After installing dncli, it should be configured:
1
dncli config chain-id dn-testnet
2
dncli config output json
3
dncli config indent true
4
dncli config trust-node true
5
dncli config compiler tcp://127.0.0.1:50051
6
dncli config node http://127.0.0.1:26657
7
dncli config keyring-backend file
Copied!
After configuring, you can try it:
1
dncli version
2
dncli --help
Copied!
dncli contains multiple commands for each dnode module.
There are two types of commands in dncli: transaction and query. Transaction commands start with tx prefix, query commands start with query prefix. Difference between them is that tx commands imply building and broadcasting transaction, whereas query simply queries data from dnode.
You can try it yourself and see available commands:
1
dncli tx --help
2
dncli query --help
3
4
dncli q --help # Short version of query.
Copied!
You can use --help option for any command, e.g.:
1
dncli tx vm --help
2
dncli tx vm execute --help
3
4
dncli q vm --help
5
dncli q vm compile --help
Copied!
In case, your VM transaction contains an error, you always can query detailed information about the happened error, check next command:
1
dncli q vm tx [txId]
Copied!

Mainnet configuration

dncli by default connects to local dnode (at localhost:26657) and compiler (inside dvm) (at localhost:50051). To connect to remote node or launched mainnet, change these configuration settings:
1
dncli config compiler tcp://pub.dfinance.co:50051
2
dncli config node https://rpc.dfinance.co:443
Copied!
Also, compiler address could be passed as --compiler option during execution of command requiring compilation, this is:
1
# use --help to see full list of options
2
dncli q vm compile <file> <account>
Copied!
Last modified 9mo ago