docs
  • Introduction
  • Getting started
    • Meet the network using CLI
    • Your first transaction
    • Run smart contract
    • Run your own node
    • Ledger Support
  • Architecture
    • Dnode
    • Dncli
    • XFI & Other coins
    • Fees & Gas
    • Addresses
  • Staking
    • Delegate sXFI & LPT
    • Become a validator
    • Rewards & Inflation
    • Slashing
    • More
  • Move VM
    • Modules
    • Scripts
    • Script Arguments
    • Standard Library
    • Events
    • Resources
    • Move Book
    • More
  • Oracles
    • Query Price
  • PegZone
    • Deposit
    • Usage
    • Withdraw
  • Useful Resources
    • Dfinance Website
    • Wallet
    • Move Book
    • Block Explorer
    • Swagger UI
    • Community
    • VSCode Move IDE
Powered by GitBook
On this page
  • Usage
  • Mainnet configuration

Was this helpful?

  1. Architecture

Dncli

PreviousDnodeNextXFI & Other coins

Last updated 4 years ago

Was this helpful?

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 . Alternatively you can .

Usage

After installing dncli, it should be configured:

dncli config chain-id dn-testnet
dncli config output json
dncli config indent true
dncli config trust-node true
dncli config compiler tcp://127.0.0.1:50051
dncli config node http://127.0.0.1:26657
dncli config keyring-backend file

After configuring, you can try it:

dncli version
dncli --help

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:

dncli tx --help
dncli query --help

dncli q --help # Short version of query.

You can use --help option for any command, e.g.:

dncli tx vm --help
dncli tx vm execute --help

dncli q vm --help
dncli q vm compile --help

In case, your VM transaction contains an error, you always can query detailed information about the happened error, check next command:

dncli q vm tx [txId]

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:

dncli config compiler tcp://pub.dfinance.co:50051
dncli config node https://rpc.dfinance.co:443

Also, compiler address could be passed as --compiler option during execution of command requiring compilation, this is:

# use --help to see full list of options
dncli q vm compile <file> <account>
GitHub release page
build it from sources