Uh oh!
There was an error while loading. Please reload this page.
docs(motoko): align Candid regeneration to mops generate candid backend - #1450
Merged
Conversation
Align the "Updating the Candid interface" instructions across all Motoko examples to use `mops generate candid backend` (the canister name defined in `mops.toml`) instead of the low-level `$(mops toolchain bin moc) --idl -o ...` invocation. Also add the missing section to the two vetkeys examples whose frontends generate bindings from `backend/backend.did` via `@icp-sdk/bindgen` (encrypted_notes_app_vetkd, password_manager_with_metadata). password_manager is intentionally left out — its frontend talks to the backend via the Encrypted Maps client and does not consume the `.did`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mraszyk
approved these changes
Jul 27, 2026
The password_manager frontend talks to the backend purely through the `@icp-sdk/vetkeys` Encrypted Maps client and does not consume `backend/backend.did` (no `@icp-sdk/bindgen`, no generated bindings). Nothing else references the file, and `moc` generates the Candid interface as canister metadata at build time regardless. Remove the committed `backend/backend.did` and the now-unused `candid = "backend/backend.did"` line from `mops.toml`, matching the backend-only convention used elsewhere in the repo. Verified with `icp build` — the built wasm still embeds `icp:public candid:service`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lwshang
approved these changes
Jul 27, 2026
raymondk
approved these changes
Jul 27, 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 freeto 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.
What
Aligns the Updating the Candid interface instructions across all Motoko examples to use the high-level Mops command:
(where
backendis the canister name defined inmops.toml), replacing the older low-level invocation:$(mops toolchain bin moc) --idl -o backend/backend.did backend/app.moSome examples (
evm_block_explorer,ic-pos,llm_chatbot,basic_ibe,basic_bls_signing) already used the new command; this brings the rest in line.Changes
Switched the command in 9 READMEs:
cert-var,daily_planner,filevault,flying_ninja,hello_world,random_maze,superheroes,vetkeys/basic_vetkd,who_am_i. Also dropped the now-inaccurate "using the Motoko compiler" phrasing where present.Added the missing section to two vetkeys examples whose frontends generate bindings from
backend/backend.didvia@icp-sdk/bindgen, so the doc is genuinely required:vetkeys/encrypted_notes_app_vetkdvetkeys/password_manager_with_metadataDropped the unused committed Candid file from
vetkeys/password_manager. Its frontend talks to the backend purely through the@icp-sdk/vetkeysEncrypted Maps client and does not consumebackend/backend.did(no@icp-sdk/bindgen, no generated bindings); nothing else referenced the file. Removed bothbackend/backend.didand thecandid = "backend/backend.did"line inmops.toml, matching the backend-only convention used elsewhere in the repo (backend_only,composite_query,icp_transfer, …).Verified with
icp build: the backend still compiles and the built wasm embeds theicp:public candid:servicemetadata (moc generates the interface at build time regardless of the committed file).🤖 Generated with Claude Code