Geolocation: Add CLI for Probe Management#3111
Draft
ben-dz wants to merge 3 commits intobdz/doublezero-3013from
Draft
Geolocation: Add CLI for Probe Management#3111ben-dz wants to merge 3 commits intobdz/doublezero-3013from
ben-dz wants to merge 3 commits intobdz/doublezero-3013from
Conversation
…ccount. geolocaiton cli now uses config set from doublezero cli, and adds the ability to set default geolocation program id to that. This should crate cleaner integration when we merge the geolocation cli into the existing doublezero cli.
2fad367 to
a6b95cf
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.
Closes #2955
Summary
doublezero-geolocationCLI binary with full probe CRUD and parent-device managementdoublezero_clilibrary crate with a mockableGeoCliCommandtrait, enabling unit testing for all command handlersgeo_program_idfield to the shared SDK config so the geolocation program ID can be persisted viaconfig setand resolved automaticallyget_program_accountsdeserialization failure by explicitly requesting base64 encoding in the list commandDetails
CLI structure: The new binary (
client/doublezero-geolocation-cli/) uses clap with three top-level subcommands:config(local config get/set),probe(full CRUD + parent management), andinit-config(onchain program config initialization). Config resolution follows the pattern: explicit CLI flag > local config file > hardcoded default.Integration path: All geolocation command logic lives in
smartcontract/cli/src/geolocation/, reusing the existing CLI crate's validators and patterns. Commands are generic overGeoCliCommandand write to aWritetrait object, making them independently testable. Should allowmerging into the maindoublezeroCLI.Config set supports
--envshorthand: Runningconfig set --env devnetsets RPC URL, WS URL, program IDs, and the new geo program ID all at once.Testing Verification
MockGeoCliCommandwith predicate assertionslistoutput in table, JSON, and compact JSON formatsget_program_accountsdeserialization on devnet