paritytech / substrate-contracts-node

Minimal Substrate node configured for smart contracts via pallet-contracts.
The Unlicense
124 stars 145 forks source link

Unable to install substrate-contracts-node (v0.17.0, v0.18.0) #143

Closed takahser closed 2 years ago

takahser commented 2 years ago

I followed the instructions to install substrate-contracts-node. However, it failed with the following error:

% cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked

    Updating git repository `https://github.com/paritytech/substrate-contracts-node.git`
  Installing contracts-node v0.18.0 (https://github.com/paritytech/substrate-contracts-node.git#10f07a81)
    Updating crates.io index
error: failed to select a version for the requirement `libp2p = "^0.46.1"`
candidate versions found which didn't match: 0.45.1, 0.45.0, 0.44.0, ...
location searched: crates.io index
required by package `sc-cli v0.10.0-dev (https://github.com/paritytech/substrate#74a6370e)`
    ... which satisfies git dependency `sc-cli` (locked to 0.10.0-dev) of package `contracts-node v0.18.0 (/Users/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/10f07a8/node)`

I also tried using a specific tag, e.g.

cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.18.0 --force --locked

but the result was the same for v0.17.0 and v0.18.0. However, on v0.16.0 this error doesn't appear (but another one appears: error[E0658]: default values for const generic parameters are experimental).

I'm using macOS 12.5 (21G72) on a MacBook Pro M1 (14-inch, 2021). Though I tried running it on an Ubuntu machine and the behaviour was the same.

cmichi commented 2 years ago

What version of Rust are you using? You can check by executing rustup show before the install command.

This is the toolchain which works for me locally:

rustc 1.64.0-nightly (2643b1646 2022-07-27)

You could try using the same one by executing rustup override set nightly-2022-07-28 before the install command.

takahser commented 2 years ago

@cmichi thanks, So before I had:

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/xxx/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2021-11-01-x86_64-unknown-linux-gnu (default)
nightly-2021-11-07-x86_64-unknown-linux-gnu
nightly-2022-03-14-x86_64-unknown-linux-gnu
nightly-2022-05-18-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-2021-11-01-x86_64-unknown-linux-gnu (default)
rustc 1.58.0-nightly (ff0e14829 2021-10-31)

But after overriding rustup override set nightly-2022-07-28 and installing rustup target add wasm32-unknown-unknown it worked 🎉 Thanks!