From 7878e84622e06a4a6597244a87a07eed9287c70e Mon Sep 17 00:00:00 2001 From: musab1258 Date: Thu, 12 Nov 2026 21:41:21 +0100 Subject: [PATCH 1/2] docs(readme): correct rpc auth options in wallet config usage The usage synopsis for `wallet config` lists `--rpc-user` and `--rpc-password`, but neither flag exists. The rpc backend takes `--basic-auth `, or the path of a cookie file as a positional argument, and the client uses the cookie when one is given. Replace the two nonexistent flags with the real options and note which one takes effect when both are present. Refs: #271 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 702fa6a3..51d81252 100644 --- a/README.md +++ b/README.md @@ -334,10 +334,12 @@ The `wallet config` sub-command allows you to save wallet settings to a `config. To save a wallet settings: ```shell -cargo run --features -- -n wallet --wallet config [ -f ] --ext-descriptor --int-descriptor --client-type --url [--database-type ] [--rpc-user ] - [--rpc-password ] +cargo run --features -- -n wallet --wallet config [ -f ] --ext-descriptor --int-descriptor --client-type --url [--database-type ] [--basic-auth ] + [] ``` +The `--basic-auth` option and the `` file path apply to the `rpc` backend. If a cookie is given, it is used instead of the user and password. + For example, to initialize a wallet named `my_wallet` with `electrum` as the backend on `signet` network: ```shell From e5df5a8437591db0727e21bcc494986f050a0a0b Mon Sep 17 00:00:00 2001 From: musab1258 Date: Thu, 12 Nov 2026 21:45:53 +0100 Subject: [PATCH 2/2] docs(readme): document env vars accepted by wallet config Most `wallet config` options have an environment variable counterpart through clap's `env` attribute, but none of the names are documented, so users have to read src/commands.rs to find them. Add a table with each variable, the option it sets and the command or backend that uses it. State that a command line flag takes precedence over its variable, and that the values are saved to `config.toml`, which is what the other wallet commands read. Refs: #271 --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 51d81252..64670a9d 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,29 @@ cargo run --features electrum -- -n signet wallet -w my_wallet config -e "tr(tpr To overwrite an existing wallet configuration, use the `--force` flag after the `config` sub-command. +#### Setting options with environment variables + +Most `wallet config` options can also be set through an environment variable. A flag given on the command line takes precedence over its variable. The values are saved to `config.toml`, and the other wallet commands read that file, so changing a variable later does not change a wallet that is already saved. + +| Variable | Option | Used by | +| --- | --- | --- | +| `NETWORK` | `-n`, `--network` | all commands | +| `DATADIR` | `-d`, `--datadir` | all commands | +| `WALLET_NAME` | `-w`, `--wallet` | `wallet` and `repl` | +| `EXT_DESCRIPTOR` | `-e`, `--ext-descriptor` | `wallet config` | +| `INT_DESCRIPTOR` | `-i`, `--int-descriptor` | `wallet config` | +| `CLIENT_TYPE` | `-c`, `--client-type` | `wallet config` | +| `DATABASE_TYPE` | `-d`, `--database-type` | `wallet config` | +| `SERVER_URL` | `-u`, `--url` | `wallet config`, backends `electrum`, `esplora` and `rpc` | +| `ELECTRUM_BATCH_SIZE` | `-b`, `--batch-size` | `wallet config`, backend `electrum` | +| `ESPLORA_PARALLEL_REQUESTS` | `-p`, `--parallel-requests` | `wallet config`, backend `esplora` | +| `RPC_BASIC_AUTH` | `-a`, `--basic-auth` (as `user:password`) | `wallet config`, backend `rpc` | +| `COOKIE` | the `` argument | `wallet config`, backend `rpc` | +| `PROXY_ADDRS_PORT` | `--proxy` | `wallet config`, backends `electrum`, `esplora` and `cbf` | +| `PROXY_USER_PASSWD` | `--proxy_auth` (as `user:password`) | `wallet config`, backends `electrum` and `esplora` | +| `PROXY_RETRIES` | `-r`, `--retries` | `wallet config`, backends `electrum` and `esplora` | +| `PROXY_TIMEOUT` | `-t`, `--timeout` | `wallet config`, backends `electrum` and `esplora` | + #### Using a Configured Wallet Once configured, use any wallet command with just the wallet name: