Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust install instructions #3456

Merged
merged 8 commits into from
Sep 16, 2024
30 changes: 20 additions & 10 deletions docs/developer-docs/getting-started/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ Download and install the latest version of [dfx](install/index.mdx). `dfx` is a
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
```

:::info
For Kybra projects, you will need to install `dfx` version `0.19.0` or newer, and you must run all `dfx` commands in a Python virtual environment.
:::

### Install [Node.js](https://nodejs.org/en/download)

```bash
Expand All @@ -91,9 +87,10 @@ dfx start
This command starts a local instance of the ICP <GlossaryTooltip>replica</GlossaryTooltip> using a single node testnet. The output will return a dashboard URL that can be used to view information about the local replica:

```
Running dfx start for version 0.15.2
Using the default configuration for the local shared network.
Initialized replica.
Dashboard: http://localhost:35375/_/dashboard
Initialized HTTP gateway.
Replica API running on 127.0.0.1:4943
```

:::info
Expand Down Expand Up @@ -186,6 +183,22 @@ actor {

<TabItem value="rust" label="Rust">

### Install Rust

You will need to install Rust in your environment with the command:

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### Install `wasm32-unknown-unknown` target

ICP smart contracts are compiled into WebAssembly modules. To support this compilation, install the `wasm32-unknown-unknown` target:

```
rustup target add wasm32-unknown-unknown
```

This Rust smart contract has a single function called greet. It is marked as query because it doesn't modify the state of the canister.

The function accepts a name as input and returns a greetings text.
Expand Down Expand Up @@ -231,10 +244,7 @@ export default class {

<AdornedTab value={"python"} label="Python" endAdornment={<BetaChip />}>

Python canisters can be written using the Kybra canister development kit.

To set up a Python virtual environment, follow the [Python installation instructions](/docs/current/developer-docs/backend/python/)

Python canisters can be written using the Kybra canister development kit. [Learn more about setting up Kybra](/docs/current/developer-docs/backend/python/).

The default canister code for Kybra projects contains the following:

Expand Down
Loading