Skip to content

Commit ec720c9

Browse files
committed
README.md
1 parent 854f072 commit ec720c9

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

README.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,46 @@ This crate can be used for the following purposes:
3838

3939
If you are considering using BDK in your own wallet project bdk-cli is a nice playground to get started with. It allows easy testnet and regtest wallet operations, to try out what's possible with descriptors, miniscript, and BDK APIs. For more information on BDK refer to the [website](https://bitcoindevkit.org/) and the [rust docs](https://docs.rs/bdk/latest/bdk/index.html)
4040

41-
`bdk-cli` can be compiled with different features to suit your experimental needs.
41+
###`bdk-cli` can be [compiled from source](#from-source) or [installed from crates.io](#from-crates) with different features to suit your experimental needs.
4242

43-
- Database Options
43+
### Features:
44+
45+
- Database
4446
- `key-value-db` : Sets the wallet database to a `sled` db.
4547
- `sqlite-db` : Sets the wallet database to a `sqlite3` db.
4648

47-
- Blockchain Options
49+
- Blockchain
4850
- `rpc` : Connects the wallet to bitcoin core via RPC.
4951
- `electrum` : Connects the wallet to an electrum server.
5052
- `esplora-ureq` or `esplora-reqwest` : Connects the wallet to an esplora server synchronously or asynchronously.
5153

52-
- Extra Utility Tools
53-
- `repl` : use `bdk-cli` as a [REPL](https://codewith.mu/en/tutorials/1.0/repl) shell (useful for quick manual testing of wallet operations).
54-
- `compiler` : opens up `bdk-cli` policy compiler commands.
55-
- `verify` : uses `bitcoinconsensus` to verify transactions at every `sync` call of the wallet.
56-
- `reserves` : opens up `bdk-cli` **Proof of Reserves** operation commands using the [bdk-reserves plugin](https://github.com/bitcoindevkit/bdk-reserves). (requires the `electrum` feature)
54+
### Additional Features:
55+
56+
- `repl` : use `bdk-cli` as a [REPL](https://codewith.mu/en/tutorials/1.0/repl) shell (useful for quick manual testing of wallet operations).
57+
58+
- `compiler` : opens up `bdk-cli` policy compiler commands.
59+
60+
- `verify` : uses `bitcoinconsensus` to verify transactions at every `sync` call of the wallet.
61+
62+
- `reserves` : opens up `bdk-cli` **Proof of Reserves** operation commands using the [bdk-reserves plugin](https://github.com/bitcoindevkit/bdk-reserves). (requires the `electrum` feature)
5763

5864
- Automated Node Backend
5965
- `regtest-bitcoin` : Auto deploys a regtest `bitcoind` node, connects the wallet, and exposes core rpc commands via `bdk-cli node` subcommands.
6066
- `regtest-electrum` : Auto deploys `electrsd` and connected `bitcoind` nodes, exposes core rpc commands via `bdk-cli node` and provides a wallet connected to the local `electrsd`.
6167

62-
The `default` feature set is `repl` and `sqlite-db`. With the `default` features, `bdk-cli` can be used as an **air-gapped** wallet, and can do everything that doesn't require a network connection.
68+
---
69+
70+
##### The `default` feature set is `repl` and `sqlite-db` and enables `bdk-cli` to be used as an **air-gapped** wallet, and doesn't require a network connection.
6371

72+
---
6473

6574
## Install bdk-cli
66-
### From source
75+
76+
### <a name="from-source"></a>From source
77+
6778
To install a dev version of `bdk-cli` from a local git repo with the `electrum` blockchain client enabled:
6879

69-
```shell
80+
```sh
7081
cd <bdk-cli git repo directory>
7182
cargo install --path . --features electrum
7283
bdk-cli help # to verify it worked
@@ -77,50 +88,56 @@ disabled. To enable these commands a blockchain client feature such as `electrum
7788
blockchain client feature must be enabled. Below is an example of how to run the `bdk-cli` binary with
7889
the `esplora-ureq` blockchain client feature.
7990

80-
```shell
91+
```sh
8192
RUST_LOG=debug cargo run --features esplora-ureq -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
8293
```
8394

8495
At most one blockchain feature can be enabled, available blockchain client features are:
8596
`electrum`, `esplora-ureq` (blocking), `esplora-reqwest` (async) and `rpc`.
8697

87-
### From crates.io
98+
### <a name="from-crates"></a>From crates.io
99+
88100
You can install the binary for the latest tag of `bdk-cli` with online wallet features
89101
directly from [crates.io](https://crates.io/crates/bdk-cli) with a command as below:
102+
90103
```sh
91104
cargo install bdk-cli --features electrum
92105
```
93106

107+
```sh
108+
cargo install bdk-cli --features electrum,compiler,...
109+
```
110+
94111
### bdk-cli bin usage examples
95112

96113
To get usage information for the `bdk-cli` binary use the below command which returns a list of
97114
available wallet options and commands:
98115

99-
```shell
116+
```sh
100117
cargo run
101118
```
102119

103120
To sync a wallet to the default electrum server:
104121

105-
```shell
122+
```sh
106123
cargo run --features electrum -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
107124
```
108125

109126
To sync a wallet to a Bitcoin Core node (assuming a regtest node at 127.0.0.1:18443) using the core rpc:
110127

111-
```shell
128+
```sh
112129
cargo run --features rpc -- --network regtest wallet --node 127.0.0.1:18443 --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
113130
```
114131

115132
To get a wallet balance with customized logging:
116133

117-
```shell
134+
```sh
118135
RUST_LOG=debug,sled=info,rustls=info cargo run -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" get_balance
119136
```
120137

121138
To generate a new extended master key, suitable for use in a descriptor:
122139

123-
```shell
140+
```sh
124141
cargo run -- key generate
125142
```
126143

@@ -130,7 +147,7 @@ This library should always compile with any valid combination of features on Rus
130147

131148
To build with the MSRV you will need to pin the below dependency versions:
132149

133-
```shell
150+
```sh
134151
# log 0.4.19 has MSRV 1.60.0
135152
cargo update -p log --precise 0.4.18
136153
# required for sqlite, hashlink 0.8.2 has MSRV 1.61.0
@@ -148,5 +165,13 @@ cargo update -p flate2 --precise 1.0.26
148165

149166
## Resources
150167
Docs: [bitcoindevkit.org CLI Section](https://bitcoindevkit.org/bdk-cli/installation/)
168+
151169
Episode on the _Bitcoin Developers Show_: [Youtube](https://www.youtube.com/watch?v=-Q8OD8NCEe4)
170+
171+
172+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/-Q8OD8NCEe4?si=fNROeKOWsiIO2UJV" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
173+
152174
Video Tutorials: [Youtube Playlist](https://www.youtube.com/playlist?list=PLmyfVqsSelG3jSobvpY3GoNKDtAumsrg3)
175+
176+
177+
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?si=vL_dMPX9j7H-t5mr&amp;list=PLmyfVqsSelG3jSobvpY3GoNKDtAumsrg3" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

0 commit comments

Comments
 (0)