4

I'm using pow substrate chain. I'm running 3 validators by using these commands:

For bob

./target/release/node-template \
--base-path /tmp/bob \
--chain local \
--bob \
--port 30335 \
--rpc-port 9944 \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--validator \
-lruntime=debug

For alice

./target/release/node-template \
--base-path /tmp/alice \
--chain local \
--alice \
--port 30333 \
--rpc-port 9944 \
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--validator -lruntime=debug

For charlie

./target/release/node-template \
--base-path /tmp/charlie \
--chain local \
--charlie \
--port 30334 \
--rpc-port 9944 \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--validator \
-lruntime=debug

Then run this command to inject the keys:

$ curl --location --request POST 'http://localhost:9944' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "author_insertKey",
    "params": ["btc!","bread tongue spell stadium clean grief coin rent spend total practice document","0xb6a8b4b6bf796991065035093d3265e314c3fe89e75ccb623985e57b0c2e0c30"],
    "id": 1
}'

I'm getting this type of logs:

Alice logs: enter image description here

Bob logs: enter image description here

Charlie logs: enter image description here

Can anyone please help. why I'm getting error in the logs?

Thanks in advance!

I'm referring this pallet for integration: https://github.com/paritytech/substrate/blob/4abbf7f64222f0a47331624c0d0042d888cf6b10/frame/examples/offchain-worker-price-oracle/README.md

1 Answer 1

1

Offchain workers must also be enabled on the client side. Make sure you have configured the cli parameters to run the offchain workers. You must also spawn an offchain worker task in your client side code like this.

You mentioned you are using PoW. I've maintained a lot of the PoW based nodes that are out there, and I usually remove the offchain worker code from the client side.

Please add a link to your exact code repo and include you cli parameters for a more detailed answer.

2
  • Thank you for the response! we already config.offchain_worker.enabled implemented in the service.rs. Updated the question Commented Dec 5, 2023 at 16:27
  • Based on the added screenshot, I can see the offchain workers are starting and running properly. IDK why the http request is failing. Commented Dec 6, 2023 at 20:56

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.