Skip to content

Geolocation: Add CLI for Probe Management#3111

Draft
ben-dz wants to merge 3 commits intobdz/doublezero-3013from
bdz/doublezero-geolocation-cli
Draft

Geolocation: Add CLI for Probe Management#3111
ben-dz wants to merge 3 commits intobdz/doublezero-3013from
bdz/doublezero-geolocation-cli

Conversation

@ben-dz
Copy link
Contributor

@ben-dz ben-dz commented Feb 26, 2026

Closes #2955

Summary

  • Add standalone doublezero-geolocation CLI binary with full probe CRUD and parent-device management
  • Integrate geolocation commands into the doublezero_cli library crate with a mockable GeoCliCommand trait, enabling unit testing for all command handlers
  • Add geo_program_id field to the shared SDK config so the geolocation program ID can be persisted via config set and resolved automatically
  • Fix RPC get_program_accounts deserialization failure by explicitly requesting base64 encoding in the list command

Details

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), and init-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 over GeoCliCommand and write to a Write trait object, making them independently testable. Should allowmerging into the main doublezero CLI.

Config set supports --env shorthand: Running config set --env devnet sets RPC URL, WS URL, program IDs, and the new geo program ID all at once.

Testing Verification

  • Unit tests for all probe commands and config commands using MockGeoCliCommand with predicate assertions
  • Verified list output in table, JSON, and compact JSON formats
  • Confirmed base64 encoding fix resolves get_program_accounts deserialization on devnet
  • Manual testing on a localnet with current versions of the onchain program and rust SDK.

@ben-dz ben-dz added this to the Geo Location milestone Feb 26, 2026
…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.
@ben-dz ben-dz force-pushed the bdz/doublezero-geolocation-cli branch from 2fad367 to a6b95cf Compare February 26, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant