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
Copy file name to clipboardExpand all lines: rust/backend_wasm64/README.md
+14-22Lines changed: 14 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -4,39 +4,31 @@ This backend-only project demonstrates how to write a simple smart contract for
4
4
5
5
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.
6
6
7
-
This application's logic is written in [Rust](https://internetcomputer.org/docs/building-apps/developer-tools/cdks/rust/intro-to-rust), a programming language that can be used develop canisters on ICP.
8
-
9
-
## Deploying from ICP Ninja
10
-
11
-
When viewing this project in ICP Ninja, you can deploy it directly to the mainnet for free by clicking "Deploy" in the upper right corner. Open this project in ICP Ninja:
- Access larger memory spaces (up to 6GiB, compared to the 4GiB limit of Wasm32)
20
11
- Use 64-bit memory addressing
21
12
22
-
This example always builds for Wasm64 using Rust's nightly toolchain and the `-Z build-std` feature.
13
+
This example uses the `build.sh` script to build for Wasm64 using Rust's nightly toolchain and the `-Z build-std` feature.
23
14
24
-
## Project structure
15
+
## Deploying from ICP Ninja
25
16
26
-
The `/backend` folder contains the Rust smart contract, which uses the following files:
17
+
When viewing this project in ICP Ninja, you can deploy it directly to the mainnet for free by clicking "Deploy" in the upper right corner. Open this project in ICP Ninja:
27
18
28
-
-`Cargo.toml`, which defines the crate that will form the backend.
29
-
-`lib.rs`, which contains the actual smart contract, and exports its interface.
30
-
- The `build.sh` script that automatically builds for Wasm64 using the nightly toolchain.
To build and deploy this Wasm64 example locally, follow the instructions in the `BUILD.md` file.
23
+
### 1. [Download and install the IC SDK.](https://internetcomputer.org/docs/building-apps/getting-started/install)
24
+
25
+
### 2. Download your project from ICP Ninja using the 'Download files' button on the upper left corner, or [clone the GitHub examples repository.](https://github.com/dfinity/examples/)
26
+
27
+
### 3. Navigate into the project's directory.
28
+
29
+
### 4. Run `dfx start --background --clean && dfx deploy` to deploy the project to your local environment.
30
+
31
+
## Security considerations and best practices
35
32
36
-
The build process will automatically:
37
-
1. Install the Rust nightly toolchain if needed.
38
-
2. Add the `rust-src` component for `build-std`.
39
-
3. Build the canister for the `wasm64-unknown-unknown` target.
40
-
4. Extract the Candid interface.
41
-
5. Prepare the Wasm file for deployment.
33
+
If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices.
0 commit comments