7

I'm trying to follow this procedure https://docs.substrate.io/tutorials/build-a-blockchain/build-local-blockchain/#start-the-local-node to start the local node. But it always gives me the error:

➜  substrate-node-template git:(my-wip-branch) ./target/release/node-template --dev

2023-04-07 12:59:26 Substrate Node    
2023-04-07 12:59:26 ✌️  version 4.0.0-dev-700c3a186e5    
2023-04-07 12:59:26 ❤️  by Substrate DevHub <https://github.com/substrate-developer-hub>, 2017-2023    
2023-04-07 12:59:26  Chain specification: Development    
2023-04-07 12:59:26   Node name: extra-large-arch-5066    
2023-04-07 12:59:26  Role: AUTHORITY    
2023-04-07 12:59:26  Database: RocksDb at /var/folders/dy/1hb072zd0g1d5ppckgm48ml40000gn/T/substrateekR4s0/chains/dev/db/full    
2023-04-07 12:59:26 ⛓  Native runtime: node-template-100 (node-template-1.tx1.au1)    
Error: Service(Client(VersionInvalid("cannot deserialize module: UnknownOpcode(192)")))
2023-04-07 12:59:26 Cannot create a runtime error=Other("cannot deserialize module: UnknownOpcode(192)")

I saw in another page that I have to have NOT the latest version of rustup, so I currently have the version updated on 2023/01/01:

➜  substrate-node-template git:(my-wip-branch) rustup toolchain list
stable-aarch64-apple-darwin
nightly-2021-03-14-aarch64-apple-darwin
nightly-2022-03-14-aarch64-apple-darwin
nightly-2022-06-30-aarch64-apple-darwin
nightly-2023-01-01-aarch64-apple-darwin (default)

But then it still doesn't run. I'm suspecting it's because I have to change the name from nightly-2023-01-01-aarch64-apple-darwin to nightly-aarch64-apple-darwin but I don't know how to do that. Thank you for your help!

Jmb
  • 18,893
  • 2
  • 28
  • 55

2 Answers2

7

To fix it, the easiest way for me was to create a rust-toolchain.toml file in the main folder, with the following content:

[toolchain]
channel = "nightly-2023-01-01"
components = [ "rustfmt" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
0

To extend Matteo's answer.

If you previously compiled polkadot node, there is a scripts/init.sh file that sets up the environment prior to compilation.

Matteo's answer does a similar job by setting up the nightly, rustfmt, and wasm as needed.

DerekC
  • 762
  • 5
  • 10