Closed sleep9 closed 7 months ago
This is the expected behaviour. All (non-browser) libp2p nodes are Circuit Relay V2 servers by default - connections are time and data limited to prevent them from being (ab)used as open relays.
Two peers can make a direct connection using WebRTC which is supported on all platforms - they just use a relay server to do the initial connection negotiation.
Version: { "dependencies": { "@chainsafe/libp2p-gossipsub": "^11.2.0", "@chainsafe/libp2p-noise": "^15.0.0", "@chainsafe/libp2p-yamux": "^6.0.1", "@libp2p/autonat": "^1.0.10", "@libp2p/bootstrap": "^10.0.13", "@libp2p/circuit-relay-v2": "^1.0.13", "@libp2p/dcutr": "^1.0.12", "@libp2p/floodsub": "^9.0.9", "@libp2p/identify": "^1.0.12", "@libp2p/kad-dht": "^12.0.5", "@libp2p/mdns": "^10.0.13", "@libp2p/mplex": "^10.0.13", "@libp2p/peer-id": "^4.0.5", "@libp2p/pubsub-peer-discovery": "^10.0.2", "@libp2p/tcp": "^9.0.13", "@libp2p/upnp-nat": "^1.0.11", "@libp2p/webrtc-direct": "^6.0.0", "@libp2p/websockets": "^8.0.13", "@libp2p/webtransport": "^4.0.19", "bip39": "^3.1.0", "libp2p": "^1.2.1", "libp2p-gossipsub": "^0.13.0", "libp2p-mplex": "^0.10.7", "libp2p-noise": "^4.0.0", "libp2p-secio": "^0.13.1", "libp2p-tcp": "^0.17.2", "typescript-json-serializer": "^6.0.1" } }
Platform: Peer A - React-Native, Peer B - OSX, Circuit-relay - Ubuntu Dockerized container
Subsystem: circuit-relay-v2
Severity:
Medium
Description:
Peer A discovers peer B through circuit relay public server however connection to circuit relay is dropped after 2 minutes and can no longer send Peer A messages. Is this the expected behaviour ie. nodes are expected to connect directly? I am using websockets so there may be no way to get around NAT unless upgrading to webTransport which is dial only currently.