编译基板add-a-托盘失败



当我遵循最新的基质教程add-a- palette时,我得到了编译错误。编译器抱怨绑定错误u128类型不满足事件。使用rustc版本:rustc 1.57.0-nightly (54bb4fec6 2021-10-08)

Compiling node-template-runtime v3.0.0-monthly-2021-10 (/home/bruce/substrate-node-template/runtime)
error: failed to run custom build command for `node-template-runtime v3.0.0-monthly-2021-10 (/home/bruce/substrate-node-template/runtime)`
Caused by:
process didn't exit successfully: `/home/bruce/substrate-node-template/target/release/build/node-template-runtime-41f26d4f5bdef0b7/build-script-build` (exit status: 1)
--- stdout
Information that should be included in a bug report.
Executing build command: "rustup" "run" "nightly" "cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/home/bruce/substrate-node-template/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" "--release"
Using rustc version: rustc 1.57.0-nightly (54bb4fec6 2021-10-08)

--- stderr
Compiling node-template-runtime v3.0.0-monthly-2021-10 (/home/bruce/substrate-node-template/runtime)
error[E0277]: the trait bound `u128: Currency<AccountId32>` is not satisfied in `Event`
--> /home/bruce/substrate-node-template/runtime/src/lib.rs:303:1
|
303 | / construct_runtime!(
304 | |     pub enum Runtime where
305 | |         Block = Block,
306 | |         NodeBlock = opaque::Block,
...   |
320 | |     }
321 | | );
| |__^ within `Event`, the trait `Currency<AccountId32>` is not implemented for `u128`
|
note: required because it appears within the type `Event`
error: could not compile `node-template-runtime` due to 10 previous errors

Substrate Node Template不能在任何版本的Rust编译器上编译。我建议:

  1. executeinit.shscript inscriptsdirectory

  2. 我这边的工作版本如下:

    stable-x86_64-unknown-linux-gnu

  3. rustup default stable-x86_64-unknown-linux-gnu

应用这两个建议后,您应该能够编译源代码。

最新更新