docs: canister lifecycle guide#28
Conversation
Cover the full canister lifecycle: creation, building, installation, deployment, canister states, upgrades with state persistence (Motoko persistent actors and Rust stable structures), reinstallation, deletion, programmatic canister management via the management canister, canister history, trapping/error handling, and Wasm size limits. All code snippets verified against .sources/ (motoko, cdk-rs, examples). All CLI commands verified against icp-cli docs/reference/cli.md.
ReviewMust fix
Suggestions
Verified correct
|
- Fix HashMap → Map.empty() in transient Cache example (mo:core has no HashMap) - Add subnet migration section with icp canister migrate-id - Remove incorrect claim about icp deploy not restarting stopped canisters (v0.2.1 now stops before upgrade and restarts after) - Add caller to factory controllers (matches upstream example) - Clarify cycles refund goes to the controller who made the delete request - Clarify canister history retains at least 20 most recent changes - Document that --mode upgrade is rarely needed (auto handles it) - Add stop/restart steps to upgrade sequence
|
Feedback addressed:
|
Explain why migration is needed, the two approaches (snapshot transfer vs full migration), and when preserving the canister ID matters. Link to the comprehensive icp-cli migration guide for procedures.
The check-upstream-notes workflow expects <!-- Upstream: ... -->, not <!-- Sync recommendation: ... -->.
Summary
.sources/(cdk-rs, motoko, motoko-core, examples, icp-cli)Sync recommendation
informed by dfinity/portal — docs/building-apps/canister-management/, docs/building-apps/developing-canisters/+dfinity/icp-cli — docs/concepts/build-deploy-sync.md, docs/guides/canister-migration.md