Skip to content

refactor(scripts): use dfx --system-canisters instead of manual NNS setup#630

Merged
aterga merged 8 commits into
mainfrom
arshavir/use-dfx-system-canisters
Apr 24, 2026
Merged

refactor(scripts): use dfx --system-canisters instead of manual NNS setup#630
aterga merged 8 commits into
mainfrom
arshavir/use-dfx-system-canisters

Conversation

@aterga

@aterga aterga commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace manual installation of system canisters (ICP ledger, ICP index, CMC, Internet Identity) with `dfx start --system-canisters`, which bootstraps them automatically via PocketIC
  • Bump dfx from 0.25.0 to 0.30.2
  • Remove ~110 lines of install/uninstall/setup functions from `orbit` script; add `setup_system_canisters_post()` that transfers ICP, configures CMC's authorized subnet list, and reinstalls the project's pinned Internet Identity version over the system-bootstrapped one so the e2e tests get the expected registration UI
  • Upgrade icx-asset from 0.21.0 to 0.29.0 for compatibility with dfx 0.30.2's asset canister batch API
  • Remove Python/cbor2/crc32 CI dependencies that were only needed for native replica CBOR parsing

Test plan

  • CI `deployment-test` passes (PocketIC + `--system-canisters`)
  • CI `deployment-test-replica` passes (was native replica, now also PocketIC since dfx 0.27.0 removed the native replica)
  • CI `prod-deployment-test` passes
  • CI `e2e-tests` passes
  • Integration tests unaffected (separate PocketIC setup via `with_icp_features`)
  • Verify `dfx ledger transfer --identity anonymous` successfully credits ICP to current user

🤖 Generated with Claude Code

… NNS setup

Replace manual installation of system canisters (ICP ledger, ICP index,
CMC, Internet Identity) with dfx 0.30.2's --system-canisters flag, which
bootstraps them automatically via PocketIC at well-known NNS canister IDs.

- Bump dfx from 0.25.0 to 0.30.2
- Remove ~110 lines of install/uninstall/setup functions from orbit script
- Add setup_system_canisters_post() for ICP transfer and CMC subnet config
- Update CI workflows to use --system-canisters
- Remove Python/cbor2/crc32 CI dependencies (only needed for native replica)
- Update README and getting-started docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aterga aterga requested a review from a team as a code owner April 8, 2026 15:41
aterga and others added 4 commits April 8, 2026 18:07
dfx requires the wasm field for type: "custom" canister definitions,
even when the canisters are bootstrapped by --system-canisters and
won't be deployed via dfx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dfx 0.30.2 adds JSDoc comments to generated TypeScript declaration
files from candid documentation comments. No structural changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…k_list

With --system-canisters, the CMC is configured with the real governance
canister, so only it can call set_authorized_subnetwork_list. Use dfx's
--sender flag to impersonate the governance canister (supported on PocketIC).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dfx 0.30.2 renamed --sender to --impersonate for canister call.
Upgrade icx-asset from 0.21.0 to 0.29.0 for asset canister compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the local dev/CI bootstrapping flow to rely on dfx start --system-canisters (PocketIC-managed system canisters) instead of manually installing NNS/system canisters, and updates docs/CI accordingly.

Changes:

  • Switch local startup commands to dfx start --system-canisters in docs, scripts, and CI.
  • Simplify the orbit --init flow by removing manual system-canister install logic and adding a small post-bootstrap helper (ICP transfer + CMC subnet authorization).
  • Bump dfx version and refresh generated Candid TS types / tool versions.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
orbit Removes manual NNS/system-canister setup and adds setup_system_canisters_post to finalize PocketIC --system-canisters bootstrap.
dfx.json Drops the cmc canister entry and bumps dfx to 0.30.2.
.github/workflows/tests.yaml Updates CI to start with --system-canisters and removes Python/cbor2/crc32 steps.
README.md Updates local dev instructions to use dfx start --system-canisters.
docs/src/content/docs/developers/getting-started.md Updates the dfx start command to --system-canisters.
package.json Updates e2e deploy script to start dfx with --system-canisters.
scripts/utils.sh Bumps icx-asset install version.
apps/wallet/src/generated/**.did.d.ts Regenerated TS declarations with expanded JSDoc/comments.
Comments suppressed due to low confidence (1)

docs/src/content/docs/developers/getting-started.md:69

  • Step 4 says "Start the Internet Computer replica in the background", but the command shown does not use --background, and --system-canisters starts PocketIC rather than the native replica. Also, the subsequent dfx deploy will attempt to deploy all canisters in dfx.json (including icp_ledger/icp_index/internet_identity), which is likely not the intended local-dev flow now that system canisters are bootstrapped automatically. Consider updating this step to mention PocketIC and to use dfx start --background ... plus ./orbit --init (as in the root README) instead of dfx deploy.
## Step 4: Start the Local Development Server

1. Start the Internet Computer replica in the background:

   ```bash
   dfx start --clean --system-canisters --host 127.0.0.1:4943
  1. Deploy the canisters to the local replica:

    dfx deploy
</details>



---

💡 <a href="/dfinity/orbit/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment thread orbit Outdated
Comment thread orbit Outdated
Comment thread README.md Outdated
@aterga aterga force-pushed the arshavir/use-dfx-system-canisters branch from 63337c5 to 410d78d Compare April 14, 2026 11:07
The --system-canisters flag deploys a bundled II version whose UI
differs from the release-2025-08-29 version the e2e tests expect.
Re-deploy the project's pinned II after bootstrap so the captcha-based
registration flow is available for e2e tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aterga aterga force-pushed the arshavir/use-dfx-system-canisters branch from 410d78d to d2bd528 Compare April 14, 2026 11:30
…d frontend

The upgrade mode preserves the stable memory and frontend assets from
the system-bootstrapped II, which doesn't have the captcha-based
registration UI that the e2e tests expect. Using reinstall does a clean
install with the project's pinned II wasm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aterga aterga requested a review from sea-snake April 14, 2026 17:18
- Use get_replica_url() instead of hardcoded localhost URL
- Add retry loop and validation for topology fetch
- Add --network local to all dfx calls to guard against non-local usage
- Fix README wording: "local replica" → "PocketIC"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@aterga aterga left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aterga aterga merged commit 7332096 into main Apr 24, 2026
52 of 53 checks passed
@aterga aterga deleted the arshavir/use-dfx-system-canisters branch April 24, 2026 10:10
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.

3 participants