Skip to content

[help wanted] --chain flag for Orbit chains (Arbitrum Nova/Apechain/XAI/Sanko/Sepolia) #6

@abhicris

Description

@abhicris

Context

The Arbitrum Orbit ecosystem (Apechain, XAI, Sanko, etc.) uses the same JSON-RPC surface as Arbitrum One. The CLI currently hardcodes https://arb1.arbitrum.io/rpc. Adding a --chain <name> flag (orbit-aware) and a small preset table makes the tool useful for the whole Orbit fleet — broader addressable market, same code.

Scope

  • Add a chains module (src/chains.rs) with a preset table: {name, chain_id, rpc_url, explorer, native_token, is_orbit: bool}.
    • Populate with: Arbitrum One, Arbitrum Nova, Arbitrum Sepolia, Apechain, XAI, Sanko.
  • Add --chain <name> global flag to Cli. If set, rpc_url defaults to that chain's RPC (but explicit --rpc still wins).
  • If --chain is unknown, print the supported list.
  • Update commands::info (see related issue) to source its chain list from this table.
  • CI: add a smoke test that does arbitrum-cli --chain apechain info and asserts the chain_id is 33139.

Acceptance criteria

  • arbitrum-cli --chain apechain block latest returns JSON from apechain's RPC.
  • arbitrum-cli --chain bogus block latest fails fast with a helpful error listing chains.
  • --rpc still overrides --chain.
  • cargo test green.

Reference: src/main.rs::Cli for where to add the global flag; PR #2 sets CI expectations.

Estimated effort

M (1 day)

kcolbchain / Abhishek Krishna

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions