首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >基板.托盘-尼克斯教程.错误:意外令牌#10993

基板.托盘-尼克斯教程.错误:意外令牌#10993
EN

Stack Overflow用户
提问于 2022-03-08 09:06:36
回答 1查看 71关注 0票数 0

在Cargo.toml中添加了依赖项和特性:$ cargo构建发行版

我怎么才能解决这个问题?

许多错误正在发生:

代码语言:javascript
复制
Compiling node-template-runtime v4.0.0-dev (/home/robert/substrate-node-template/runtime)
   Compiling pallet-nicks v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.17#22d40c76)
error: failed to run custom build command for `node-template-runtime v4.0.0-dev (/home/robert/substrate-node-template/runtime)`

Caused by:
  process didn't exit successfully: `/home/robert/substrate-node-template/target/release/build/node-template-runtime-6e84ec0a3716120c/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/robert/substrate-node-template/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" "--profile" "release"
  Using rustc version: rustc 1.61.0-nightly (38a0b81b1 2022-03-06)


  --- stderr
     Compiling pallet-nicks v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.17#22d40c76)
     Compiling node-template-runtime v4.0.0-dev (/home/robert/substrate-node-template/runtime)
  error: unexpected token
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:326:2
      |
  326 | /     {
  327 | |         /* --snip-- */
  328 | |         Balances: pallet_balances,
  329 | |
  330 | |         /*** Add This Line ***/
  331 | |         Nicks: pallet_nicks,
  332 | |     }
      | |_____^

  error[E0433]: failed to resolve: use of undeclared type `Runtime`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:396:24
      |
  396 |             OpaqueMetadata::new(Runtime::metadata().into())
      |                                 ^^^^^^^ use of undeclared type `Runtime`

  error[E0433]: failed to resolve: use of undeclared type `Aura`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:439:49
      |
  439 |             sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())
      |                                                          ^^^^ use of undeclared type `Aura`

  error[E0433]: failed to resolve: use of undeclared type `Aura`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:443:4
      |
  443 |             Aura::authorities().into_inner()
      |             ^^^^ use of undeclared type `Aura`

  error[E0433]: failed to resolve: use of undeclared type `Grandpa`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:461:4
      |
  461 |             Grandpa::grandpa_authorities()
      |             ^^^^^^^ use of undeclared type `Grandpa`

  error[E0433]: failed to resolve: use of undeclared type `Grandpa`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:465:4
      |
  465 |             Grandpa::current_set_id()
      |             ^^^^^^^ use of undeclared type `Grandpa`

  error[E0433]: failed to resolve: use of undeclared type `System`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:491:4
      |
  491 |             System::account_nonce(account)
      |             ^^^^^^ use of undeclared type `System`

  error[E0433]: failed to resolve: use of undeclared type `TransactionPayment`
     --> /home/robert/substrate-node-template/runtime/src/lib.rs:500:4
      |
  500 |             TransactionPayment::query_info(uxt, len)
      |             ^^^^^^^^^^^^^^^^^^ use of undeclared type `TransactionPayment`

诸若此类

EN

回答 1

Stack Overflow用户

发布于 2022-04-04 09:18:21

当您得到这种类型的链式错误时,很可能您复制了错误的东西,不小心删除了一些重要的元素,例如逗号、分号等等。

确保您没有删除任何重要的内容,然后再试一次。如果不是这样,那就检查这一行,我认为这是关键:

代码语言:javascript
复制
error: unexpected token --> /home/robert/substrate-node-template/runtime/src/lib.rs:326:2 
| 326 | / { 327 | | /* --snip-- / 328 | | Balances: pallet_balances, 329 
| 
| 330 | | /** Add This Line ***/ 331 | | Nicks: pallet_nicks, 332 | | } 
| |_____^
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71392448

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档