hyperswarm / discovery

The Hyperswarm discovery stack
MIT License
121 stars 16 forks source link

Use MDNS to find DHT peers instead of discovery keys #7

Open RangerMauve opened 5 years ago

RangerMauve commented 5 years ago

The use of MDNS in discovery-swarm gets kind of noisy as you get more and more archives that you're replicating.

I propose to reduce network traffic by using MDNS to discover other hyperswarm nodes to form a DHT that's used for the actual peer discovery.

The flow would look like:

Some cool properties:

mafintosh commented 5 years ago

Another way to describe your flow is to simply resolve bootstrap.hyperswarm.local to yourself and use that as the bootstrap address.

I think your idea has merit, def worth trying out.

pvh commented 5 years ago

This sounds almost exactly like what we were hoping for, only we called it "peer discovery". In our use-case most documents have a small number of peers associated with them and there's a high degree of likelihood that the feeds you want will be found in a peer you're already talking to. (We're doing a lot of small-group collaboration rather than large-audience publication.)

RangerMauve commented 5 years ago

pvh: That sounds pretty relevant to the stuff @tinchoz49 is doing with @geut

RangerMauve commented 5 years ago

Is there any way to extract that logic into a reusable module?

pvh commented 5 years ago

We don't have an implementation. We've retreated to our discovery-cloud implementation which is just a websocket echo server at the moment and look forward to returning...

RangerMauve commented 5 years ago

@davidmarkclements @mafintosh thoughts on this?

RangerMauve commented 5 years ago

It'd be cool if we adhered to zeroconf. It'd make my life a bit easier for react-native apps via react-native-zeroconf

RangerMauve commented 5 years ago

Here's a conversation we had about this in the Dat working group on IRC: