diff --git a/doc/API.md b/doc/API.md index a330676e..e0cd9b39 100644 --- a/doc/API.md +++ b/doc/API.md @@ -1216,7 +1216,7 @@ Get the stored information of a given peer, namely its [`PeerId`][peer-id], know | Type | Description | |------|-------------| -| `{ id: PeerId, addresses: Array
, protocols: Array }` | Peer information of the provided peer | +| `{ id: PeerId, addresses: Array
, metadata: Map}, protocols: Array }` | Peer information of the provided peer | #### Example @@ -1243,13 +1243,13 @@ Get all the stored information of every peer. | Type | Description | |------|-------------| -| `Map, protocols: Array }>` | Peer data of every peer known | +| `Map, metadata: Map}, protocols: Array }>` | Peer data of every peer known | #### Example ```js for (let [peerIdString, peer] of peerStore.peers.entries()) { - // peer { id, addresses, protocols } + // peer { id, addresses, metadata, protocols } } ``` diff --git a/src/peer-store/index.js b/src/peer-store/index.js index 2c659d82..f34de5a4 100644 --- a/src/peer-store/index.js +++ b/src/peer-store/index.js @@ -32,6 +32,7 @@ class PeerStore extends EventEmitter { * @property {PeerId} id peer's peer-id instance. * @property {Array
} addresses peer's addresses containing its multiaddrs and metadata. * @property {Array} protocols peer's supported protocols. + * @property {Map} metadata peer's metadata map. */ /**