Skip to content

Commit db02f52

Browse files
committed
fix doc + dockerfiles
1 parent 1367c34 commit db02f52

File tree

7 files changed

+28
-46
lines changed

7 files changed

+28
-46
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LABEL ai.opentensor.image.authors="[email protected]" \
1818

1919
# Rust targets
2020
RUN rustup update stable && \
21-
rustup target add wasm32-unknown-unknown --toolchain stable
21+
rustup target add wasm32v1-none --toolchain stable
2222

2323
# Build prerequisites
2424
ENV RUST_BACKTRACE=1

Dockerfile-localnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ WORKDIR /build
2727
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
2828
ENV PATH="/root/.cargo/bin:${PATH}"
2929
RUN rustup toolchain install
30-
RUN rustup target add wasm32-unknown-unknown
30+
RUN rustup target add wasm32v1-none
3131

3232
## Build fast-blocks node
3333
RUN ./scripts/localnet.sh --build-only

docs/consensus.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,10 @@ ssh -L 8888:localhost:8888 root@<your_vps_ip_address> -p <your_vps_port> -i ~/.s
297297
```bash
298298
sudo apt-get update && sudo apt install -y build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler python3 python3-pip \
299299
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
300-
&& source ~/.cargo/env && rustup default stable && rustup update \
301-
&& rustup target add wasm32-unknown-unknown \
302-
&& rustup toolchain install nightly \
303-
&& rustup target add --toolchain nightly wasm32-unknown-unknown
304-
300+
&& source ~/.cargo/env \
301+
&& rustup default stable \
302+
&& rustup update \
303+
&& rustup target add wasm32v1-none
305304
```
306305

307306
3. **Clone the Subtensor repository and checkout the relevant branch:**

