How to create a substraste chain?

198 views Asked by At

I need HELP

I have two major errors in creating my first substraste chain (cf. https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup)

Error in Installing the Front-End Template

~/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$ yarn install ERROR: [Errno 2] No such file or directory: 'install'

Error in compiling Substrate

cargo build --release error: failed to run custom build command for node-template-runtime v2.0.0 (/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/runtime)

Caused by: process didn't exit successfully: /home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/target/release/build/node-template-runtime-663c8dc25926c960/build-script-build (exit code: 1) --- stdout Executing build command: "rustup" "run" "nightly" "cargo" "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" "--release"

--- stderr Compiling wasm-build-runner-impl v1.0.0 (/home/pclf/Bureau/ETH-BIT/substrate/substrate-node-template/target/release/wbuild-runner/node-template-runtime4021631938540302808) Finished release [optimized] target(s) in 7.49s Running /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 Compiling sp-arithmetic v2.0.0 Compiling sp-io v2.0.0 Compiling sp-inherents v2.0.0 Compiling frame-metadata v12.0.0 Compiling sp-finality-tracker v2.0.0 error[E0282]: type annotations needed --> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 | let accuracy = P::ACCURACY.saturated_into(); | ^^^^^^^^ consider giving accuracy a type ... 1595 | / implement_fixed!( 1596 | | FixedI64,
1597 | | test_fixed_i64, 1598 | | i64, ... | 1601 | | "Fixed Point 64 bits signed, range = [-9223372036.854775808, 9223372036.854775807]", 1602 | | ); | |__- in this macro invocation | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed --> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 | let accuracy = P::ACCURACY.saturated_into(); | ^^^^^^^^ consider giving accuracy a type ... 1604 | / implement_fixed!( 1605 | | FixedI128,
1606 | | test_fixed_i128, 1607 | | i128, ... | 1611 | | [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]_", 1612 | | ); | |__- in this macro invocation | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed --> /home/pclf/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9 | 541 | let accuracy = P::ACCURACY.saturated_into(); | ^^^^^^^^ consider giving accuracy a type ... 1614 | / implement_fixed!( 1615 | | FixedU128,
1616 | | test_fixed_u128, 1617 | | u128, ... | 1621 | | [0.000000000000000000, 340282366920938463463.374607431768211455]_", 1622 | | ); | |__- in this macro invocation | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0282. error: could not compile sp-arithmetic

error: build failed

2

There are 2 answers

0
Ayoung On

First thing first solve the Substrate compiling first. run this scrip

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

When you get the node up and running then start using frontend.

0
Swader On

You can just run yarn in the front end template directory, it will work. But where is the "Is LICENCE public" message coming from? You shouldn't see that. Did you clone the substrate-front-end-template repo or just create the directory? The exact process is:

  • clone it with git clone https://github.com/substrate-developer-hub/substrate-front-end-template
  • enter folder with cd substrate-front-end-template
  • run yarn

As for the Substrate compilation error, please downgrade your nightly to an older version, it happens due to a bug in Rust. Here is how to do that:

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