peer-base icon indicating copy to clipboard operation
peer-base copied to clipboard

Switch from websocket-star to the rendezvous protocol

Open pgte opened this issue 7 years ago • 10 comments

Currently, the peer discovery is done by filtering the transport discovery by connecting to each one of the discovered nodes and inquiring whether they're interested in this specific app, and then forming a hash ring with these participants to form a scalable gossip topology so that collaboration membership can be shared.

It would be nice to have a solution that does not require to connect to the peer to inquire about app-specific interest.

I think that switching from the ws-star to the rendez-vous protocol would allow that.

pgte avatar Jun 27 '18 11:06 pgte

@mkg20001 could you take a look at this?

pgte avatar Jun 27 '18 11:06 pgte

Related to https://github.com/ipfs-shipyard/peer-pad/issues/178

pgte avatar Jun 27 '18 11:06 pgte

@pgte Yes. In order to make this integration less of a hack https://github.com/ipfs/js-ipfs/pull/1396 needs to be completed first. Would need some feedback on how to integrate that without using hacks such as creating the swarm first and then manually adding the rendezvous discovery to the swarm (Because rendezvous depends on the libp2p swarm, which seems to be a chicken-egg-problem many of my modules have).

mkg20001 avatar Jun 27 '18 11:06 mkg20001

@mkg20001 added you to the team. Could you accept assign yourself here?

pgte avatar Jun 27 '18 14:06 pgte

@pgte Done

mkg20001 avatar Jun 27 '18 14:06 mkg20001

@mkg20001 thank you!

pgte avatar Jun 27 '18 14:06 pgte

This would be awesome to have for the dweb summit workshop. At the moment, it takes over 10secs for discover other peers, even on the same LAN, which is unfortunate. @pgte are you experiencing that as well?

satazor avatar Jul 23 '18 20:07 satazor

@satazor If you mean the 10s lag of rendezvous: That is mainly due to the discovery interval being set to 10s. It could be lowered or manually triggered right after the IPFS node starts to speed things up.

mkg20001 avatar Jul 23 '18 20:07 mkg20001

@mkg20001 I mean, it takes 10secs using the regular discovery. Using the rendezvous with a reduced interval would improve the discovery times.

satazor avatar Jul 23 '18 20:07 satazor

Discovery is randomly throttled to not stress the network, but you can speed things up by setting options.transport.maxThrottleDelayMS to a lower number than then default of 5000.

pgte avatar Jul 25 '18 08:07 pgte