Skip to content

docs(motoko): align Candid regeneration to mops generate candid backend - #1450

Merged
marc0olo merged 2 commits into
masterfrom
docs/motoko-candid-gen-command
Jul 27, 2026
Merged

docs(motoko): align Candid regeneration to mops generate candid backend#1450
marc0olo merged 2 commits into
masterfrom
docs/motoko-candid-gen-command

Conversation

@marc0olo

@marc0olomarc0olo commented Jul 27, 2026

Copy link
Copy Markdown
Member

What

Aligns the Updating the Candid interface instructions across all Motoko examples to use the high-level Mops command:

mops generate candid backend

(where backend is the canister name defined in mops.toml), replacing the older low-level invocation:

$(mops toolchain bin moc) --idl -o backend/backend.did backend/app.mo

Some 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.did via @icp-sdk/bindgen, so the doc is genuinely required:

  • vetkeys/encrypted_notes_app_vetkd
  • vetkeys/password_manager_with_metadata

Dropped the unused committed Candid file from vetkeys/password_manager. Its 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 referenced the file. Removed both backend/backend.did and the candid = "backend/backend.did" line in mops.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 the icp:public candid:service metadata (moc generates the interface at build time regardless of the committed file).

🤖 Generated with Claude Code

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>
@marc0olo
marc0olo requested review from a team as code ownersJuly 27, 2026 15:02
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>
@marc0olo
marc0olo merged commit 4fcdb14 into masterJul 27, 2026
25 checks passed
@marc0olo
marc0olo deleted the docs/motoko-candid-gen-command branch July 27, 2026 15:27
Sign up for freeto 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.

4 participants

@marc0olo@raymondk@lwshang@mraszyk