0

I'm trying to get started with substrate by looking at Substrate Recipes.

I installed rust using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh with WSL with default configuration (stable 1.65 I think) Then I tried building the kitchen node using cargo build --release -p kitchen-node.

Then I ran into multiple compile errors (in sp-arithmetic crate): (for example)

error[E0277]: the trait bound `i128: Bounded` is not satisfied
  --> /home/thecodingwombat/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-3.0.0/src/fixed_point.rs:37:6
   |
37 | impl FixedPointOperand for i128 {}
   |      ^^^^^^^^^^^^^^^^^ the trait `Bounded` is not implemented for `i128`
   |
   = help: the following other types implement trait `Bounded`:
             f32
             f64
             i16
             i32
             i64
             i8
             isize
             u16
           and 4 others
note: required by a bound in `FixedPointOperand`
  --> /home/thecodingwombat/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-3.0.0/src/fixed_point.rs:34:45
   |
34 | pub trait FixedPointOperand: Copy + Clone + Bounded + Zero + Saturating
   |                                             ^^^^^^^ required by this bound in `FixedPointOperand`

What am I doing wrong that this isn't working out of the box? When I use the substrate playground it is working. Am I using the wrong rust version? The compile errors do not give me any insight into what I'm doing wrong.

5
  • Beyond just installing rust, did you also follow all the instructions for other installation prerequisites here: docs.substrate.io/install ?
    – Shawn Tabrizi
    Dec 3, 2022 at 23:04
  • @ShawnTabrizi I think I did. I could already succesfully build and run the substrate-node-template Dec 5, 2022 at 9:05
  • Ah, then it might be that the recipes repo is just old and not compatible with the latest version of Rust or Substrate.
    – Shawn Tabrizi
    Dec 5, 2022 at 15:58
  • Shouldn't it all be backwards compatible? It did work in the online playground thing, but that used a different Rust version indeed. @ShawnTabrizi Dec 5, 2022 at 21:00
  • 1
    Unfortunately rust is not always backwards compatible. You could try installing a version of rust which was available at that time in creating the recipe, but it could be that the old rust project does not work with the latest rust version. I suggest you open an issue to have the specific example you are looking for updated, or perhaps you ask questions on this forum on HOW you can fix the example, and what you tried and stuff.
    – Shawn Tabrizi
    Dec 6, 2022 at 0:38

0

Your Answer

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

Browse other questions tagged or ask your own question.