1

I am observing unexpected behavior with the Cumulus Parachain Template. Our pallet uses off-chain workers (OCW), and the functionality successfully runs when we attach it to the Substrate Node Template.

However, when I add our pallet to the Cumulus Parachain Template and follow the Connect a Local Parachain guide, the functionality that requires off-chain workers stops running completely.

Is there a reason that OCWs are not initializing on the Cumulus Parachain Template while they do run on the Node Template? Does the chainspec need to be altered in some way?

2
  • Can you try running your node with the flag: --offchain-worker always and let me know if it solves the issue.
    – Bruno
    Nov 7, 2022 at 15:03
  • @Bruno sadly this does not fix the issue
    – Brendan
    Nov 8, 2022 at 0:51

1 Answer 1

3

You are most likely missing the offchain worker initialisation in the service.rs file, like this https://github.com/substrate-developer-hub/substrate-node-template/blob/150c6c9e66bd4e866cfd4704d4d2a16799edc2c0/node/src/service.rs#L205

1
  • This fixes it, thanks! Put up a PR to add this directly into the Parachain Template Node to prevent others from hitting a similar issue in the future.
    – Brendan
    Nov 10, 2022 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.