🥷 Try it live — no local setup. ICP Ninja is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit Deploy if you're already in Ninja. To build and run it locally instead, follow the steps below.
This backend-only project demonstrates how to write a simple canister for ICP using Wasm64 compilation target.
This example specifically showcases building and deploying canisters compiled to the Wasm64 target, which provides access to 64-bit memory addressing and can handle larger memory spaces compared to the traditional Wasm32 target.
The Wasm64 target allows canisters to:
- Access larger memory spaces (up to 6GiB, compared to the 4GiB limit of Wasm32)
- Use 64-bit memory addressing
This example uses the build.sh script to build for Wasm64 using Rust's nightly toolchain and the -Z build-std feature.
- Node.js v18+
- icp-cli:
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm - Rust with nightly toolchain (installed automatically by
build.sh)
Clone the example project:
git clone https://github.com/dfinity/examples
cd examples/rust/backend_wasm64Start the local network:
icp network start -dDeploy the canister:
icp deployRun the tests:
bash test.shStop the local network when done:
icp network stopIf you base your application on this example, it is recommended that you familiarize yourself with and adhere to the security best practices for developing on ICP. This example may not implement all the best practices.