Skip to content

Add local network support and root key fetching#10

Open
wiyota wants to merge 1 commit into
kosta-bity:mainfrom
wiyota:feature/local-replica-rootkey
Open

Add local network support and root key fetching#10
wiyota wants to merge 1 commit into
kosta-bity:mainfrom
wiyota:feature/local-replica-rootkey

Conversation

@wiyota

@wiyota wiyota commented Feb 5, 2026

Copy link
Copy Markdown

This PR introduces localized network support across the request pipeline.

It adds ICPNetwork to define base URLs, root keys, and certificate verification, supports local replica/Pocket‑IC via status endpoint root key fetching, and updates request construction and certificate verification to be network-aware.

Tests cover root key fetching and verification setup, and README documents local usage.

Key Changes

  • Added ICPNetwork with mainnet/local presets, derived canister/status URLs, and root key handling.
  • Updated request building to use network-specific canister base URLs.
  • Added root key fetching from the status endpoint and plumbed root key into certificate verification.
  • Updated signature verification to use a provided root key.
  • Added tests for root key fetching and network wiring, and documented local replica usage.

Notes

  • Local replica/Pocket-IC users should call fetchRootKey() and withRootKey(...) before verified read-state.

Introduce `ICPNetwork` to manage base URLs and root keys, enabling
interaction with localized replicas. Include methods for constructing
network-specific URLs, allowing seamless communication with mainnet
and local replicas. This addition facilitates certificate verification
in local environments with the `fetchRootKey` method, retrieving
the root key necessary for certificate validation when targeting
a local ICP network setup. Update existing request structures to
accept network configurations, enhancing flexibility when connecting
to different ICP environments.
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