bltavares / colmeia

Attempt to make an interop layer to connect to dat on hyperswarm in Rust
24 stars 4 forks source link

Support handling multiple feeds on MDNS discovery #23

Closed bltavares closed 3 years ago

bltavares commented 4 years ago

This commit allow us to add and remove feed itens from the mDNS discovery stack.

We are not capable of integrating with @Frando's hypercore-replicator, which should let us introduce new discovery feeds when looking on mdns.

The binary example tests that we can still have a stream of items, and that we can add and remove topics in the background.

Ideally, we could later move into the "subscribers" direction, instead of a single stream, similar to how @Frando is doing on the hyperspace code. So we can avoid wrapping things on a Arc<RwLock<_>>.

TODO: Refactor Hyperstack - possibly using hypercore-replicator and move out the hyperdrive into it's own crate.

Closes #22

bltavares commented 4 years ago

We are producing a new peer without telling the code that would use it which public_key was used on this process. This is part leftover of the fact that each mdns-discovery handled a single feed.

We should return a tuple at least with peer address and public_key

bltavares commented 3 years ago

The mdns stack has no knowledge of the public key, as it only deals with discovery_keys. It has been refactored to return (DiscoveryKey, Peer IP) now