Skip to content

cli: add doublezero geolocation probe subcommands#3713

Merged
ben-dz merged 1 commit into
mainfrom
bdz/geolocation-probe-subtree
May 18, 2026
Merged

cli: add doublezero geolocation probe subcommands#3713
ben-dz merged 1 commit into
mainfrom
bdz/geolocation-probe-subtree

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented May 18, 2026

Summary of Changes

  • Adds doublezero geolocation probe <create|update|delete|get|list|add-parent|remove-parent> to the main doublezero CLI, mirroring doublezero-geolocation probe ...
  • Adds a new --geo-program-id global flag (resolution: flag → config geo_program_id → built-in default)
  • Carries the GeoClient + GeoCliCommandImpl construction needed for any future geolocation subtree work; the user subtree lands in a follow-up

Stack: This PR is stacked on top of #3711 (bdz/config-geo-program-id).

Diff Breakdown

Category Files Lines (+/-) Net
Scaffolding 5 +82 / -6 +76
Docs 1 +1 / -0 +1

Pure clap wiring and dispatch — no new business logic. All probe command implementations are inherited unchanged from `doublezero_cli::geolocation::probe::*`.

Key files (click to expand)
  • `client/doublezero/src/main.rs` — adds `--geo-program-id` field on `App`, imports `GeoClient` / `GeoCliCommandImpl` / `get_globalstate_pda`, adds `Command::Geolocation` match arm that builds the geo client inline and dispatches the 7 probe subcommands
  • `client/doublezero/src/cli/geolocation/probe.rs` — new module: `ProbeCliCommand` + `ProbeCommands` enum with 7 variants imported from `doublezero_cli::geolocation::probe::*`
  • `client/doublezero/src/cli/geolocation/mod.rs` — new module: `GeolocationCliCommand` + `GeolocationCommands` enum (currently `Probe` only)
  • `client/doublezero/src/cli/command.rs` — adds `Geolocation(GeolocationCliCommand)` variant on the top-level `Command` enum, alongside `Multicast`
  • `client/doublezero/src/cli/mod.rs` — registers `pub mod geolocation;`

Testing Verification

  • `doublezero geolocation probe --help` lists all 7 subcommands (`create`, `update`, `delete`, `get`, `list`, `add-parent`, `remove-parent`)
  • `doublezero --help` shows the new `geolocation` command and the `--geo-program-id` flag with metavar `<GEO_PROGRAM_ID>`

@ben-dz ben-dz marked this pull request as draft May 18, 2026 15:57
Base automatically changed from bdz/config-geo-program-id to main May 18, 2026 17:15
@ben-dz ben-dz force-pushed the bdz/geolocation-probe-subtree branch from f3e46d0 to 50c8027 Compare May 18, 2026 17:18
@ben-dz ben-dz requested a review from juan-malbeclabs May 18, 2026 17:22
@ben-dz ben-dz marked this pull request as ready for review May 18, 2026 17:22
@ben-dz ben-dz merged commit d762a60 into main May 18, 2026
33 checks passed
@ben-dz ben-dz deleted the bdz/geolocation-probe-subtree branch May 18, 2026 19:05
ben-dz added a commit that referenced this pull request May 19, 2026
Stacked on #3713 (PR 2: `doublezero geolocation probe`).

## Summary of Changes
- Adds `doublezero geolocation user
<create|delete|update|get|list|add-target|remove-target|set-result-destination|update-payment>`
to the `doublezero` CLI, mirroring the existing `doublezero-geolocation
user` surface
- Wires `UserCliCommand` / `UserCommands` via the existing
`Command::Geolocation` dispatch arm (no new client construction — reuses
`GeoClient` / `GeoCliCommandImpl` from the probe arm)

## Diff Breakdown
| Category    | Files | Lines (+/-)  | Net  |
|-------------|-------|--------------|------|
| Core logic  |     2 | +98  / -6    | +92  |
| Scaffolding |     6 | +138 / -6    | +132 |
| Docs        |     1 | +4   / -0    | +4   |

Purely additive clap wiring for the PR-3 slice; the larger
`config/set.rs` changes are from the base PRs (1–2) included in this
diff.

<details>
<summary>Key files (click to expand)</summary>

- `client/doublezero/src/cli/geolocation/user.rs` — new file: clap
`UserCliCommand` / `UserCommands` enum mirroring
`doublezero-geolocation-cli/src/cli/user.rs`
- `client/doublezero/src/main.rs` — `GeolocationCommands::User` dispatch
arm; `GeoUserCommands` import alias
- `client/doublezero/src/cli/geolocation/mod.rs` — registers `pub mod
user` and adds `User(UserCliCommand)` variant to `GeolocationCommands`
- `smartcontract/cli/src/config/set.rs` — (base PR 1) `--geo-program-id`
flag, validation, persistence, and two new tests
- `smartcontract/cli/src/config/get.rs` — (base PR 1) displays
Geolocation Program ID in `config get` output

</details>

## Testing Verification
- `cargo check -p doublezero` — clean
- `make rust-fmt && make rust-lint` — clean (all 8 crates)
- `doublezero geolocation user --help` — lists all 9 subcommands:
`create`, `delete`, `update`, `get`, `list`, `add-target`,
`remove-target`, `set-result-destination`, `update-payment`
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.

2 participants