BDK CLI
Purpose
The bdk-cli
binary crate is designed as an experimental playground for users to dive into the BDK
libraries with ease.
Its documentation is available here, and you can explore the source code here.
Features
bdk-cli
can be compiled with different features to suit your experimental needs.
Database Options
sqlite
: Sets the wallet database to a sqlite3 db.sqlite
is a default feature.
Blockchain Options
rpc
: Connects the wallet to bitcoin core via RPC.electrum
: Connects the wallet to an electrum server.esplora
: Connects the wallet to an esplora server.cbf
: Connects the wallet to kyoto - a node and client for compact block filter based syncing.
Extra Utility Tools
repl
: use bdk-cli as a REPL shell (useful for quick manual testing of wallet operations).repl
is also a default feature.compiler
: opens up bdk-cli policy compiler commands.verify
: uses bitcoinconsensus to verify transactions at every sync call of the wallet.
These features are non-exhaustive as more features will be added.
Installation
You have the option to build bdk-cli
from its source code or install directly from crates.io
.
To build from the source:
To install from crates.io
, run this command:
Note that if no blockchain client feature is enabled, online wallet commands will be disabled.
Usage
To get usage information for the bdk-cli binary use the below command which returns a list of available wallet options and commands:
Follow the instruction in descriptors to generate descriptors, selecting your preferred network and descriptor type.
Assuming you exported your external and internal descriptors as EXT_DESC
and INT_DESC
, we can generate a new address by running the following command:
To sync the above wallet to a Bitcoin Core node (assuming a regtest node at 127.0.0.1:18443, username and password of bitcoin:bitcoin), run the following command:
To generate a new extended master key, suitable for use in a descriptor:
cargo run -- key generate