@libp2p/peer-store 4.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/dist/index.min.js +16 -0
- package/dist/src/index.d.ts +8 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/pb/peer.d.ts.map +1 -1
- package/dist/src/pb/peer.js +36 -57
- package/dist/src/pb/peer.js.map +1 -1
- package/dist/src/pb/tags.d.ts.map +1 -1
- package/dist/src/pb/tags.js +19 -24
- package/dist/src/pb/tags.js.map +1 -1
- package/dist/src/store.d.ts +3 -4
- package/dist/src/store.d.ts.map +1 -1
- package/dist/src/store.js +7 -11
- package/dist/src/store.js.map +1 -1
- package/dist/typedoc-urls.json +4 -0
- package/package.json +13 -13
- package/src/index.ts +12 -11
- package/src/pb/peer.ts +36 -54
- package/src/pb/tags.ts +19 -23
- package/src/store.ts +9 -12
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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?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,8 +31,9 @@
|
|
|
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
|
-
- [
|
|
36
|
+
- [Contribution](#contribution)
|
|
36
37
|
|
|
37
38
|
## Install
|
|
38
39
|
|
|
@@ -40,6 +41,14 @@
|
|
|
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,6 +199,10 @@ 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
|
|
@@ -197,7 +210,7 @@ Licensed under either of
|
|
|
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
|
-
##
|
|
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
|
|