如何创建子主题链?

问题描述

我需要帮助

在创建我的第一个主题链时,我有两个主要错误(参见https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup

安装前端模板时发生错误

〜/ Bureau / ETH-BIT / substrate / substrate-front-end-template $ ls许可 package.json公共README.md src yarn.lock pclf @ ubuntu:〜/局/ ETH-BIT / substrate / substrate-front-end-template $ 纱线安装 错误:[Errno 2]没有这样的文件或目录:'install'

编译基板时出错

货物建造-发行版 错误:无法为node-template-runtime v2.0.0 (/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/runtime)

运行自定义生成命令

原因:进程未成功退出/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/target/release/build/node-template-runtime-663c8dc25926c960/build-script-build退出代码:1)--- stdout执行构建命令:“ rustup”“ run” “每晚”“货物”“ rustc”“-target = wasm32-未知-未知” “ --manifest-path = / home / pclf / Bureau / ETH-BIT / substrate / substrate-node-template / target / release / wbuild / node-template-runtime / Cargo.toml”“ --color = always”“ --release“

-stderr 编译wasm-build-runner-impl v1.0.0(/ home / pclf / Bureau / ETH-BIT / substrate / substrate-node-template / target / release / wbuild-runner / node-template-runtime4021631938540302808) 在7.49秒内完成发布[最佳化]目标 运行/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/target/release/wbuild-runner/node-template-runtime4021631938540302808/target/x86_64-unkNown-linux-gnu/release/wasm-build-runner-impl 编译sp算术v2.0.0 编译sp-io v2.0.0 编译sp固有v2.0.0 编译框架元数据v12.0.0 编译sp-finality-tracker v2.0.0错误[E0282]:需要类型注释 -> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 |设精度= P :: ACCURACY.saturated_into(); | 1595 | ^^^^^^^^^^考虑给accuracy一种类型... / Implement_fixed!(1596 | | FixedI64,
1597 | | test_fixed_i64,1598年| | i64,... | 1601 | | “ 固定点64位带符号,范围= [-9223372036.854775808, 9223372036.854775807] ”,1602 | | |); | | __-在此宏调用中 | =注意:此错误源于一个宏(在每晚构建中,请使用-Z macro-backtrace运行以获取更多信息)

错误[E0282]:需要输入类型注释 -> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 |设精度= P :: ACCURACY.saturated_into(); | 1604 | ^^^^^^^^^考虑给accuracy一种类型... / Implement_fixed!(1605 | | FixedI128,
1606 | | test_fixed_i128,1607年| | i128,... | 1611 | | [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727] _“,1612 | | |); | | __-在此宏调用中 | =注意:此错误源于一个宏(在每晚构建中,请使用-Z macro-backtrace运行以获取更多信息)

错误[E0282]:需要输入类型注释 -> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 |设精度= P :: ACCURACY.saturated_into(); | 1614 | ^^^^^^^^^^考虑给accuracy一种类型... / Implement_fixed!(1615 | | FixedU128,
1616 | | test_fixed_u128,1617 | | u128,... | 1621 | | [0.000000000000000000, 340282366920938463463.374607431768211455] _“,1622 | | |); | | __-在此宏调用中 | =注意:此错误源于一个宏(在每晚构建中,请使用-Z macro-backtrace运行以获取更多信息)

错误:由于之前的3个错误而中止

有关此错误的更多信息,请尝试rustc --explain E0282错误:无法编译sp-arithmetic

错误:构建失败

解决方法

您可以只在前端模板目录中运行yarn,它将起作用。但是“许可公开”消息从何而来?你不应该看到那个。您是否克隆了衬底前端模板回购库或仅创建目录?确切的过程是:

  • git clone https://github.com/substrate-developer-hub/substrate-front-end-template克隆它
  • 使用cd substrate-front-end-template进入文件夹
  • 运行yarn

至于Substrate编译错误,请每晚将其降级到较旧的版本,这是由于bug in Rust引起的。这是这样做的方法:

rustup uninstall nightly
rustup install nightly-2020-10-01
rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01
,

首先首先解决Substrate编译。 运行这个脚本

https://github.com/substrate-developer-hub/substrate-node-template/blob/master/scripts/init.sh

当您启动并运行节点后,开始使用前端。