Skip to content

CI-only: chore/examples-network-pluggable (x4-yimonx)#5

Closed
ryanRfox wants to merge 1 commit into
ci-base-2026-05-16from
chore/examples-network-pluggable
Closed

CI-only: chore/examples-network-pluggable (x4-yimonx)#5
ryanRfox wants to merge 1 commit into
ci-base-2026-05-16from
chore/examples-network-pluggable

Conversation

@ryanRfox
Copy link
Copy Markdown
Owner

CI-trigger PR — to be closed after CI completion.

This PR exists solely to trigger GitHub Actions on commit b26e6851 for the x4-yimonx polecat-committed branch. Base is a clean snapshot of upstream/main HEAD (e35becff) on the fork.

Scope: 11 Tier 1 TypeScript example demos made chain-pluggable via the canonical EVM_NETWORK env pattern from PR x402-foundation#2250 (ceb7126c).

Local checks (already green per polecat evidence):

  • Recipe 1: pnpm install --frozen-lockfile, pnpm -C examples/typescript -r typecheck, pnpm -C examples/typescript -r lint — all pass
  • Recipe 2: Base Sepolia smoke via express demo — tx hash 0x57f59775391ce22c4ee7c306fffcf0bf7bba8ad6fc426cf27c05f2b60589d66b verified status=0x1 on public RPC

Review-quorum (Opus + MAX effort, 2 lanes) verdict: CLEAN.

  • Lane 1 (canon-conformance): all 6 criteria PASS
  • Lane 2 (scope-hostile): only borderline within-brief findings

This PR will be closed after CI green.

…_NETWORK

Apply the canonical chain-pluggable pattern established in PR x402-foundation#2250 (e2e/src/networks/networks.ts) to the 11 Tier 1 teachable demos. Each demo now reads an EVM_NETWORK env var (CAIP-2, default `eip155:84532`) instead of hard-coding the Base Sepolia literal in route declarations and resource-server registrations. The 11 facilitator-and-server demos can now be retargeted to any EVM chain in `DEFAULT_STABLECOINS` without code changes — same demo, different chain.

Two demos (`facilitator/basic`, `servers/self-facilitation`) inline a small `resolveViemChain` helper so their viem wallet clients track the configured chain, with `EVM_RPC_URL` overriding viem's default RPC. The helper falls back to `defineChain` for chains viem hasn't packaged yet (e.g. Mezo Testnet).

Scope: 11 .ts files + 7 README updates. Companion clients (`clients/fetch`, `clients/axios`, `clients/custom`, `clients/advanced/*`) already use `eip155:*`/`solana:*` wildcards, so no client-side work was needed.

Three intentional chain literals are preserved unchanged because they teach demo-specific semantics rather than the demo's chain selection:
- `clients/advanced/builder-pattern.ts` — `eip155:1` / `solana:EtWT…` per-network overrides
- `servers/advanced/custom-money-definition.ts:50` — `eip155:100` (Gnosis Chain) for the registerMoneyParser pattern
- `servers/offer-receipt/index.ts:59` — `did:pkh:eip155:1` canonical DID:PKH identifier

SVM accepts (`solana:EtWT…`) in the express/fastify/hono/facilitator-basic demos remain unchanged: Phase 2 scope is EVM-side only. SVM remains single-network at Solana Devnet.

Documented in each modified demo's README: the new `EVM_NETWORK` env var, the default chain, the link to `DEFAULT_STABLECOINS` for the list of chains that "just work", and (for the two demos that need it) the `EVM_RPC_URL` override for chains viem doesn't ship.
@ryanRfox ryanRfox force-pushed the chore/examples-network-pluggable branch from b26e685 to 3d708c2 Compare May 16, 2026 22:59
@ryanRfox
Copy link
Copy Markdown
Owner Author

CI-only PR closed: all 7 checks green on 3d708c24 (amended from b26e685 to add prettier format-fix on examples/typescript/servers/custom/README.md). Branch chore/examples-network-pluggable retained on fork; no merge intended. Closing per original CI-trigger-only intent.

@ryanRfox ryanRfox closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant