Skip to content

chore: migrate encrypted_notes_app_vetkd to icp CLI and @icp-sdk/vetkeys#1354

Draft
marc0olo wants to merge 11 commits into
masterfrom
chore/vetkeys-encrypted-notes-app-vetkd-migration
Draft

chore: migrate encrypted_notes_app_vetkd to icp CLI and @icp-sdk/vetkeys#1354
marc0olo wants to merge 11 commits into
masterfrom
chore/vetkeys-encrypted-notes-app-vetkd-migration

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented May 29, 2026

Summary

  • Renames `encrypted_notes_dapp_vetkd` → `encrypted_notes_app_vetkd`
  • Drops `dfx.json` in favor of `icp.yaml` for both Rust and Motoko backends
  • Migrates frontend from Svelte 3 + Rollup to Svelte 4 + Vite
  • Replaces `@dfinity/` with `@icp-sdk/` (auth 7.1.0, core 5.4.0, vetkeys 0.5.0-beta.0)
  • Drops ICP Ninja support (dfx.json removal breaks it; README updated)
  • Adds 4-job CI workflow (Rust + Motoko × Darwin + Linux)
  • Adds --yes flag to npx @icp-sdk/bindgen in gen_bindings.sh to suppress install prompt
  • Renames CI job keys from rust-vetkeys-{example}-{language}-{platform} to {language}-{example}-{platform} for clarity
  • Closes vetkeys examples: migrate to icp-cli, @icp-sdk/vetkeys 0.5.0-beta.0, and @icp-sdk/core #1343

Notes

  • Neither backend uses the `ic-vetkeys` library — both call the VetKD management canister API directly, so no Cargo.toml or mops dependency bumps were needed
  • The Motoko backend already uses `persistent actor class` (handles EOP natively)
  • `svelte-router-spa` kept (Svelte 4 compatible) to avoid rewriting routing logic

Test plan

  • `icp network start -d && icp deploy` succeeds in `rust/` folder
  • `icp network start -d && icp deploy` succeeds in `motoko/` folder
  • Frontend builds with `npm run build` from `frontend/`
  • CI workflow triggers and all 4 jobs pass

🤖 Generated with Claude Code

marc0olo and others added 11 commits May 29, 2026 14:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_ROOT_KEY

- Remove rust-toolchain channel pin and profile
- Bump ic-cdk to 0.20.1 and add ic-cdk-management-canister 0.1.1
- Update ic_cdk::management_canister imports to ic_cdk_management_canister
- Fix ic_root_key -> IC_ROOT_KEY in actor.ts (CanisterEnv type uses uppercase)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use pwd -P in gen_bindings.sh to resolve paths correctly through symlinks
- Change npm ci to npm install --include=dev (no package-lock.json committed)
- Add base = "0.11.2" to motoko/mops.toml so mo:base imports resolve

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
svelte-router-spa@6.0.3 declares a peer dep on svelte@^3 but the
frontend uses svelte 4. Adding --legacy-peer-deps allows npm to
install without strict peer dep enforcement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bindgen generates the output file named after the input DID file.
The Rust backend DID is encrypted_notes_rust.did, so the generated
binding is encrypted_notes_rust.did.ts — not backend.did.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…efix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change test_key_1 → key_1 in all icp.yaml: icp-cli 0.2.7 only
  provisions vetkd:Bls12_381_G2:key_1 (TestThresholdKeys subnet with
  test_key_1 is not yet supported by icp-cli). The vetkeys library
  itself uses key_1 in its own icp.yaml files.
- Add --yes flag to npx @icp-sdk/bindgen to suppress the install
  confirmation prompt during local builds
- basic_ibe: wrap event listeners in try-catch so errors are caught
  and shown (not silent unhandled rejections); add console.error()
  alongside alert() so errors are visible and copyable in DevTools

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace manual Actor.createActor(idlFactory, ...) with the generated
createActor(canisterId, { agent }) function and typed Backend wrapper
class from the bindgen-generated declarations. Removes direct imports
of idlFactory, Actor, and ActorSubclass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
encrypted_notes_rust.did.ts is the IDL-only file (no createActor).
The TypeScript wrapper with createActor and Backend is at
encrypted_notes_rust.ts — imported without the .did suffix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Folder Structure section explaining rust/, motoko/, frontend/ layout
  and why backends are in subdirectories (shared frontend via symlinks)
- Replace vague "from the X folder" wording with explicit `cd X` commands
- Fix `npm run dev` → `npm run dev:rust` / `npm run dev:motoko` (bare
  `dev` script intentionally errors with a "specify a backend" message)
- Add `cd frontend` before all dev commands (package.json is in frontend/,
  not at the example root)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

vetkeys examples: migrate to icp-cli, @icp-sdk/vetkeys 0.5.0-beta.0, and @icp-sdk/core

1 participant