mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-12 08:41:22 +00:00
feat: add token based dialer
This commit is contained in:
@ -217,6 +217,16 @@ class PeerStore extends EventEmitter {
|
||||
protocols: Array.from(peerInfo.protocols)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the known multiaddrs for a given `PeerId`
|
||||
* @param {PeerId} peerId
|
||||
* @returns {Array<Multiaddr>}
|
||||
*/
|
||||
multiaddrsForPeer (peerId) {
|
||||
const peerInfo = this.get(peerId.toB58String())
|
||||
return peerInfo.multiaddrs.toArray()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PeerStore
|
||||
|
Reference in New Issue
Block a user