Closed mafintosh closed 2 years ago
const swarm = new Hyperswarm() const core = new Hypercore(...) swarm.on('connection', socket => core.replicate(socket)) swarm.join(...) const done = core.findingPeers() swarm.flush().then(done, done) // waits for either 1st peer or the discovery hooks to finish const updated await core.update()