Skip to content

Docs/readme rpc auth and env vars - #387

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

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

Conversation

@Musab1258

Copy link
Copy Markdown
Contributor

Description

Documentation-only changes for the wallet config section of the README, split into two commits. This is the first of two PRs for #271.

  1. docs(readme): correct rpc auth options in wallet config usage: the usage synopsis 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 and notes that the cookie is used instead of the user and password when both are given.
  2. docs(readme): document env vars accepted by wallet config: 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. This describes the current behavior. Runtime overrides (flag > env var > config file on the wallet subcommand) are not part of this PR. They will come in a follow-up PR, which will also update this section.
  • 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.

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.

Replace the two nonexistent flags with the real options and note which
one takes effect when both are present.

Refs: bitcoindevkit#271
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: bitcoindevkit#271
@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.51%. Comparing base (5558555) to head (e5df5a8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
- Coverage   60.00%   59.51%   -0.50%     
==========================================
  Files          25       25              
  Lines        4736     4552     -184     
==========================================
- Hits         2842     2709     -133     
+ Misses       1894     1843      -51     
Flag Coverage Δ
rust 59.51% <ø> (-0.50%) ⬇️

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.

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: Todo

Development

Successfully merging this pull request may close these issues.

1 participant