cli: add --solana-url and --verbose global flags#3754
Open
juan-malbeclabs wants to merge 2 commits into
Open
Conversation
7ab3a4b to
7a7f8b6
Compare
This was referenced May 22, 2026
1732849 to
3bd8661
Compare
`--env` now conflicts with `--url`, `--ws`, `--solana-url`, `--program-id`, and `--geo-program-id` via clap. Combining them used to be silently inconsistent: per-field overrides won over env defaults on some fields and not others, so e.g. `--env devnet --url <custom>` would pair the custom RPC URL with devnet's default WebSocket URL. Clap now rejects the combination upfront with a clear usage error, matching the design rule that `--env` selects a full preset wholesale. Adds clap-parse tests covering each conflict pair and the positive single-flag cases.
7a7f8b6 to
19c7707
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC-20 implementation stack
This PR is part of a 9-PR chain delivering RFC-20: CLI standardization. Each PR's diff is only its own contribution; reviewers should consume them in order.
doublezero-cli-corefoundation crate +solana_l1_rpc_url--solana-url+--log-verboseglobal flags + tracing initCliContextbuilt inmain+ centralized error renderingdoublezero_cli→doublezero-serviceability-clilocation getas the async +CliContextreference verbdocs/cli-standard.md+CLAUDE.mdpointerServiceabilityCommandenum + async dispatcher#[command(flatten)]+ collapse binary dispatchThis PR: #3754 — position 2 of 9. Previous: #3753 · Next: #3755
Summary of Changes
--solana-url <SOLANA_RPC_URL>global flag todoublezeroper RFC-20 §Global flags. Distinct from--url, which continues to override the DZ ledger transport;--solana-urltargets the Solana L1 transport. The flag is parsed and exposed on the binary'sAppstruct; per-verb consumption lands when verbs migrate to construct typed Solana L1 clients fromCliContext(follow-up PRs).--verbose/-v(repeatable) global flag and initializes thetracingsubscriber at startup viadoublezero_cli_core::init_logging(verbosity). Default level iswarn;-vraises todebug,-vvtotrace. Honors theRUST_LOGenv var when set. Diagnostic logs go to stderr so--jsonoutput on stdout remains parseable.println!("using keypair: ...")startup line with atracing::info!event so the keypair confirmation now appears only at-vor higher and no longer pollutes parseable stdout.Diff Breakdown
Three new global flags wired into the binary and the logging facade; no changes to subcommand dispatch or verb behavior.
Key files (click to expand)
client/doublezero/src/main.rs- addssolana_urlandverbosefields to theAppstruct, callsdoublezero_cli_core::init_logging(app.verbose)first thing inmain, and replaces theprintln!keypair confirmation withtracing::info!.client/doublezero/Cargo.toml- depends ondoublezero-cli-coreandtracing.Testing Verification
make rust-lintclean.doublezero --helpshows the new--solana-urland--verbose/-vglobal flags with the expected help text.doublezero --keypair /tmp/fake.json --env local -v addressemits atracing::info!event with the keypair path on stderr while stdout shows only the address; no-vkeeps stderr empty.jo/1-cli-core-foundationand the diff shown is its own contribution only.