You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4fcdb14
Browse filesBrowse the repository at this point in the historyBrowse files
docs(motoko): align Candid regeneration to mops generate candid backend (#1450)
* docs(motoko): use `mops generate candid backend` for Candid regeneration
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>
* chore(vetkeys): drop unused committed Candid file from password_manager
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>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: motoko/filevault/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,10 @@ npm run dev
40
40
41
41
The `backend/backend.did` file defines the backend canister's public interface. The frontend TypeScript bindings are auto-generated from this file during the frontend build.
42
42
43
-
If you modify the backend's public API, regenerate the `.did` file using the Motoko compiler:
43
+
If you modify the backend's public API, regenerate the `.did` file:
44
44
45
45
```bash
46
-
$(mops toolchain bin moc) --idl -o backend/backend.did backend/app.mo
Copy file name to clipboardExpand all lines: motoko/hello_world/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,10 +62,10 @@ icp network stop
62
62
63
63
The `backend/backend.did` file defines the backend canister's public interface. The frontend TypeScript bindings are auto-generated from this file during the frontend build.
64
64
65
-
If you modify the backend's public API, regenerate the `.did` file using the Motoko compiler:
65
+
If you modify the backend's public API, regenerate the `.did` file:
66
66
67
67
```bash
68
-
$(mops toolchain bin moc) --idl -o backend/backend.did backend/app.mo
Copy file name to clipboardExpand all lines: motoko/superheroes/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,10 @@ npm run dev
40
40
41
41
The `backend/backend.did` file defines the backend canister's public interface. The frontend TypeScript bindings are auto-generated from this file during the frontend build.
42
42
43
-
If you modify the backend's public API, regenerate the `.did` file using the Motoko compiler:
43
+
If you modify the backend's public API, regenerate the `.did` file:
44
44
45
45
```bash
46
-
$(mops toolchain bin moc) --idl -o backend/backend.did backend/app.mo
Copy file name to clipboardExpand all lines: motoko/vetkeys/encrypted_notes_app_vetkd/README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,14 @@ A single Motoko canister that stores encrypted notes. It is deployed automatical
56
56
57
57
A **Svelte** application providing a user-friendly interface for managing encrypted notes. Canister bindings are generated from `backend/backend.did` at build time by the `@icp-sdk/bindgen` Vite plugin.
58
58
59
+
## Updating the Candid interface
60
+
61
+
`backend/backend.did` defines the backend's public interface; the frontend bindings are generated from it during the build. If you change the backend's public API, regenerate it:
62
+
63
+
```bash
64
+
mops generate candid backend
65
+
```
66
+
59
67
## Limitations
60
68
61
69
This example app does not implement key rotation, which is strongly recommended in a production environment.
0 commit comments