Optional
options: AbortOptionsSearch 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 key
for await (const peer of peerRouting.getClosestPeers(key)) {
console.log(peer.id, peer.multiaddrs)
}
Optional
options: AbortOptions
Searches the network for peer info corresponding to the passed peer id.
Example