Skip to content

docs(readme): document env vars accepted by wallet config - #387

Open
Musab1258 wants to merge 1 commit into
bitcoindevkit:masterfrom
Musab1258:docs/readme-rpc-auth-and-env-vars
Open

Musab1258 wants to merge 1 commit into
bitcoindevkit:masterfrom
Musab1258:docs/readme-rpc-auth-and-env-vars

Conversation

@Musab1258

@Musab1258 Musab1258 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Documentation-only change for the wallet config section of the README. Per the discussion on #271, runtime flags and env overrides are no longer planned; config.toml stays the single source of truth.

This PR:

  1. Corrects the usage synopsis: it listed --rpc-user and --rpc-password, which the CLI does not accept. It now shows --basic-auth <user:password> and the optional <cookie> file path, notes that the cookie is used instead of the user and password when both are given, and shows --database-type as a required option.
  2. Adds a table of the environment variables that clap already reads (SERVER_URL, RPC_BASIC_AUTH, COOKIE, etc.), with the option each one sets and where it applies. It also states that flags take precedence over variables and that the values are saved to config.toml.

Refs #271.

Notes to the reviewers

  • No code changes, only README.md.
  • Every variable, flag, and short option in the table is taken from the env, short and long attributes in src/commands.rs. The cookie-over-basic-auth statement comes from src/client.rs. Two options share -d: the global --datadir and wallet config --database-type.
  • The new section says plainly that these variables only affect wallet config: values are saved to config.toml, and later commands read that file. DATADIR and WALLET_NAME are mentioned below the table instead, because they are not saved.
  • I haven't added a CHANGELOG entry because the changes are documentation-only. I can still do so if you'd prefer.

Checklists

All Submissions:

  • I've signed all my commits.
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing.

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.78%. Comparing base (e2811c0) to head (3efea55).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
+ Coverage   59.63%   59.78%   +0.14%     
==========================================
  Files          25       25              
  Lines        4544     4550       +6     
==========================================
+ Hits         2710     2720      +10     
+ Misses       1834     1830       -4     
Flag Coverage Δ
rust 59.78% <ø> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Musab1258 Musab1258 changed the title Docs/readme rpc auth and env vars docs: readme rpc auth and env vars Nov 13, 2026

@tvpeter tvpeter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also improve the PR title to something like:

docs(readme): document env vars accepted by wallet config

Thank you.

Comment thread README.md Resolved
vadim-anfv added a commit that referenced this pull request Nov 14, 2026
eb9536d ci: make tracing optional, drop cli-table (Vadim Anufriev)
22a01a3 refactor(payjoin): return session history as JSON (Vadim Anufriev)

Pull request description:

  ### Description

  The `--no-default-features` build and clippy jobs are red on every open PR, including Markdown-only ones (#386, #387). `cli-table`, `tracing` and `tracing-subscriber` are unused there, and recent cargo flags that ([`unused_dependencies`](https://doc.rust-lang.org/cargo/reference/lints.html#unused_dependencies), warn by default) while the workflow passes `build-warnings: deny`.

  `cli-table` is dropped entirely, as @tvpeter suggested: its last user, the payjoin session history, now returns JSON like the rest of the module.

  `payjoin history` on `master`:

  ```
  +------------+-----------------+---------------------+-------------------------------+
  | Session ID | Sender/Receiver | Completed At        | Status                        |
  +------------+-----------------+---------------------+-------------------------------+
  | 1          | Receiver        | Not Completed       | Waiting for original proposal |
  +------------+-----------------+---------------------+-------------------------------+
  | 2          | Receiver        | 2026-11-13 17:50:42 | Session cancelled             |
  +------------+-----------------+---------------------+-------------------------------+
  ```

  and on this branch:

  ```json
  {
    "sessions": [
      {
        "id": "1",
        "role": "Receiver",
        "status": "Waiting for original proposal",
        "completed_at": null
      },
      {
        "id": "2",
        "role": "Receiver",
        "status": "Session cancelled",
        "completed_at": "2026-11-13 18:34:22"
      }
    ]
  }
  ```

  ### Notes to the reviewers

  An active session now reports `"completed_at": null` instead of the string `Not Completed`.

  `tracing` is on `cbf` explicitly, although `cbf` already implies `_payjoin-dependencies`, so cbf logging does not depend on a payjoin-internal feature.

  `just pre-push` misses this: the lint is cargo's, not rustc's, so `-D warnings` after `--` does not apply. To reproduce: `cargo build --no-default-features --config 'build.warnings="deny"'`.

  The `SessionHistory` wrapper exists to keep the field order: serializing it directly preserves declaration order, while `json!` would sort the keys alphabetically.

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  tvpeter:
    ACK eb9536d

Tree-SHA512: 556923b5466720ea21dca4a7d4a5798e48cf2b317db0fbab68b3b94e20d6b822edab3d57c2a12e97f4b5c90e52ea727ba3770eb952da30423a26958d69a6e5d5
@Musab1258 Musab1258 changed the title docs: readme rpc auth and env vars docs(readme): document env vars accepted by wallet config Nov 14, 2026
@Musab1258
Musab1258 force-pushed the docs/readme-rpc-auth-and-env-vars branch from e5df5a8 to ed7c223 Compare November 14, 2026 14:12
Comment thread README.md Resolved

@tvpeter tvpeter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Musab1258 for updating the PR.

Please squash the changes into a single commit.

Thank you.

@Musab1258
Musab1258 force-pushed the docs/readme-rpc-auth-and-env-vars branch 2 times, most recently from b252b09 to 5c4505e Compare November 16, 2026 22:10
@Musab1258

Copy link
Copy Markdown
Contributor Author

Thank you @Musab1258 for updating the PR.

Please squash the changes into a single commit.

Thank you.

Squashed into a single commit, 5c4505e, and rebased on the current master.

Thank you.

@tvpeter tvpeter added this to the CLI 4.1.0 milestone Nov 18, 2026
@tvpeter tvpeter moved this from Todo to Ready to Review in BDK-CLI Nov 18, 2026
Comment thread README.md Resolved

@tvpeter tvpeter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion. Thank you.

The usage synopsis for `wallet config` lists `--rpc-user` and
`--rpc-password`, but neither flag exists. The rpc backend takes
`--basic-auth <user:password>`, or the path of a cookie file as a
positional argument, and the client uses the cookie when one is given.
It also shows `--database-type` as optional, but sqlite is a default
feature, so the option is required.

Most `wallet config` options also 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.

Fix the synopsis, then 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.
`DATADIR` and `WALLET_NAME` are listed below the table with what each
does, since they are not saved as options.

Refs: bitcoindevkit#271
@Musab1258
Musab1258 force-pushed the docs/readme-rpc-auth-and-env-vars branch from 5c4505e to 3efea55 Compare November 19, 2026 07:58

@tvpeter tvpeter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3efea55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to Review

Development

Successfully merging this pull request may close these issues.

2 participants