substrate开发配置
- 配置rust环境
rustup default stable
rustup update
使用rustup show命令查看如下:
Default host: x86_64-apple-darwin
rustup home: /Users/0x/.rustup
stable-x86_64-apple-darwin (default)
rustc 1.58.1 (db9d1b20b 2022-01-20)
rustup update nightly
- 为nightly添加rust-src组件,添加WebAssembly(wasm)到target
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
使用rustup show命令查看如下:
Default host: x86_64-apple-darwin
rustup home: /Users/0x/.rustup
installed toolchains
--------------------
stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.58.1 (db9d1b20b 2022-01-20)
- 配置crates.io代理
https://rsproxy.cn/
- 修改~/.cargo/config文件,添加如下内容:
[source.crates-io]
replace-with = 'rsproxy'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true
- 安装ink相关
brew install binaryen
cargo install cargo-contract --vers ^0.16 --force --locked
|