构建PoE去中心化应用底层教程错误:无法编译"sp-arithmetic" &g



我正在遵循构建PoE分散应用程序教程。我成功地完成了构建你的第一个基板链教程。我将基板更新到2.0.1,它使第一个教程工作完美。现在,当我使用2.0.1时,它修复了一个错误代码,但我仍然有一些。这是我的日志:

$ WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo run --release -- --dev --tmp
warning: TOML file found which contains invalid syntax and will soon not parse
at `palletstemplateCargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
warning: TOML file found which contains invalid syntax and will soon not parse
at `palletstemplateCargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
Compiling substrate-prometheus-endpoint v0.8.1
Compiling hyper-rustls v0.21.0
Compiling node-template-runtime v2.0.1 (C:Usersmatthsubstrate-node-templateruntime)
Compiling libp2p-websocket v0.23.0
Compiling libp2p-mplex v0.22.0
Compiling libp2p-wasm-ext v0.22.0
Compiling libp2p-plaintext v0.22.0
Compiling libp2p-yamux v0.25.0
Compiling libp2p-dns v0.22.0
Compiling libp2p-noise v0.24.0
Compiling libp2p-tcp v0.22.0
Compiling libp2p-request-response v0.3.0
Compiling libp2p-ping v0.22.0
Compiling libp2p-identify v0.22.0
Compiling libp2p-kad v0.23.0
Compiling libp2p-mdns v0.22.0
Compiling libp2p-gossipsub v0.22.0
Compiling libp2p-floodsub v0.22.0
Compiling sc-proposer-metrics v0.8.1
Compiling sp-io v2.0.1
Compiling libp2p v0.28.1
Compiling sc-telemetry v2.0.1
Compiling sc-peerset v2.0.1
Compiling sp-application-crypto v2.0.1
Compiling sc-tracing v2.0.1
Compiling sp-runtime v2.0.1
Compiling sc-keystore v2.0.1
error: failed to run custom build command for `node-template-runtime v2.0.1 (C:Usersmatthsubstrate-node-templateruntime)`
Caused by:
process didn't exit successfully: `C:Usersmatthsubstrate-node-templatetargetreleasebuildnode-template-runtime-76c37493ab0ba7f5build-script-build` (exit code: 1)
--- stdout
Information that should be included in a bug report.
Executing build command: "rustup" "run" "nightly-2020-10-05" "cargo" "-Zfeatures=build_dep" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=C:\Users\matth\substrate-node-template\target\release\wbuild\node-template-runtime\Cargo.toml" "--color=always" "--release"
Using rustc version: rustc 1.49.0-nightly (beb5ae474 2020-10-04)

