Binance Chain CLI is one of several ways to interact with Binance Chain.

Binance Chain CLI can be used as a local wallet, you can manage your keys via Binance CLI. You can add a new
key or restore your key from mnemonic words. And you can list your keys and show specified key info.

With Binance Chain CLI, you can send transactions to Binance Chain, like placing an order, transferring token,
issuing token and so on. Actually you can do almost everything you can do with Binance Chain web wallet. What is
more, you can propose to list trading pairs and join chain governance.

In addition, you can do some simple queries through CLI. For example, you can query your account's
balance, transaction detail by transaction hash and etc.

Once you have downloaded the binary for your platform, you may drop it into any folder you like. Open a terminal window or cmd.exe in that folder, and then follow the examples on the documentation site.

You can manage you keys locally without connecting to any node. But if you want to interact with Binance Chain, you need to connect to one of Binance Chain full nodes.

You can run your own full node, which may automatically connect to Binance Chain, and you can run your CLI there with your own full node. In the mean time, you can connect to any full nodes provided by other people.

chain-id is an important field to fill for every transaction sent from bnbcli. Thechain-id for mainnet is Binance-Chain-Tigris, and is Binance-Chain-Nile for testnet. Please choose the correct one in your case.

Before creating a new ledger key, make sure you have done these steps:
1. Ledger device is installed binance ledger app and the version should be later or equal to v1.1.3.
2. Connect your ledger device to your machine and input pin code to unlock it.
3. Open binanche ledger app on your ledger device.

bnbcli keys add test_ledger_key --ledger

Execute the above command to create a ledger key. The private key is only stored in your ledger device. And your local key store will save the corresponding publick key and address.

Note:there is one special flag --trust-node of most subcommands, if not enabled which is by default the CLI
will take an extra 2-4 seconds to verify blockchain proof at current height. You can enable that flag if the peer is trustful so that most commands will accomplish in 500 milliseconds. If your node cannot prove the transaction, there will be the following notice:

bnbcli will save data about validatorset changes at home of bnbcli. Once you want to use bnbcli for different blockchains, for example, you want to change from testnet to mainnet, the data will be stale. In order to swtich between blockchains, you need clean data folder rm -rf ~/.bnbcli/.bnblite/ or create a new home folder for bnbcli with --home flag.
If you forget to specify different home folder path, then you will not be able to make queries with bnbcli.