diff --git a/docs/concepts/build-deploy-sync.md b/docs/concepts/build-deploy-sync.md index f1519299..bde44449 100644 --- a/docs/concepts/build-deploy-sync.md +++ b/docs/concepts/build-deploy-sync.md @@ -95,8 +95,12 @@ When deploying a canister for the first time: When the canister already exists: 1. The existing canister is located by ID -2. New WASM code is **upgraded** (preserving stable memory) -3. Settings are updated if changed +2. The canister is **stopped** (waits for in-flight messages to finish) +3. New WASM code is **upgraded** (preserving stable memory) +4. The canister is **started** again +5. Settings are updated if changed + +Stopping the canister before upgrading ensures no messages are being processed during the code swap, preventing potential data inconsistencies. ## Sync Phase @@ -158,7 +162,7 @@ The `icp deploy` command is a composite command that executes multiple steps in **Subsequent deployments:** - Skip the canister creation - Settings and Canister Environment Variables are applied if they've changed. -- WASM code is upgraded, preserving canister state +- Canisters are stopped, WASM code is upgraded (preserving canister state), then canisters are restarted Unlike `icp canister create` (which prints "already exists" and exits), `icp deploy` silently skips creation for existing canisters and continues with the remaining steps. diff --git a/docs/reference/canister-settings.md b/docs/reference/canister-settings.md index dc0ed6bf..926a697e 100644 --- a/docs/reference/canister-settings.md +++ b/docs/reference/canister-settings.md @@ -111,6 +111,24 @@ settings: wasm_memory_threshold: 512mib ``` +### log_memory_limit + +Maximum memory for storing canister logs. Oldest logs are purged when usage exceeds this limit. + +| Property | Value | +|----------|-------| +| Type | Integer or string with suffix | +| Unit | Bytes (accepts suffixes) | +| Max | 2 MiB | +| Default | 4096 bytes | + +```yaml +settings: + log_memory_limit: 2mib +``` + +Memory values accept suffixes: `kb` (1,000), `kib` (1,024), `mb` (1,000,000), `mib` (1,048,576). Raw byte counts are also accepted. + ### log_visibility Controls who can read canister logs. @@ -176,6 +194,7 @@ canisters: wasm_memory_limit: 1gib wasm_memory_threshold: 512mib log_visibility: controllers + log_memory_limit: 2mib environment_variables: ENV: "production" API_BASE_URL: "https://api.example.com" diff --git a/docs/tutorial.md b/docs/tutorial.md index 21f6226e..7863403a 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -150,7 +150,7 @@ You should see: `("Hello, World!")` The argument format `'("World")'` is [Candid](https://docs.internetcomputer.org/building-apps/interact-with-canisters/candid/candid-concepts) — the interface description language for the Internet Computer. -### Interactive Arguments +### Interactive Mode Don't want to type Candid manually? Omit the argument and icp-cli will prompt you interactively: @@ -160,6 +160,14 @@ icp canister call backend greet You'll see a prompt asking for the `name` parameter — just type `World` and press Enter. This works for any method with any argument types, making it easy to explore canister APIs without memorizing Candid syntax. +You can also omit the method name to get an interactive method picker: + +```bash +icp canister call backend +``` + +This lists all available methods on the canister and lets you select one, which is handy when you're exploring an unfamiliar canister. + ## Stop the Network When you're done: