@libp2p/peer-record 8.0.35 → 9.0.0-55b7e5fea
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 +2 -2
- package/dist/index.min.js +9 -10
- package/dist/index.min.js.map +4 -4
- package/dist/src/envelope/index.d.ts +1 -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 -2
- package/dist/src/index.js +2 -2
- package/dist/src/peer-record/index.js +1 -1
- package/dist/src/peer-record/index.js.map +1 -1
- package/dist/src/peer-record/utils.d.ts +6 -0
- package/dist/src/peer-record/utils.d.ts.map +1 -0
- package/dist/src/peer-record/utils.js +13 -0
- package/dist/src/peer-record/utils.js.map +1 -0
- package/package.json +9 -10
- package/src/envelope/index.ts +1 -2
- package/src/index.ts +2 -2
- package/src/peer-record/index.ts +1 -1
- package/src/peer-record/utils.ts +15 -0
- package/dist/typedoc-urls.json +0 -6
package/README.md
CHANGED
|
@@ -30,13 +30,13 @@ Libp2p nodes need to store data in a public location (e.g. a DHT), or rely on po
|
|
|
30
30
|
|
|
31
31
|
Libp2p provides an all-purpose data container called **envelope**. It was created to enable the distribution of verifiable records, which we can prove originated from the addressed peer itself. The envelope includes a signature of the data, so that its authenticity is verified.
|
|
32
32
|
|
|
33
|
-
This envelope stores a marshaled record implementing the [interface-record](https://github.com/libp2p/js-libp2p/blob/main/packages/interface/src/record
|
|
33
|
+
This envelope stores a marshaled record implementing the [interface-record](https://github.com/libp2p/js-libp2p/blob/main/packages/interface/src/record.ts). These Records are designed to be serialized to bytes and placed inside of the envelopes before being shared with other peers.
|
|
34
34
|
|
|
35
35
|
You can read further about the envelope in [RFC 0002 - Signed Envelopes](https://github.com/libp2p/specs/blob/master/RFC/0002-signed-envelopes.md). For the original discussion about it you can look at the PR that was used to create it: [libp2p/specs#217](https://github.com/libp2p/specs/pull/217).
|
|
36
36
|
|
|
37
37
|
## Example - Creating a peer record
|
|
38
38
|
|
|
39
|
-
Create an envelope with an instance of an [interface-record](https://github.com/libp2p/js-libp2p/blob/main/packages/interface/src/record
|
|
39
|
+
Create an envelope with an instance of an [interface-record](https://github.com/libp2p/js-libp2p/blob/main/packages/interface/src/record.ts) implementation and prepare it for being exchanged:
|
|
40
40
|
|
|
41
41
|
```TypeScript
|
|
42
42
|
import { PeerRecord, RecordEnvelope } from '@libp2p/peer-record'
|