因为官网给的命令行指令不是win系统的,所有今天安装了一天都没整好,到处查帖子。最终在substrate官网下面找到了项目的github链接,因此用本篇文章记录一下。
1.ink!
git链接:https://github.com/paritytech/cargo-contract
安装指令:
Step 1: rustup component add rust-src
.
Step 2: Install binaryen
in a version >= 99:
apt-get install binaryen
brew install binaryen
pacman -S binaryen
There's only an old version in your distributions package manager? Just use a binary release.
Step 3: cargo install --force cargo-contract
检验:cargo contract -V
2.canvas-node
git地址:https://github.com/paritytech/canvas-node
安装指令:cargo install canvas-node --git https://github.com/paritytech/canvas-node.git --force
If it fails to build/install, add the cargo --locked
flag. The installation process will then use the same versions as the Cargo.lock
in this repository to ensure that the most recent working version of Substrate will be used.
检验:canvas -V
补充:ink!安装之后cargo执行指令和之前有点区别,加了点变化。
cargo contract new my_contract
cargo +nightly contract build
cargo contract check
cargo contract test