From 83a5dd687326a9696e34a821ed1fce153b062ee5 Mon Sep 17 00:00:00 2001 From: Jessie Mongeon Date: Mon, 9 Sep 2024 15:51:40 -0500 Subject: [PATCH] Remove large Wasm --- .../smart-contracts/deploy/larger-wasm.mdx | 25 ------------------- .../smart-contracts/install.mdx | 13 ++++++++++ plugins/utils/redirects.js | 2 ++ sidebars.js | 1 - 4 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 docs/developer-docs/smart-contracts/deploy/larger-wasm.mdx diff --git a/docs/developer-docs/smart-contracts/deploy/larger-wasm.mdx b/docs/developer-docs/smart-contracts/deploy/larger-wasm.mdx deleted file mode 100644 index 2f88184d78..0000000000 --- a/docs/developer-docs/smart-contracts/deploy/larger-wasm.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -keywords: [large wasm, intermediate, tutorial] ---- - -import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; - -# Large web assembly modules - - - -## Overview - -The size of programs that can be installed on ICP is currently limited to 2MB. -WebAssembly modules that are (slightly) larger than 2MB can still be installed on ICP by using gzip file compression before uploading; ICP will then decompress the file and install the contained WebAssembly module. - -## Installing a gzip-compressed WebAssembly module - -The WebAssembly module is compressed using `gzip` and then uploaded by `dfx install`, you may need to add `--mode reinstall` or `--mode upgrade` when uploading the module to an existing canister. - -``` bash -gzip my-canister.wasm -dfx canister install my-canister --wasm my-canister.wasm.gz -``` - -Compression is currently not supported by `dfx deploy`. diff --git a/docs/developer-docs/smart-contracts/install.mdx b/docs/developer-docs/smart-contracts/install.mdx index a06abb3b9b..8ef496b831 100644 --- a/docs/developer-docs/smart-contracts/install.mdx +++ b/docs/developer-docs/smart-contracts/install.mdx @@ -37,6 +37,19 @@ Creating a canister on the mainnet will cost [cycles](/docs/current/developer-do At this step, settings can be configured for the canister using the optional flags. [View the full list of settings that can be configured](/docs/current/developer-docs/developer-tools/cli-tools/cli-reference/dfx-canister#options-1). +## Installing a gzip-compressed WebAssembly module + +The size of programs that can be installed on ICP is currently limited to 2 MiB. +WebAssembly modules that are (slightly) larger than 2 MiB can still be installed on ICP by using gzip file compression before uploading; ICP will then decompress the file and install the contained WebAssembly module. + +The WebAssembly module is compressed using `gzip` and then uploaded by `dfx install`, you may need to add `--mode reinstall` or `--mode upgrade` when uploading the module to an existing canister. + +``` bash +gzip my-canister.wasm +dfx canister install my-canister --wasm my-canister.wasm.gz +``` + +Compression is currently not supported by `dfx deploy`. ## Troubleshooting diff --git a/plugins/utils/redirects.js b/plugins/utils/redirects.js index c2b2f32461..d197e68b8a 100644 --- a/plugins/utils/redirects.js +++ b/plugins/utils/redirects.js @@ -595,6 +595,8 @@ const redirects = ` /docs/current/developer-docs/getting-started/ /docs/current/developer-docs/getting-started/overview-of-icp /docs/current/developer-docs/defi/wallets/workflow /docs/current/developer-docs/defi/wallets/overview /docs/current/developer-docs/backend/rust/infrastructure /docs/current/developer-docs/backend/rust/ + /docs/current/developer-docs/smart-contracts/deploy/larger-wasm /docs/current/developer-docs/smart-contracts/install + ` .split(/[\r\n]+/) diff --git a/sidebars.js b/sidebars.js index 9a145a013b..8ac8f52787 100644 --- a/sidebars.js +++ b/sidebars.js @@ -138,7 +138,6 @@ const sidebars = { id: "developer-docs/smart-contracts/deploy/overview", }, "developer-docs/smart-contracts/deploy/custom-testnets", - "developer-docs/smart-contracts/deploy/larger-wasm", "developer-docs/smart-contracts/deploy/sharing", ], },