docs/rust-setup.md

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Installation
33
---
44
This guide is for reference only, please check the latest information on getting starting with Substrate
5-
[here](https://docs.polkadot.com/main-docs/install/).
5+
[here](https://docs.polkadot.com/develop/parachains/install-polkadot-sdk/).
66

77
This page will guide you through the **2 steps** needed to prepare a computer for **Substrate** development.
88
Since Substrate is built with [the Rust programming language](https://www.rust-lang.org/), the first
@@ -65,18 +65,15 @@ Open the Terminal application and execute the following commands:
6565
# Install Homebrew if necessary https://brew.sh/
6666
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
6767

68-
# Make sure Homebrew is up-to-date, install openssl
68+
# Make sure Homebrew is up-to-date, install protobuf and openssl
6969
brew update
70-
brew install openssl
70+
brew install protobuf openssl
7171
```
7272

7373
### Windows
7474

7575
**_PLEASE NOTE:_** Native Windows development of Substrate is _not_ very well supported! It is _highly_
76-
recommend to use [Windows Subsystem Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
77-
(WSL) and follow the instructions for [Ubuntu/Debian](#ubuntudebian).
78-
Please refer to the separate
79-
[guide for native Windows development](https://docs.polkadot.com/main-docs/install/windows/).
76+
recommend to use [Windows Subsystem Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (WSL) and follow the following [instructions](https://docs.polkadot.com/develop/parachains/install-polkadot-sdk/#windows-wsl).
8077

8178
## Rust developer environment
8279

@@ -90,13 +87,12 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
9087
source ~/.cargo/env
9188
```
9289

93-
Configure the Rust toolchain to default to the latest stable version, add nightly and the nightly wasm target:
90+
Configure the Rust toolchain to default to the latest stable version:
9491

9592
```bash
9693
rustup default stable
9794
rustup update
98-
rustup update nightly
99-
rustup target add wasm32-unknown-unknown --toolchain nightly
95+
rustup target add wasm32v1-none
10096
```
10197

10298
## Test your set-up
@@ -125,38 +121,26 @@ rustup home: /home/user/.rustup
125121
126122
installed toolchains
127123
--------------------
128-
129124
stable-x86_64-unknown-linux-gnu (default)
130-
nightly-2020-10-06-x86_64-unknown-linux-gnu
131125
nightly-x86_64-unknown-linux-gnu
132126
133-
installed targets for active toolchain
134-
--------------------------------------
135-
136-
wasm32-unknown-unknown
137-
x86_64-unknown-linux-gnu
138-
139127
active toolchain
140128
----------------
141-
142-
stable-x86_64-unknown-linux-gnu (default)
143-
rustc 1.50.0 (cb75ad5db 2021-02-10)
129+
name: stable-x86_64-unknown-linux-gnu
130+
active because: it's the default toolchain
131+
installed targets:
132+
x86_64-unknown-linux-gnu
133+
wasm32v1-none
144134
```
145135

146136
As you can see above, the default toolchain is stable, and the
147-
`nightly-x86_64-unknown-linux-gnu` toolchain as well as its `wasm32-unknown-unknown` target is installed.
148-
You also see that `nightly-2020-10-06-x86_64-unknown-linux-gnu` is installed, but is not used unless explicitly defined as illustrated in the [specify your nightly version](#specifying-nightly-version)
137+
`stable-x86_64-unknown-linux-gnu` toolchain as well as its `wasm32v1-none` target is installed.
138+
You also see that `nightly-x86_64-unknown-linux-gnu` is installed, but is not used unless explicitly defined as illustrated in the [specify your nightly version](#specifying-nightly-version)
149139
section.
150140

151141
### WebAssembly compilation
152142

153-
Substrate uses [WebAssembly](https://webassembly.org) (Wasm) to produce portable blockchain
154-
runtimes. You will need to configure your Rust compiler to use
155-
[`nightly` builds](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) to allow you to
156-
compile Substrate runtime code to the Wasm target.
157-
158-
> There are upstream issues in Rust that need to be resolved before all of Substrate can use the stable Rust toolchain.
159-
> [This is our tracking issue](https://github.com/paritytech/substrate/issues/1252) if you're curious as to why and how this will be resolved.
143+
Substrate uses [WebAssembly](https://webassembly.org) (Wasm) to produce portable blockchain runtimes.
160144

161145
#### Latest nightly for Substrate `master`
162146

@@ -168,7 +152,7 @@ To ensure your Rust compiler is always up to date, you should run:
168152
```bash
169153
rustup update
170154
rustup update nightly
171-
rustup target add wasm32-unknown-unknown --toolchain nightly
155+
rustup target add wasm32v1-none --toolchain nightly
172156
```
173157

174158
> NOTE: It may be necessary to occasionally rerun `rustup update` if a change in the upstream Substrate
@@ -197,7 +181,7 @@ rustup install nightly-<yyyy-MM-dd>
197181
Now, configure the nightly version to work with the Wasm compilation target:
198182

199183
```bash
200-
rustup target add wasm32-unknown-unknown --toolchain nightly-<yyyy-MM-dd>
184+
rustup target add wasm32v1-none --toolchain nightly-<yyyy-MM-dd>
201185
```
202186

203187
### Specifying nightly version
@@ -220,6 +204,6 @@ specific nightly version, follow these steps:
220204
```bash
221205
rustup uninstall nightly
222206
rustup install nightly-<yyyy-MM-dd>
223-
rustup target add wasm32-unknown-unknown --toolchain nightly-<yyyy-MM-dd>
207+
rustup target add wasm32v1-none --toolchain nightly-<yyyy-MM-dd>
224208
```
225209

scripts/init.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ set -e
55
echo "*** Initializing WASM build environment"
66

77
if ! (( ${#CI_PROJECT_NAME} )) ; then
8-
rustup update nightly
98
rustup update stable
109
fi
1110

12-
rustup target add wasm32-unknown-unknown --toolchain nightly
11+
rustup target add wasm32v1-none

scripts/install_rust.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y
3636
source "$HOME/.cargo/env"
3737
rustup default stable
3838

39-
rustup update nightly
40-
rustup target add wasm32-unknown-unknown --toolchain nightly
39+
rustup update
40+
rustup target add wasm32v1-none
4141

4242
echo "*** Rust installation complete"

shell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ let
1313
rev = "1fe6ed37fd9beb92afe90671c0c2a662a03463dd";
1414
};
1515
nixpkgs = import pinned { overlays = [ mozillaOverlay ]; };
16-
toolchain = with nixpkgs; (rustChannelOf { date = "2021-09-14"; channel = "nightly"; });
16+
toolchain = with nixpkgs; (rustChannelOf { date = "2025-06-23"; channel = "stable"; });
1717
rust-wasm = toolchain.rust.override {
18-
targets = [ "wasm32-unknown-unknown" ];
18+
targets = [ "wasm32v1-none" ];
1919
};
2020
in
2121
with nixpkgs; pkgs.mkShell {

0 commit comments

Comments
 (0)