cli: add hidden init-geolocation-config command#3717
Merged
Conversation
454f635 to
e2c3c0e
Compare
e2c3c0e to
b7c23c0
Compare
9069a11 to
ba94a5d
Compare
ba94a5d to
ad2bd6f
Compare
juan-malbeclabs
approved these changes
May 19, 2026
ben-dz
added a commit
that referenced
this pull request
May 19, 2026
## Summary of Changes - Adds `doublezero geolocation probe ...` and `doublezero geolocation user ...` subcommand groups to the `doublezero` CLI, mirroring the standalone `doublezero-geolocation` binary - Adds `doublezero init-geolocation-config` (hidden) mirroring `doublezero-geolocation init-config` - Adds `--geo-program-id` to `doublezero config set` and `doublezero config get`; persists and prints the geolocation program ID alongside the serviceability program ID - Migrates all e2e test invocations (`geoprobe_test.go`, `smartcontract_geolocation.go`) and the manager init script from `doublezero-geolocation ...` to `doublezero geolocation ...` / `doublezero init-geolocation-config` / `doublezero config set --geo-program-id` This is PR 5 of 5 in a stacked series, stacked on top of PR #3717 (`bdz/init-geolocation-config`), which adds the geolocation CLI commands to the `doublezero_cli` library. PRs 1–4 must be merged first. ## Diff Breakdown | Category | Files | Lines (+/-) | Net | |--------------|-------|--------------|------| | Core logic | 3 | +150 / -9 | +141 | | Scaffolding | 5 | +98 / -4 | +94 | | Tests | 3 | +16 / -16 | +0 | | Docs | 1 | +6 / -0 | +6 | Mostly new scaffolding and core logic adding geolocation commands to `doublezero`; e2e changes are pure renames with zero net churn. <details> <summary>Key files (click to expand)</summary> - `smartcontract/cli/src/config/set.rs` — adds `--geo-program-id` flag, persistence, conflict detection with `--env`, output formatting, and tests - `client/doublezero/src/main.rs` — dispatch for `Command::Geolocation` and `Command::InitGeolocationConfig`; constructs `GeoClient` with `--geo-program-id` global flag - `client/doublezero/src/cli/geolocation/user.rs` — thin Clap wrapper exposing all `doublezero_cli` geolocation user subcommands - `client/doublezero/src/cli/geolocation/probe.rs` — thin Clap wrapper exposing all `doublezero_cli` geolocation probe subcommands - `client/doublezero/src/cli/command.rs` — registers `Geolocation` and `InitGeolocationConfig` variants in the top-level command enum - `smartcontract/cli/src/config/get.rs` — adds Geolocation Program ID line to `config get` output - `e2e/geoprobe_test.go` — replaces `"doublezero-geolocation"` with `"doublezero", "geolocation"` at all call sites - `e2e/docker/manager/scripts/init-config.sh` — consolidates geo program ID into `doublezero config set --geo-program-id`; removes standalone `doublezero-geolocation config set` call </details> ## Testing Verification - `TestE2E_GeoprobeDiscovery` passed (208s runtime) — exercises `probe create`, `probe get`, `probe add-parent`, `user create`, `user update-payment`, `user add-target` (outbound + inbound), and `init-geolocation-config` via the new paths - `TestE2E_GeoprobeIcmpTargets` and `TestE2E_GeoprobeResultDestination` were not run in this session; reviewer may want to verify those
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.
Stacked on #3715 (PR 3: `doublezero geolocation user`). Base branch: `bdz/geolocation-user-subtree`.
Summary of Changes
Diff Breakdown
Pure wiring — no new logic, just hooking `InitProgramConfigCliCommand` into the existing `doublezero` binary.
Key files (click to expand)
Testing Verification