feat: derive network defaults from -u moniker in shreds CLI#313
Draft
martinsander00 wants to merge 3 commits intomainfrom
Draft
feat: derive network defaults from -u moniker in shreds CLI#313martinsander00 wants to merge 3 commits intomainfrom
martinsander00 wants to merge 3 commits intomainfrom
Conversation
When using a moniker like `-u t`, the CLI now automatically resolves the DZ Ledger URL, USDC mint, and keypair path without requiring explicit flags. This eliminates the need to pass --dz-ledger-url, --usdc-mint, and --keypair for standard testnet/mainnet usage. - Monikers resolve to DZ Ledger URLs (where the program lives) - USDC mint auto-detected from network (mainnet vs development) - Network environment derived from moniker, skipping genesis hash query - Default keypair path changed to ~/.config/doublezero/id.json with fallback to ~/.config/solana/id.json
8421926 to
04239d2
Compare
Revert the shared From<SolanaConnectionOptions> impl back to Solana public URLs so non-shreds CLIs (passport, revenue-distribution, etc.) are unaffected. Add into_dz_ledger_solana_connection() for shreds commands. Also fix USDC doc comments and add moniker_env() tests.
martinsander00
commented
Mar 25, 2026
|
|
||
| // 3. Try default path | ||
| // 3. Try default path (~/.config/doublezero/id.json) | ||
| match read_keypair_from_path(&default_path) { |
Contributor
Author
There was a problem hiding this comment.
make default solana keypair path AND be able to pass -k
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.
Summary
list,pay,payments,price,withdraw) now resolve monikers (-u t,-u m) to DZ Ledger URLs instead of public Solana URLs, since the shred subscription program lives on the DZ Ledgerinto_dz_ledger_solana_connection()— non-shreds CLIs (passport, revenue-distribution, validator-debt, etc.) continue using Solana public URLs--usdc-minton testnet~/.config/doublezero/id.jsonwith fallback to~/.config/solana/id.jsonBefore:
After:
Lines of Code
Testing
moniker_env()resolution-u t