Skip to content

geolocation: cli fixes #3252

@nikw9944

Description

@nikw9944
  1. Rename probe -metrics-publisher argument to -signing-keypair
  2. Fix doublezero-gelocation config set --env devnet bug:
❯ doublezero-geolocation config set --env devnet

thread 'main' panicked at /home/nik/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.50/src/parser/error.rs:32:9:
Mismatch between definition and access of `env`. Could not downcast to TypeId(0x06ccbc7a8ff777a145951786a0d3d65d), need to downcast to TypeId(0x652f329a49e7c67669df4a6e3ac0879a)

The fix:

diff --git a/client/doublezero-geolocation-cli/src/main.rs b/client/doublezero-geolocation-cli/src/main.rs
index 308f57b8..abbcb73b 100644
--- a/client/doublezero-geolocation-cli/src/main.rs
+++ b/client/doublezero-geolocation-cli/src/main.rs
@@ -18,7 +18,7 @@ struct App {
     command: Command, 
     /// DZ env (testnet, devnet, or mainnet-beta)
     #[arg(short, long, value_name = "ENV", global = true)]
-    env: Option<Environment>,
+    env: Option<String>,
     /// DZ ledger RPC URL
     #[arg(long, value_name = "RPC_URL", global = true)]
     url: Option<String>,
@@ -48,7 +48,7 @@ fn main() -> eyre::Result<()> {
     }
 
     let (url, geo_program_id, svc_program_id) = if let Some(env) = app.env {
-        let config = env.config()?;
+        let config = env.parse::<Environment>()?.config()?;
         (
             Some(config.ledger_public_rpc_url),
             Some(config.geolocation_program_id.to_string()),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions