Hi, I was playing with the peerStore API and it seems that the doc is outdated.
According to the documentation the method peerStore.metadataBook.set(peerId, key, value)
takes three argument whereas in the current implementation (using "ipfs": "^0.62.1"
) the method takes two arguments, a peerId
and a metadata
which is an instance of Map
.
The doc could be updated as follows:
peerStore.metadataBook.set
Set known metadata of a given peerId
.
peerStore.metadataBook.set(peerId, metaData)
Parameters
Name | Type | Description |
---|---|---|
peerId | PeerId |
peerId to set |
metaData | Map |
metadata value to store <String, Uint8Array>
|
Returns
Type | Description |
---|---|
MetadataBook |
Returns the Metadata Book component |
Example
let metaData = new Map()
metaData.set('location', new TextEncoder().encode('Berlin'))
peerStore.metadataBook.set(peerId, metaData)
Is there a proper place to signal such minor issues?