Searches the network for peer info corresponding to the passed peer id.
Optional
// ...const peer = await peerRouting.findPeer(peerId, options) Copy
// ...const peer = await peerRouting.findPeer(peerId, options)
Search the network for peers that are closer to the passed key. Peer info should be yielded in ever-increasing closeness to the key.
// Iterate over the closest peers found for the given keyfor await (const peer of peerRouting.getClosestPeers(key)) { console.log(peer.id, peer.multiaddrs)} Copy
// Iterate over the closest peers found for the given keyfor await (const peer of peerRouting.getClosestPeers(key)) { console.log(peer.id, peer.multiaddrs)}
Searches the network for peer info corresponding to the passed peer id.