Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Substrate node template Cannot create a runtime error=Other("cannot deserialize module: UnknownOpcode(192)")

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!

like image 447
dragonsunrise Avatar asked Jul 30 '26 20:07

dragonsunrise


2 Answers

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"
like image 173
Matteo Muraca Avatar answered Aug 02 '26 10:08

Matteo Muraca


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.

  • https://github.com/paritytech/polkadot/blob/master/scripts/init.sh
like image 44
DerekC Avatar answered Aug 02 '26 11:08

DerekC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!