-
Notifications
You must be signed in to change notification settings - Fork 1.2k
peers don't connect automatically through circuit, but they do through websocket-star rendezvous server #1309
Comments
Thanks for bringing this up, @fazo96, I understand where the confusion comes from. websocket-star offers transport + peer discovery and that is why you see them connecting right away. libp2p-circuit is just dialing. The path moving forward is to enable the DHT (wip) and disable websocket-star so that peers discover each other using the DHT giving you that same experience with libp2p-circuit only. |
I see, so the DHT is the missing piece. Thanks for clearing this up. Maybe we can keep this open until #856 is done and the peers can discover each other like with websocket-star. |
In addition to what @diasdavid mentioned, there is also the upcoming rendezvous spec libp2p/specs#44, and respective implementations, that will replace our existing add-hoc rendezvous implementations (*-star transports currently). This new implementation will allow peer discovery in addition to the dht, but also namespace based registration/querying of peers, that should enable a more complete service discovery mechanism. |
In summary, currently browser nodes can discover each other automatically with rendezvous server, but with p2p-circuits they just dialing thus can't discover each other automatically. But why is it that my js-ipfs daemon node can't discover nodes in the same net ?
corresponding config setting in .jsipfs (default setting):
ps. my go-ipfs node can discover other machines. it's discovery config part is
when using |
got it. it's because js-ipfs doesn't enable circuits by default. adding
to config in .jsipfs fixed it |
@alanshaw I saw you closed the issue, is the original problem fixed now? I mean, is there a way to make peers using the same IPFS JS app discover and connect automatically (directly or through relays with circuit) without using a centralised websocket-star redenzvous server? |
Per #2779 , this PR adds the public webrtc servers to the browser example. This allows users to run easily the example, but also provides information for how users should use a signaling server for production.
master
Type: Question
Severity: Medium
Description:
In my application, instances subscribe to a specific pubsub topic and I monitor the peers to see how many of my application's nodes I am connected to.
We are currently using rendezvous servers and websocket-star to connect browser nodes and it works great, however I wanted to try to replace this with connecting to a couple of relay-hop capable js-ipfs nodes via wss and then having browser tabs connect to each other with circuit.
The problem is that with rendezvous servers, the browser peers automatically connect to each other just because they are using the same rendezvous server. I expected the same with circuit, but instead I have to manually dial
/p2p-circuit/ipfs/<peerid>
to get the peers to connect.In short, circuit works but it doesn't automatically connect peers which can't connect directly, while if I use rendezvous it does. This makes rendezvous better in this case even though I understand that circuit is supposed to replace the rendezvous server mechanism, at least for websocket connections.
My Question is, is this expected behavior or missing functionality? How would I recreate the same behavior as websocket-star using circuit and have the peers connect automatically?
Steps to reproduce the error:
/p2p-circuit/ipfs/<peerid>
they connect immediatly and see each otherThe text was updated successfully, but these errors were encountered: