geolocation/cli: show codes instead of pubkeys in user get and probe get#3813
Open
ben-dz wants to merge 3 commits into
Open
geolocation/cli: show codes instead of pubkeys in user get and probe get#3813ben-dz wants to merge 3 commits into
ben-dz wants to merge 3 commits into
Conversation
13cd88e to
93753ef
Compare
The 'probe' column of the Targets table in 'doublezero geolocation user get' rendered the geoprobe pubkey. Resolve it to the probe code via list_geo_probes, falling back to the pubkey when the probe is not found. JSON output gains a 'probe' code field while retaining the canonical 'geoprobe_pk'.
'doublezero geolocation probe get' rendered the exchange as a raw pubkey, inconsistent with 'probe list' which already shows the exchange code. Resolve exchange_pk to its code via list_exchanges with a pubkey fallback, matching the list verb.
93753ef to
b61abd5
Compare
juan-malbeclabs
requested changes
Jun 1, 2026
- probe get: keep the canonical exchange pubkey in JSON and expose the resolved code as a separate exchange_code field, so machine-readable output stays backward compatible (mirrors the user get target change) - user get / probe get: treat code resolution as best-effort; an error listing probes/exchanges now falls back to the pubkey instead of failing the command, matching the existing not-found fallback
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 of Changes
geolocation user get: the Targets tableprobecolumn now shows the human-readable probe code instead of the raw geoprobe pubkey, resolved vialist_geo_probeswith a pubkey fallback. JSON gains aprobecode field while retaining the canonicalgeoprobe_pk.geolocation probe get: theexchangefield now shows the exchange code instead of the raw pubkey, resolved vialist_exchangeswith a pubkey fallback — making it consistent withgeolocation probe list, which already does this.Diff Breakdown
Two small CLI display fixes in the geolocation crate; the bulk of the diff is test coverage for code resolution and pubkey fallback.
Key files (click to expand)
crates/doublezero-geolocation-cli/src/user/get.rs— resolvegeoprobe_pk→ probe code in the Targets table; keepgeoprobe_pkin JSON, addprobecode field; tests for code rendering and fallbackcrates/doublezero-geolocation-cli/src/probe/get.rs— resolveexchange_pk→ exchange code, matchingprobe list; tests for code rendering and fallbackTesting Verification
user get: table asserts the probe code (ams-probe-01) and not the pubkey; new fallback test when the probe isn't found; compact-JSON test asserts bothprobecode and retainedgeoprobe_pkprobe get: table asserts the exchange code (ams) and not the pubkey; new fallback test when the exchange isn't found; JSON/compact tests updated to expect the codeuser::getandprobe::gettests pass;make rust-lintclean in the dev container