Closed lexnv closed 3 months ago
I'm running the local polkadot node as:
https://tomaka.github.io/test-browser-node/index.html uses Westend, so if your Polkadot node doesn't use Westend it will disconnect smoldot.
It might be possible that the default PlatformRef we use in subxt only supports websockets and TCP? 🤔
Yes, only the wasm node and its custom PlatformRef implementation supports WebRTC.
is this up-to date with latest smoldot: https://tomaka.github.io/test-browser-node/index.html?
No, but nothing has fundamentally changed since it has last been updated.
I have updated https://tomaka.github.io/test-browser-node/index.html with the latest version of smoldot.
Also note that Firefox has a long-standing bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1659672) that makes WebRTC not work when connecting localhost. You should either use Chrome, or deploy your node on a different machine.
Coming back to this, I have 2 computers connected:
/ip4/my-ip/udp/33999/webrtc-direct/p2p/12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD
A quick port scanning from macOs -> linux resulted in polkadot log-lines coming from webrtc component nmap -p 33999 -sU my-ip
.
I've fetched the chainSpec from the running node and replaced the westend.json for the test-browser-node
app.
[smoldot] Smoldot v2.0.18
[smoldot] Chain initialization complete for rococo_dev. Name: "Development". Genesis hash: 0xcc64…7ffe. Chain specification starting at: 0xcc64…7ffe (#0)
[smoldot] Chain specification of rococo_dev contains a `genesis.raw` item. It is possible to significantly improve the initialization time by replacing the `"raw": ...` field with `"stateRootHash": "0x9d4f2d3841854235149fb3d91ce991fa4f389ce7a02b4b483aa5b19385116643"`
[smoldot] Chain specification of rococo_dev contains a `protocolId` field. This field is deprecated and its value is no longer used. It can be safely removed from the JSON document.
[network] chain-added; id=rococo_dev
[network] slot-assigned; chain=rococo_dev, peer_id=12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD
[network] slot-unassigned; chain=rococo_dev, peer_id=12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD, ban_duration=10s, reason=no-address
[network] discovery-skipped-no-peer; chain=rococo_dev
[runtime-rococo_dev] sync-service-subscription-started; finalized_block_hash=0xcc64…7ffe, finalized_block_runtime_known=false
[runtime-rococo_dev] block-runtime-download-started; block_hash=0xcc64…7ffe
[runtime-rococo_dev] runtime-download-error; block_hashes=0xcc64…7ffe, error=StorageQuery(StorageQueryError { errors: [] })
[network] discovery-skipped-no-peer; chain=rococo_dev
[network] slot-assigned; chain=rococo_dev, peer_id=12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD
[network] slot-unassigned; chain=rococo_dev, peer_id=12D3KooWHdiAxVd8uMQR1hGWXccidmfCwLqcMpGwR6QcTP6QRMuD, ban_duration=10s, reason=no-address
[runtime-rococo_dev] block-runtime-download-started; block_hash=0xcc64…7ffe
[runtime-rococo_dev] runtime-download-error; block_hashes=0xcc64…7ffe, error=StorageQuery(StorageQueryError { errors: [] })
[network] discovery-skipped-no-peer; chain=rococo_dev
The polkadot node did not produce any traces for the webrtc during the connection attempt. Will keep looking into this, it seems like a connectivity issue 🙏
I don't log this properly, but the multiaddress that you pass to the test-browser-node is somehow in an invalid format.
See https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md#addressing for the format.
Are you maybe missing the certhash
? This is the hash of a certificate created by the WebRTC server, that the Polkadot node should be able to print somehow.
That did the trick! Thanks!
I was unable to sync smoldot to the head of the chain for my local node, I believe atm there's something wrong on our side. Will close this and come back later, thanks again 🙏
I would like to test the litep2p WebRTC with smoldot.
I've created this branch in substrate to configure webRtc with litep2p:
I'm running the local polkadot node as:
However, I'm not able to connect subxt's lightclient to the node
Currently, the peer is banned every 10 seconds:
Would you happen to know if I need a custom branch for smoldot to work with webrtc? It might be possible that the default PlatformRef we use in subxt only supports websockets and TCP? 🤔 Wanted to double check, is this up-to date with latest smoldot: https://tomaka.github.io/test-browser-node/index.html? Thanks 🙏