【问题标题】:How to create a substraste chain?如何创建一个底层链?
【发布时间】:2021-02-07 21:02:08
【问题描述】:

我需要帮助

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

安装前端模板时出错

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

编译 Substrate 时出错

cargo build --release 错误:无法为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-unknown-unknown” "--manifest-path=/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/target/release/wbuild/node-template-runtime/Cargo.toml" "--color=always" " --发布”

--- 标准错误 编译 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-arithmetic v2.0.0 编译 sp-io v2.0.0 编译 sp-inherents 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.aturated_into(); | ^^^^^^^^ 考虑给accuracy 一个类型... 1595 | /implement_fixed!( 1596 | | FixedI64,
第1597章| test_fixed_i64, 1598 | | i64, ... | 1601 | | "定点 64 位有符号,范围 = [-9223372036.854775808, 9223372036.854775807]", 1602 | | ); | |__- 在这个宏调用中 | = 注意:此错误源自宏(在 Nightly 构建中,使用 -Z 宏回溯运行以获取更多信息)

错误[E0282]:需要类型注释 --> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 |第541章让准确度 = P::ACCURACY.aturated_into(); | ^^^^^^^^ 考虑给accuracy 一个类型... 1604 | /implement_fixed!( 1605 | | FixedI128,
1606 | | test_fixed_i128, 1607 | | i128, ... | 1611 | | [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]_", 1612 | | ); | |__- 在这个宏调用中 | = 注意:此错误源自宏(在 Nightly 构建中,使用 -Z 宏回溯运行以获取更多信息)

错误[E0282]:需要类型注释 --> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 |第541章让准确度 = P::ACCURACY.aturated_into(); | ^^^^^^^^ 考虑给accuracy 一个类型... 1614 | /implement_fixed!( 1615 | | FixedU128,
1616 | | test_fixed_u128, 1617 | | u128, ... | 1621 | | [0.000000000000000000, 340282366920938463463.374607431768211455]_", 1622 | | ); | |__- 在这个宏调用中 | = 注意:此错误源自宏(在 Nightly 构建中,使用 -Z 宏回溯运行以获取更多信息)

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

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

错误:构建失败

【问题讨论】:

    标签: yarnpkg rust-cargo substrate polkadot


    【解决方案1】:

    你可以在前端模板目录中运行yarn,它会起作用。但是“许可证是否公开”消息从何而来?你不应该看到那个。您是克隆了 substrate-front-end-template repo 还是只是创建了目录?具体流程是:

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

    关于 Substrate 编译错误,请将您的 nightly 版本降级到旧版本,这是由于 bug in Rust 而发生的。以下是如何做到这一点:

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

    【讨论】:

      【解决方案2】:

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

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

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

      【讨论】:

        猜你喜欢
        • 2012-12-15
        • 1970-01-01
        • 2021-03-23
        • 1970-01-01
        • 1970-01-01
        • 2018-12-21
        • 2021-12-07
        • 2020-05-26
        • 2021-07-23
        相关资源
        最近更新 更多