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
- update CHANGELOG
[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
@@ -194,68 +194,45 @@ Note: You can modify the `Justfile` to reflect your nodes' configuration values.
194
194
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password balance
195
195
```
196
196
197
-
### Initializing a Wallet with `just`
197
+
### Initializing Wallet Configurations with `bdk-cli wallet init`
198
198
199
-
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.
200
-
This eliminate the need to provide repetitive arguments. To set up a wallet with persistent configuration values, use the following just command:
199
+
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.
201
200
202
-
```shell
203
-
just init <wallet_name><ext_descriptor><int_descriptor><database_type><client_type><url><rpc_user><rpc_password> [--force]
204
-
```
205
-
The arguments must be provided in the order shown above. Replace each placeholder with the corresponding value:
206
-
207
-
> *`wallet_name`: The unique name for your wallet (e.g., my_wallet)
208
-
> *`ext_descriptor`: The external descriptor for generating receiving addresses (e.g., tr(tprv.../0/*)#checksum)
209
-
> *`int_descriptor`: The internal descriptor for generating change addresses (e.g., tr(tprv.../1/*)#checksum)
210
-
> *`database_type`: The database type for wallet persistence (e.g., sqlite). Defaults to `sqlite` if omitted
211
-
> *`client_type`: The blockchain backend (e.g., electrum, esplora, rpc, cbf)
212
-
> *`url`: The server URL for the blockchain backend (e.g., ssl://mempool.space:60602 for Electrum).
213
-
> *`rpc_user`: The RPC username for rpc client type (e.g., user). Defaults to user if omitted.
214
-
> *`rpc_password`: The RPC password for rpc client type (e.g., password). Defaults to password if omitted.
215
-
> *`--force`: Optional. Overwrites existing configuration for the specified <wallet_name> if set. By default, `just init` fails if the wallet config values already exists.
216
-
217
-
#### Example
218
-
219
-
To initialize a wallet named `my_wallet` with `electrum` as the backend:
201
+
To initialize a wallet configuration, use the following command structure:
220
202
221
203
```shell
222
-
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:
214
+
To overwrite an existing wallet configuration, use the `--force` flag at the end of the command.
232
215
233
-
`database_type`: Defaults to sqlite.
234
-
`rpc_user`: Defaults to user.
235
-
`rpc_password`: Defaults to password.
216
+
You can omit the following arguments to use their default values:
236
217
237
-
For example, to initialize a wallet with default database_type, rpc_user, and rpc_password:
218
+
`network`: Defaults to `testnet`
238
219
239
-
```shell
240
-
just init-wallet my_wallet "tr(tprv8Z.../0/*)#dtdqk3dx""tr(tprv8Z.../1/*)#ulgptya7" electrum "ssl://mempool.space:60602"
241
-
```
220
+
`database_type`: Defaults to `sqlite`
242
221
243
222
#### Using Saved Configuration
244
223
245
-
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.
224
+
After a wallet is initialized, you can then run `bdk-cli` wallet commands without specifying the parameters, referencing only the wallet subcommand.
246
225
247
-
With the wallet `my_wallet` initialized, generate a new address and sync the wallet as follow:
226
+
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
253
232
```
254
233
255
-
#### Notes:
234
+
Note that each wallet has its own configuration, allowing multiple wallets with different configurations.
256
235
257
-
* Each wallet has its own configuration, allowing multiple wallets with different settings (e.g., different descriptors or backends).
258
-
* 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