|
1 | 1 | # @libp2p/peer-store <!-- omit in toc -->
|
2 | 2 |
|
3 | 3 | [](http://libp2p.io/)
|
4 |
| -[](http://webchat.freenode.net/?channels=%23libp2p) |
5 | 4 | [](https://discuss.libp2p.io)
|
6 | 5 | [](https://codecov.io/gh/libp2p/js-libp2p-peer-store)
|
7 |
| -[](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml) |
| 6 | +[](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml?query=branch%3Amaster) |
8 | 7 |
|
9 | 8 | > Stores information about peers libp2p knows on the network
|
10 | 9 |
|
11 | 10 | ## Table of contents <!-- omit in toc -->
|
12 | 11 |
|
13 | 12 | - [Install](#install)
|
| 13 | + - [Browser `<script>` tag](#browser-script-tag) |
14 | 14 | - [Description](#description)
|
15 | 15 | - [Submitting records to the PeerStore](#submitting-records-to-the-peerstore)
|
16 | 16 | - [Identify](#identify)
|
|
31 | 31 | - [Events](#events)
|
32 | 32 | - [Data Persistence](#data-persistence)
|
33 | 33 | - [Future Considerations](#future-considerations)
|
| 34 | +- [API Docs](#api-docs) |
34 | 35 | - [License](#license)
|
35 |
| -- [Contribute](#contribute) |
| 36 | +- [Contribution](#contribution) |
36 | 37 |
|
37 | 38 | ## Install
|
38 | 39 |
|
39 | 40 | ```console
|
40 | 41 | $ npm i @libp2p/peer-store
|
41 | 42 | ```
|
42 | 43 |
|
| 44 | +### Browser `<script>` tag |
| 45 | + |
| 46 | +Loading this module through a script tag will make it's exports available as `Libp2pPeerStore` in the global namespace. |
| 47 | + |
| 48 | +```html |
| 49 | +<script src="https://unpkg.com/@libp2p/peer-store/dist/index.min.js"></script> |
| 50 | +``` |
| 51 | + |
43 | 52 | ## Description
|
44 | 53 |
|
45 | 54 | Libp2p's PeerStore is responsible for keeping an updated register with the relevant information of the known peers. It should be the single source of truth for all peer data, where a subsystem can learn about peers' data and where someone can listen for updates. The PeerStore comprises four main components: `addressBook`, `keyBook`, `protocolBook` and `metadataBook`.
|
@@ -190,14 +199,18 @@ Metadata is stored under the following key pattern:
|
190 | 199 | - When improving libp2p configuration for specific runtimes, we should take into account the PeerStore recommended datastore.
|
191 | 200 | - When improving libp2p configuration, we should think about a possible way of allowing the configuration of Bootstrap to be influenced by the persisted peers, as a way to decrease the load on Bootstrap nodes.
|
192 | 201 |
|
| 202 | +## API Docs |
| 203 | + |
| 204 | +- <https://libp2p.github.io/js-libp2p-peer-store> |
| 205 | + |
193 | 206 | ## License
|
194 | 207 |
|
195 | 208 | Licensed under either of
|
196 | 209 |
|
197 | 210 | - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
198 | 211 | - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
199 | 212 |
|
200 |
| -## Contribute |
| 213 | +## Contribution |
201 | 214 |
|
202 | 215 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
203 | 216 |
|
|
0 commit comments