feat: adopt icp.net as the mainnet HTTP gateway domain (icp-cli v1.0.0)#226
Open
marc0olo wants to merge 4 commits into
Open
feat: adopt icp.net as the mainnet HTTP gateway domain (icp-cli v1.0.0)#226marc0olo wants to merge 4 commits into
marc0olo wants to merge 4 commits into
Conversation
icp-cli v1.0.0 changed the default mainnet HTTP gateway from icp0.io to icp.net (browser canister access is now <id>.icp.net / raw.icp.net). Reconcile the skills with the developer-docs change. Changed (gateway / browser canister-access URLs): - asset-canister: mainnet access URL, certified/raw serving domains, browser-open URL; also fix the Node.js HttpAgent host from the legacy ic0.app access domain to the canonical API endpoint icp-api.io - custom-domains: default access URL, ic-domains fetch URLs, and the custom-domains/v1 REST API host (confirmed to resolve on icp.net) - certified-variables: mainnet curl example - deploy-to-cloud-engine: frontend canister access URL - internet-identity: illustrative frontend_origins / TRUSTED_ORIGIN Kept (NOT the gateway): - API/agent hosts stay icp-api.io (icp.net is gateway-only) - Named dapp domains (nns.ic0.app) in icp-cli and agent-web-identity - II delegation rewriting pitfall: II still rewrites icp0.io -> ic0.app at the protocol level (per the II spec, unchanged by the gateway rename), so that behavioral claim stays as-is rather than becoming a meaningless icp.net-vs-icp.net statement Evals: updated custom-domains API-endpoint and asset-canister host assertions; added an asset-canister guard that the mainnet browser URL is <id>.icp.net (not ic0.app/icp0.io/icp-api.io). Both new/updated cases pass with the skill. Closes #224
Skill Validation ReportProject Checks |
raymondk
reviewed
Jun 17, 2026
The pitfall and HttpAgent Configuration section claimed the agent "cannot auto-detect the IC API host on custom domains, so you must set host explicitly." That is inaccurate for recent agents. Per @icp-sdk/core determineHost(), an omitted host defaults to the local replica for localhost/127.0.0.1 origins and to https://icp-api.io for every other origin — including custom domains and icp.net. So on a custom domain you do not need to set host; it already resolves to the mainnet API boundary nodes. Reframe the pitfall around the real mistake: pointing host at the custom domain (or window.location.origin), which serves only the HTTP gateway, not /api/v2, so calls fail. Update the eval case to match.
Rewrite the HttpAgent Configuration section with an explicit resolution table (what an omitted host resolves to per runtime) and a per-scenario "what to do" list covering all cases: - mainnet browser frontend (icp.net / custom domain / legacy gateways): leave host unset → resolves to icp-api.io - mainnet Node.js: unset or icp-api.io - local dev in the browser on *.localhost: unset (auto-detects replica) - local dev in Node.js: MUST set host to the local replica URL — no window.location to detect localhost, so omitted host hits mainnet - non-mainnet/custom network: MUST set host to that network's API endpoint — the icp-api.io default points at mainnet Clarify that host is the API endpoint, never the gateway domain the frontend is served from. Tighten pitfall 8 to point at the section. Add an eval for the Node.js-local case (omitted host silently hits mainnet), the most counterintuitive of the must-set-host scenarios.
The custom-domains skill covers only the mainnet IC custom-domains service — you cannot have a custom domain on a local replica or a custom network. Drop the local-development and custom-network HttpAgent cases (and the resolution table) added in the previous commit; they were out of scope and diluted the skill. The section now states only what is relevant: a mainnet frontend served from a custom domain does not need host set (it resolves to icp-api.io), and must never point host at the gateway/custom domain. Remove the matching out-of-scope Node.js-local eval case.
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.
Summary
Resolves #224. icp-cli v1.0.0 changed the default mainnet HTTP gateway from
icp0.iotoicp.net(browser canister access is nowhttps://<canister-id>.icp.netandraw.icp.net). This reconciles the skills with the developer-docs change (mirror PR open there).Changed →
icp.net(gateway / browser canister-access URLs)asset-canisterHttpAgenthost changed from the legacyic0.appaccess domain to the canonical API endpointicp-api.io(the rest of the corpus already usesicp-api.ioas the agent host)custom-domains.well-known/ic-domainsfetch URLs, and thecustom-domains/v1REST API host (issue confirms it resolves onicp.net)certified-variablescurlexampledeploy-to-cloud-engineinternet-identityfrontend_origins/TRUSTED_ORIGINexamplescustom-domainsHttpAgenthostguidancePitfall 8 and the HttpAgent Configuration section are corrected: a recent
@icp-sdk/coreHttpAgentresolves an omittedhosttohttps://icp-api.ioon a custom domain, so you do not need to set it. The guidance now warns against the real mistake — pointinghostat your custom domain /window.location.origin, which is the gateway and does not serve/api/v2. Scoped to the mainnet custom-domains service only.Kept (NOT the gateway)
icp-api.io—icp.netis gateway-only.nns.ic0.app) inicp-cliandagent-web-identity.internet-identity): II still rewritesicp0.io→ic0.appat the protocol level (per the II spec — unchanged by the gateway rename), so this behavioral claim is left as-is rather than turned into a meaningless "icp.net vs icp.net" statement. This is the caveat the issue flagged.icp-cliandagent-web-identitySKILL.md needed no changes (only API host + named dapp domains).Evals
custom-domainsAPI-endpoint assertions and theasset-canistermainnet-host behavior to match the domain change.custom-domains"HttpAgent host configuration" case to match the correctedhostguidance.asset-canisterregression guard: the mainnet browser URL must be<id>.icp.net(notic0.app/icp0.io/icp-api.io).internet-identityrewriting eval is intentionally left referencingicp0.io/ic0.appsince the pitfall it tests is unchanged.Eval results (new/changed cases)
npm run validate→ all 26 skills pass.Closes #224