It potentially allows a simpler API for replication like this:
const swarm = new Hyperswarm()
swarm.on('connection', (socket) => drive.replicate(socket))
swarm.join(drive) // Or a bee
It would always pass down { discoveryKey, findingPeers } for all building blocks like Hypercore, Hyperbee, and Hyperdrive. User should still manually call the replicate method to avoid any magic, but looks very safe to automatically handle the discovery key to find peers.
In combination with https://github.com/holepunchto/hyperbee/pull/119
It potentially allows a simpler API for replication like this:
It would always pass down
{ discoveryKey, findingPeers }
for all building blocks like Hypercore, Hyperbee, and Hyperdrive. User should still manually call the replicate method to avoid any magic, but looks very safe to automatically handle the discovery key to find peers.