Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
fix(docs): update to new get function (#46)
Browse files Browse the repository at this point in the history
* fix(docs): update to new get function

* fix: links

* fix: docs
  • Loading branch information
mkg20001 authored and jacobheun committed Sep 6, 2019
1 parent 029de5f commit f2f4add
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,25 @@ Loading this module through a script tag will make the `PeerBook` obj available

# Usage

### `put`
### `put(peerInfo, replace)`

### `get`
Adds the peerInfo using it's peerId to the peerBook

### `getByB58String`
If the peerInfo for that id was already added, the addresses are going to be merged

### `getByMultihash`
If `replace` is set to true, then the peerInfo will be completly overwritten by the new one, without keeping the previous addresses.

### `get(peerIdLike)`

Gets the peerInfo using it's peerId

`peerIdLike` can be:
- A base58 peerId string
- Example: `QmfHZLGRxYoF87esc98DetgKwzMhE4gumCC9kq39EBrueM`
- A peerId buffer
- Example: `<Buffer 12 20 fb cb db 25 57 c9 4c 7d 73 c6 d9 bb 83 cc e6 4d 7a de 66 59 12 94 bc 8d f3 95 5d 10 e6 ee ce 2e>`
- A [PeerId](https://www.npmjs.com/package/peer-id#api) object
- A [PeerInfo](https://www.npmjs.com/package/peer-info#api) object

# License

Expand Down

0 comments on commit f2f4add

Please sign in to comment.