Skip to content

Commit b6c589f

Browse files
Merge pull request #1193 from dfinity/jessiemongeon1-patch-23
standardize README
2 parents 9b4d841 + 5e1b098 commit b6c589f

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

rust/backend_wasm64/README.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,31 @@ This backend-only project demonstrates how to write a simple smart contract for
44

55
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.
66

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:
12-
13-
[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/rust/backend_wasm64)
14-
15-
167
## What is Wasm64?
178

189
The Wasm64 target allows canisters to:
1910
- Access larger memory spaces (up to 6GiB, compared to the 4GiB limit of Wasm32)
2011
- Use 64-bit memory addressing
2112

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.
2314

24-
## Project structure
15+
## Deploying from ICP Ninja
2516

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:
2718

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.
19+
[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/rust/backend_wasm64)
3120

3221
## Build and deploy from the command-line
3322

34-
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
3532

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.
4234

0 commit comments

Comments
 (0)