1

Im using the polkadot.js api, running from a shell, and expecting to get multiple "Chain is at block #12345" messages. But i only get 1 of these messages and I do not know why.

I'm running a Polkadot node using the following docker command:

docker run -it -p 30333:30333 -p 9944:9944 -p 80:9933 -v /mnt/polkadot:/polkadot/.local/share parity/polkadot:latest --rpc-external --rpc-cors=all --chain westend --ws-external

and am following the examples in the polkadot.js api documentation

If i stop the docker container and then restart it i get 1 more message, so i know the connection is still open. it seems like the node isnt emitting the messages.

If I query wss://rpc.polkadot.io instead of my node (on port 9944) I get the expected behaviour.

Can anyone suggest a solution or steps to investigate?

2
  • sounds silly - but the 80:9933 mapping exposes the docker's 9933 port on the host 80. Is that want you want? should not effect the wss on 9944 AFAIK
    – Nuke
    Commented Feb 25, 2021 at 1:52
  • Hi John, Can you please support our Substrate StackExchange proposal: area51.stackexchange.com/proposals/126136 Commented Dec 16, 2021 at 13:15

1 Answer 1

2

The problem seems to be due to the node syncing with the network.

The node finished syncing the Westend network an hour ago and the API is now working as expected.

2
  • 1
    ah good spot. What was the way you discovered this? Monitoring the logs within the docker to see that you were synced?
    – Nuke
    Commented Feb 25, 2021 at 17:53
  • 1
    the first clue was that the cpu load had greatly decreased. the second was running curl -H "Content-Type: application/json" --data '{ "jsonrpc":"2.0", "method":"system_health", "params":[],"id":1 }' <node-ip> which gave {"jsonrpc":"2.0","result":{"isSyncing":false,"peers":25,"shouldHavePeers":true},"id":1}
    – John
    Commented Feb 26, 2021 at 13:45

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.