feat(pic): support the remaining instance options - #318
Merged
Merged
Conversation
Adds the bitcoin, dogecoin and canisterMigration ICP features, bitcoindAddrs and dogecoindAddrs, initialTime, autoProgress, mainnetNnsSubnetId and logLevel.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The options are consistently typed, encoded, tested against the server, and documented without identified correctness issues.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the remaining PocketIC instance options and documents Bitcoin/Dogecoin regtest integration.
Changes:
- Adds time, live-mode, logging, subnet, adapter, and ICP feature options.
- Supports starting an HTTP gateway for instances created with auto-progress.
- Adds integration tests and updated guides.
| File | Description |
|---|---|
packages/pic/tests/src/instance-options.spec.ts |
Tests the new instance options. |
packages/pic/src/pocket-ic.ts |
Handles gateways for auto-progress instances. |
packages/pic/src/pocket-ic-types.ts |
Defines the new public options and features. |
packages/pic/src/pocket-ic-client-types.ts |
Encodes options for the PocketIC server. |
docs/src/content/docs/guides/working-with-the-nns.mdx |
Documents new NNS-related options. |
docs/src/content/docs/guides/working-with-bitcoin.mdx |
Adds Bitcoin and Dogecoin guidance. |
docs/src/content/docs/guides/running-tests.mdx |
Documents logging and auto-progress. |
docs/src/content/docs/guides/more-examples.mdx |
Adjusts sidebar ordering. |
docs/src/content/docs/guides/canister-snapshots.mdx |
Adjusts sidebar ordering. |
docs/src/content/docs/guides/canister-declarations.mdx |
Adjusts sidebar ordering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
marc0olo
marked this pull request as ready for review
October 2, 2026 14:03
…ing Bitcoin transactions
raymondk
approved these changes
Oct 2, 2026
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.
Closes #78
Closes #303
Adds the instance options of the Rust library that PicJS lacked:
bitcoin,dogecoinandcanisterMigration, andbitcoindAddrs/dogecoindAddrsto connect regtest nodes.initialTime(aDateor milliseconds, likesetTime).autoProgress, which creates the instance live. It shares a server field with the initial time, so combining the two throws.makeLiveon such an instance now starts the HTTP gateway instead of failing with "Inconsistent state".mainnetNnsSubnetIdandlogLevel(critical,error,warn,info,debug,trace). These are slog's level names, which the Rust library sends too; the server rejectswarning.bitcoindAddrsanddogecoindAddrstogether are rejected: PocketIC 16 panics creating such an instance (AlreadyRegin its metrics registry), even if one list is empty, and PicJS would wait until the request times out. The Rust library doesn't guard against this.New guide "Working with Bitcoin" (Bitcoin and Dogecoin, answering #78), plus the new features,
initialTimeandmainnetNnsSubnetIdin the NNS guide, andlogLevelandautoProgressin running-tests.Verified: the new tests cover every option against the server (131 tests). The Bitcoin and Dogecoin guide was run end to end with regtest
bitcoind31.1 anddogecoind1.14.9 in Docker: the canisters sync the mined blocks within seconds, withtickfrom the current time and withautoProgress. Starting at PocketIC's default time, they never sync, which is why the guide setsinitialTime: new Date(). The CI tests don't run a node.🤖 Generated with Claude Code