3

I have a chain extension implemented on substrate-contracts-node and in my ink! smart contract according to this tutorial. When I try to instantiate my contract on a local contracts-ui I get the following message:

module uses chain extensions but chain extensions are disabled

What do I need to do to enable chain extensions?

Here is my code for sanity check.

1 Answer 1

6

Make sure you have type ChainExtension defined in your runtime:

impl pallet_contracts::Config for Runtime {
    ....
    type ChainExtension = FetchRandomExtension;
}

...as indicated in the docs:

Also remember that there are two ways of running the substrate-contracts-node:

  1. Cloning it, modifying it, building it, running it:
git clone https://github.com/paritytech/substrate-contracts-node
cd substrate-contracts-node
cargo run --release -- --dev

OR

  1. Using cargo install and just running it:
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked
substrate-contracts-node --dev

Turns out I was modifying my code and running my node using the second option (which was a completely different install!) 🤦

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.