Home

Awesome

⛔️ DEPRECATED: peer-books is now included in libp2p and renamed into peer-store.

Peer Book JavaScript Implementation

Discourse posts Dependency Status js-standard-style

Peer Store for libp2p and IPFS

Lead Maintainer

Vasco Santos

Table of Contents

soon™

Installation

npm

> npm i peer-book

Node.JS, Browserify, Webpack

const PeerBook = require('peer-book')

Browser: <script> Tag

Loading this module through a script tag will make the PeerBook obj available in the global namespace.

<script src="https://unpkg.com/peer-book/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/peer-book/dist/index.js"></script>

Usage

put(peerInfo, replace)

Adds the peerInfo using it's peerId to the peerBook

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

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:

License

MIT