You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- update wallet initialization to use `bdk-cli
wallet init` command directly and read walletopts
- update README for how to use the bdk-cli wallet
init command
- fix clippy warnings
[Issue: #192]
Copy file name to clipboardExpand all lines: README.md
+16-39Lines changed: 16 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,68 +195,45 @@ Note: You can modify the `Justfile` to reflect your nodes' configuration values.
195
195
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password balance
196
196
```
197
197
198
-
### Initializing a Wallet with `just`
198
+
### Initializing Wallet Configurations with `bdk-cli wallet init`
199
199
200
-
When using `bdk-cli`, repeatedly specifying parameter values for each command can be tedious. The `just` command allows you to initialize a wallet with configuration values once, saving them for reuse in subsequent `bdk-cli` commands.
201
-
This eliminate the need to provide repetitive arguments. To set up a wallet with persistent configuration values, use the following just command:
200
+
The `bdk-cli wallet init` command simplifies wallet setup by saving configuration parameters to `config.toml` in the data directory (default `~/.bdk-bitcoin/config.toml`). This allows you to run subsequent `bdk-cli` wallet commands without repeatedly specifying configuration details, easing wallet operations.
202
201
203
-
```shell
204
-
just init <wallet_name><ext_descriptor><int_descriptor><database_type><client_type><url><rpc_user><rpc_password> [--force]
205
-
```
206
-
The arguments must be provided in the order shown above. Replace each placeholder with the corresponding value:
207
-
208
-
> *`wallet_name`: The unique name for your wallet (e.g., my_wallet)
209
-
> *`ext_descriptor`: The external descriptor for generating receiving addresses (e.g., tr(tprv.../0/*)#checksum)
210
-
> *`int_descriptor`: The internal descriptor for generating change addresses (e.g., tr(tprv.../1/*)#checksum)
211
-
> *`database_type`: The database type for wallet persistence (e.g., sqlite). Defaults to `sqlite` if omitted
212
-
> *`client_type`: The blockchain backend (e.g., electrum, esplora, rpc, cbf)
213
-
> *`url`: The server URL for the blockchain backend (e.g., ssl://mempool.space:60602 for Electrum).
214
-
> *`rpc_user`: The RPC username for rpc client type (e.g., user). Defaults to user if omitted.
215
-
> *`rpc_password`: The RPC password for rpc client type (e.g., password). Defaults to password if omitted.
216
-
> *`--force`: Optional. Overwrites existing configuration for the specified <wallet_name> if set. By default, `just init` fails if the wallet config values already exists.
217
-
218
-
#### Example
219
-
220
-
To initialize a wallet named `my_wallet` with `electrum` as the backend:
202
+
To initialize a wallet configuration, use the following command structure:
221
203
222
204
```shell
223
-
just init my_wallet "tr(tprv8Z.../0/*)#dtdqk3dx""tr(tprv8Z.../1/*)#ulgptya7" sqlite electrum "ssl://mempool.space:60602" user password
You can omit the following arguments to use their default values:
215
+
To overwrite an existing wallet configuration, use the `--force` flag at the end of the command.
233
216
234
-
`database_type`: Defaults to sqlite.
235
-
`rpc_user`: Defaults to user.
236
-
`rpc_password`: Defaults to password.
217
+
You can omit the following arguments to use their default values:
237
218
238
-
For example, to initialize a wallet with default database_type, rpc_user, and rpc_password:
219
+
`network`: Defaults to `testnet`
239
220
240
-
```shell
241
-
just init-wallet my_wallet "tr(tprv8Z.../0/*)#dtdqk3dx""tr(tprv8Z.../1/*)#ulgptya7" electrum "ssl://mempool.space:60602"
242
-
```
221
+
`database_type`: Defaults to `sqlite`
243
222
244
223
#### Using Saved Configuration
245
224
246
-
After initializing a wallet with `just init`, the configuration is saved in `~/.bdk-bitcoin/config.toml`. You can then run `bdk-cli` wallet commands without specifying the parameters, referencing only the wallet name and network.
225
+
After a wallet is initialized, you can then run `bdk-cli` wallet commands without specifying the parameters, referencing only the wallet subcommand.
247
226
248
-
With the wallet `my_wallet` initialized, generate a new address and sync the wallet as follow:
227
+
For example, with the wallet `my_wallet` initialized, generate a new address and sync the wallet as follow:
cargo run --features electrum wallet -w my_wallet sync
254
233
```
255
234
256
-
#### Notes:
235
+
Note that each wallet has its own configuration, allowing multiple wallets with different configurations.
257
236
258
-
* Each wallet has its own configuration, allowing multiple wallets with different settings (e.g., different descriptors or backends).
259
-
* You can override saved configuration values for a single command by specifying them explicitly (e.g., `--client-type esplora` or `--url https://mempool.space/signet/api`).
0 commit comments