0

There is no any logs and off-chain workers does not work by default. How to specify to enable workers for parachain via command?

1

1 Answer 1

2

Are you using the parachain node template from Cumulus?

According to the help text, it's only enabled for nodes that are authoring new blocks:

./target/release/parachain-template-node --help
  --offchain-worker <ENABLED>
      Should execute offchain workers on every block.
      
      By default it's only enabled for nodes that are authoring new blocks.
      
      [default: when-authority]

      Possible values:
      - always:
        Always have offchain worker enabled
      - never:
        Never enable the offchain worker
      - when-authority:
        Only enable the offchain worker when running as a validator (or collator, if this is a parachain node)

Looks like it is enabled here:

if parachain_config.offchain_worker.enabled {
    sc_service::build_offchain_workers(
        &parachain_config,
        task_manager.spawn_handle(),
        client.clone(),
        network.clone(),
    );
}

So try running your node with the --offchain-worker always flag.

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.