Hello,
since i have upgraded to js-libp2p@0.37.0 i can’t discover peers with webrtc-star.
As a signalling server i use the libp2p/js-libp2p-webrtc-star docker image (latest).
With previous libp2p version this setup used to work. I could discover all other nodes.
With the new version i don’t get any discover events from other nodes.
What i can do however is to successfully dial other nodes via the webrtc-star docker server.
await libp2p.node.dial("/dns4/webrtc-xxxxxxxx.de/tcp/443/wss/p2p-webrtc-star/p2p/QmTtFjYz56Pfzg88fgUp75JzskFmd7m5dbiTKbgA3imEVa");
So i think generally it is setup correctly.
Below is how my libp2p nodes are configured. Is there any configuration that I am missing?
import {createLibp2p} from "libp2p";
import {WebSockets} from "@libp2p/websockets";
import {Noise} from "@chainsafe/libp2p-noise";
import {Mplex} from "@libp2p/mplex";
import {KadDHT} from "@libp2p/kad-dht";
import {GossipSub} from "@chainsafe/libp2p-gossipsub";
import {WebRTCStar} from "@libp2p/webrtc-star";
import wrtc from "wrtc";
...
var node = await createLibp2p( {
peerId: id,
transports: [
new WebSockets(),
new WebRTCStar({wrtc: wrtc})
],
connectionEncryption: [new Noise()],
streamMuxers: [new Mplex()],
dht: new KadDHT(),
pubsub: new GossipSub(),
addresses: {
listen: [
"/dns4/webrtc-xxxxxxxx.de/tcp/443/wss/p2p-webrtc-star"
]
},
})
...
this.node.addEventListener("peer:discovery", (myevent) => {onDiscovery.onDiscovery(myevent)});
this.node.connectionManager.addEventListener("peer:connect", (myevent) => {onConnect.onConnect(myevent)});
And here are the versions from package.json
"libp2p": "^0.37.0",
"@libp2p/websockets": "^1.0.8",
"@chainsafe/libp2p-noise": "^6.1.1",
"@libp2p/mplex": "^1.0.5",
"@libp2p/kad-dht": "^1.0.12",
"@chainsafe/libp2p-gossipsub": "^1.0.0",
"@libp2p/webrtc-star": "^1.0.10",
"wrtc": "^0.4.7",
Regards Sneaker