--- stderr
warning: TOML file found which contains invalid syntax and will soon not parse
at `C:Usersmatthsubstrate-node-templatepalletstemplateCargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
warning: TOML file found which contains invalid syntax and will soon not parse
at `C:Usersmatthsubstrate-node-templatepalletstemplateCargo.toml`.
The TOML spec requires that each table header is defined at most once, but
historical versions of Cargo have erroneously accepted this file. The table
definitions will need to be merged together with one table header to proceed,
and this will become a hard error in the future.
Compiling substrate-wasm-builder v3.0.0
Compiling node-template-runtime v2.0.1 (C:Usersmatthsubstrate-node-templateruntime)
Compiling pallet-template v2.0.1 (C:Usersmatthsubstrate-node-templatepalletstemplate)
Compiling pallet-grandpa v2.0.1
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:18:1
|
18 | / decl_event! {
19 | |     pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | |         /// Event emitted when a proof has been claimed. [who, claim]
21 | |         ClaimCreated(AccountId, Vec<u8>),
...  |
24 | |     }
25 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:18:1
|
18 | / decl_event! {
19 | |     pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | |         /// Event emitted when a proof has been claimed. [who, claim]
21 | |         ClaimCreated(AccountId, Vec<u8>),
...  |
24 | |     }
25 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:42:1
|
42 | / decl_storage! {
43 | |     trait Store for Module<T: Trait> as TemplateModule {
44 | |         /// The storage item for our proofs.
45 | |         /// It maps a proof to the user who made the claim and when they made it.
46 | |         Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | |     }
48 | | }
| |_^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: Error { inner: ErrorInner { kind: DuplicateTable("dependencies"), line: Some(29), col: 0, at: Some(951), message: "", key: ["dependencies"] } }
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: maybe a missing crate `sp_api_hidden_includes_decl_storage`?
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:42:1
|
42 | / decl_storage! {
43 | |     trait Store for Module<T: Trait> as TemplateModule {
44 | |         /// The storage item for our proofs.
45 | |         /// It maps a proof to the user who made the claim and when they made it.
46 | |         Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | |     }
48 | | }
| |_^ maybe a missing crate `sp_api_hidden_includes_decl_storage`?
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:18:1
|
18 | / decl_event! {
19 | |     pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | |         /// Event emitted when a proof has been claimed. [who, claim]
21 | |         ClaimCreated(AccountId, Vec<u8>),
...  |
24 | |     }
25 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:18:1
|
18 | / decl_event! {
19 | |     pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
20 | |         /// Event emitted when a proof has been claimed. [who, claim]
21 | |         ClaimCreated(AccountId, Vec<u8>),
...  |
24 | |     }
25 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type `Encode`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:42:1
|
42 | / decl_storage! {
43 | |     trait Store for Module<T: Trait> as TemplateModule {
44 | |         /// The storage item for our proofs.
45 | |         /// It maps a proof to the user who made the claim and when they made it.
46 | |         Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | |     }
48 | | }
| |_^ use of undeclared type `Encode`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^ use of undeclared crate or module `_parity_scale_codec`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:21:22
|
21 |         ClaimCreated(AccountId, Vec<u8>),
|                      ^^^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3  | use codec::Decode;
|
3  | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:21:33
|
21 |         ClaimCreated(AccountId, Vec<u8>),
|                                 ^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3  | use codec::Decode;
|
3  | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:23:22
|
23 |         ClaimRevoked(AccountId, Vec<u8>),
|                      ^^^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3  | use codec::Decode;
|
3  | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:23:33
|
23 |         ClaimRevoked(AccountId, Vec<u8>),
|                                 ^^^^^^^ not found in `_parity_scale_codec`
|
help: consider importing one of these items
|
3  | use codec::Decode;
|
3  | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: maybe a missing crate `sp_api_hidden_includes_decl_storage`?
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:42:1
|
42 | / decl_storage! {
43 | |     trait Store for Module<T: Trait> as TemplateModule {
44 | |         /// The storage item for our proofs.
45 | |         /// It maps a proof to the user who made the claim and when they made it.
46 | |         Proofs: map hasher(blake2_128_concat) Vec<u8> => (T::AccountId, T::BlockNumber);
47 | |     }
48 | | }
| |_^ not found in `self::sp_api_hidden_includes_decl_storage::hidden_include::metadata`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this enum
|
3  | use frame_support::error::DecodeDifferent;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^ not found in `_parity_scale_codec`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
3   | use codec::Decode;
|
3   | use frame_support::dispatch::Decode;
|
error[E0433]: failed to resolve: use of undeclared crate or module `_parity_scale_codec`
--> C:Usersmatthsubstrate-node-templatepalletstemplatesrclib.rs:53:1
|
53  | / decl_module! {
54  | |     pub struct Module<T: Trait> for enum Call where origin: T::Origin {
55  | |         // Errors must be initialized if they are used by the pallet.
56  | |         type Error = Error<T>;
...   |
105 | |     }
106 | | }
| |_^ not found in `_parity_scale_codec`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
3   | use codec::Decode;
|
3   | use frame_support::dispatch::Decode;
|
error: aborting due to 18 previous errors
For more information about this error, try `rustc --explain E0433`.
error: could not compile `pallet-template`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
warning: build failed, waiting for other jobs to finish...
error: build failed
$ rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:Usersmatth.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc
nightly-2020-10-05-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-msvc
installed targets for active toolchain
--------------------------------------
wasm32-unknown-unknown
x86_64-pc-windows-msvc
active toolchain
----------------
nightly-2020-10-05-x86_64-pc-windows-msvc (default)
rustc 1.49.0-nightly (beb5ae474 2020-10-04)

NukeManDan提供的答案应该可以正常工作。而且,我想cargo update -p <package_name>应该也能做到。

最新更新