0

I got this error after trying to install the substrate-contract-node :

1) I download rustc

rustc --version
rustc 1.75.0 (82e1608df 2023-12-21)

2) I cloned the repo

I followed the instruction to install substrate-contract-node here

git clone https://github.com/substrate-developer-hub/substrate-node-template

3) then I tried to compile the repo by this commands

git switch -c my-wip-branch
cargo build --release

and then I got this long error

failed to run custom build command for `sc-network-light v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2f)`

Caused by:
  process didn't exit successfully: `/home/mohamed/substrate-node-template/target/release/build/sc-network-light-0fea2d72bbd5faeb/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /home/mohamed/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-build-0.11.9/src/lib.rs:1457:10:
  Could not find `protoc` installation and this build crate cannot proceed without
      this knowledge. If `protoc` is installed and this crate had trouble finding
      it, you can set the `PROTOC` environment variable with the specific path to your
      installed `protoc` binary.If you're on debian, try `apt-get install protobuf-compiler` or download it from https://github.com/protocolbuffers/protobuf/releases

  For more information: https://docs.rs/prost-build/#sourcing-protoc

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

so how can I fix this issue ?

1
  • You need to install the protobuf compiler for your system. Commented Feb 1 at 19:25

1 Answer 1

1

As mentioned in the comment, it seems your system is missing the protobuf compiler. You need to get it for your OS. You can look at the setup here for the necessary packages before compiling : https://github.com/paritytech/extended-parachain-template/blob/main/docs/rust-setup.md

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.