The AddressBook is responsible for keeping the known multiaddrs of a peer.
Transforms received multiaddrs into Address.
Map known peers to their data.
Emit data.
Set data into the datastructure, persistence and emit it using the provided transformers.
peerId of the data to store
data to store.
Add known addresses of a provided peer. If the peer is not known, it is set with the given addresses.
ConsumePeerRecord adds addresses from a signed peer record contained in a record envelope. This will return a boolean that indicates if the record was successfully processed and added into the AddressBook.
Deletes the provided peer from the book.
Get the known data of a provided peer.
Returns undefined
if there is no available data for the given peer.
Get the known multiaddrs for a given peer. All returned multiaddrs
will include the encapsulated PeerId
of the peer.
Returns undefined
if there are no known multiaddrs for the given peer.
Get the raw Envelope for a peer. Returns undefined if no Envelope is found.
Set known data of a provided peer.