@libp2p/peer-record 4.0.3 → 4.0.5
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 +15 -13
- package/dist/index.min.js +16 -0
- package/dist/src/envelope/envelope.d.ts.map +1 -1
- package/dist/src/envelope/envelope.js +17 -39
- package/dist/src/envelope/envelope.js.map +1 -1
- package/dist/src/envelope/index.d.ts +2 -2
- package/dist/src/envelope/index.d.ts.map +1 -1
- package/dist/src/envelope/index.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/peer-record/consts.d.ts +2 -2
- package/dist/src/peer-record/consts.d.ts.map +1 -1
- package/dist/src/peer-record/consts.js.map +1 -1
- package/dist/src/peer-record/peer-record.d.ts.map +1 -1
- package/dist/src/peer-record/peer-record.js +21 -38
- package/dist/src/peer-record/peer-record.js.map +1 -1
- package/dist/typedoc-urls.json +6 -0
- package/package.json +13 -12
- package/src/envelope/envelope.ts +17 -39
- package/src/envelope/index.ts +2 -2
- package/src/index.ts +2 -0
- package/src/peer-record/{consts.js → consts.ts} +0 -0
- package/src/peer-record/peer-record.ts +21 -37
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# @libp2p/peer-record <!-- 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-record)
|
|
7
|
-
[](https://github.com/libp2p/js-libp2p-peer-record/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
|
|
8
7
|
|
|
9
8
|
> Used to transfer signed peer data across 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
|
- [Envelope](#envelope)
|
|
16
16
|
- [Usage](#usage)
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
- [Subsystem receiving a record](#subsystem-receiving-a-record)
|
|
23
23
|
- [Subsystem providing a record](#subsystem-providing-a-record)
|
|
24
24
|
- [Future Work](#future-work)
|
|
25
|
-
- [
|
|
25
|
+
- [API Docs](#api-docs)
|
|
26
26
|
- [License](#license)
|
|
27
|
-
- [
|
|
27
|
+
- [Contribution](#contribution)
|
|
28
28
|
|
|
29
29
|
## Install
|
|
30
30
|
|
|
@@ -32,6 +32,14 @@
|
|
|
32
32
|
$ npm i @libp2p/peer-record
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
### Browser `<script>` tag
|
|
36
|
+
|
|
37
|
+
Loading this module through a script tag will make it's exports available as `Libp2pPeerRecord` in the global namespace.
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<script src="https://unpkg.com/@libp2p/peer-record/dist/index.min.js"></script>
|
|
41
|
+
```
|
|
42
|
+
|
|
35
43
|
## Description
|
|
36
44
|
|
|
37
45
|
Libp2p nodes need to store data in a public location (e.g. a DHT), or rely on potentially untrustworthy intermediaries to relay information over its lifetime. Accordingly, libp2p nodes need to be able to verify that the data came from a specific peer and that it hasn't been tampered with.
|
|
@@ -163,15 +171,9 @@ When a subsystem wants to provide a record, it will get it from the AddressBook,
|
|
|
163
171
|
- With the modular dialer, users should easily be able to configure precedence. With dialer v1, anything we do to prioritise dials is gonna be spaghetti and adhoc. With the modular dialer, you’d be able to specify the order of dials when instantiating the pipeline.
|
|
164
172
|
- Multiple parallel dials. We already have the issue where new addresses aren't added to existing dials.
|
|
165
173
|
|
|
166
|
-
##
|
|
174
|
+
## API Docs
|
|
167
175
|
|
|
168
|
-
|
|
169
|
-
import { trackedMap } from '@libp2p/tracked-map'
|
|
170
|
-
|
|
171
|
-
const map = trackedMap<string, string>({ metrics })
|
|
172
|
-
|
|
173
|
-
map.set('key', 'value')
|
|
174
|
-
```
|
|
176
|
+
- <https://libp2p.github.io/js-libp2p-peer-record>
|
|
175
177
|
|
|
176
178
|
## License
|
|
177
179
|
|
|
@@ -180,6 +182,6 @@ Licensed under either of
|
|
|
180
182
|
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
181
183
|
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
182
184
|
|
|
183
|
-
##
|
|
185
|
+
## Contribution
|
|
184
186
|
|
|
185
187
|
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.
|