diff --git a/index.html b/index.html index 06258e45..e5f2dc81 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
-0.28.10
0.29.0-rc.0
Installable via npm install --save libp2p
, it can also be used directly in the browser.
The source is available for download from GitHub. Alternatively, you can install using npm:
-$ npm install --save libp2p-
You can then require()
libp2p as normal:
const libp2P = require('libp2p')
-libp2p
should work in any ECMAScript 2018 environment out of the box.
Usage:
-<script type="text/javascript" src="index.js"></script>
-The portable versions of libp2p
, including index.js
and index.min.js
, are included in the /dist
folder. libp2p
can also be found on unpkg.com under
peerStore
Connection
will be returned
Store the given key/value pair in the DHT.
- + @@ -3333,7 +3417,7 @@ a provider of the given key.Get the value to the given key. Times out after 1 minute by default.
- + @@ -3451,7 +3535,7 @@ Times out after 1 minute by default.Promise<{from: PeerId, val: Buffer}>
:
+ Promise<{from: PeerId, val: Uint8Array}>
:
@@ -3534,7 +3618,7 @@ Times out after 1 minute by default.
-
+
src/content-routing.js
@@ -3543,7 +3627,7 @@ Times out after 1 minute by default.
Get the n
values to the given key without sorting.
Promise<Array<{from: PeerId, val: Buffer}>>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Subscribe the given handler to a pubsub topic
- - - - - - - - - - - - - -void
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Unsubscribes from a pubsub topic
- - - - - - - - - - - - - -Publish messages to the given topics.
- - - - - - - - - - - - - -Promise<void>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get a list of topics the node is subscribed to.
- - - - - - - - - - - - - - - - - - -Array<String>
:
- topics
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get a list of the peer-ids that are subscribed to one topic.
- - - - - - - - - - - - - -(string)
-
- Array<string>
:
+ Promise<Array<{from: PeerId, val: Uint8Array}>>
:
@@ -4031,7 +3735,7 @@ Times out after 1 minute by default.
-
+
src/get-peer.js
@@ -4115,7 +3819,7 @@ If a multiaddr is received, the addressBook is updated.
-
+
src/address-manager/index.js
@@ -4239,7 +3943,7 @@ address adverstising to other peers in the network.
Creates some protected data.
-The output Buffer contains the PKCS #7 message in DER.
+The output Uint8Array contains the PKCS #7 message in DER.
- + @@ -9191,7 +8895,7 @@ arbitrary message content.The keychain must contain one of the keys used to encrypt the data. If none of the keys exists, an Error is returned with the property 'missingKeys'. It is array of key ids.
- +Gets a self-signed X.509 certificate for the key.
-The output Buffer contains the PKCS #7 message in DER.
+The output Uint8Array contains the PKCS #7 message in DER.
TODO: move to libp2p-crypto package
- +undefined
:
+ Uint8Array
:
@@ -9422,7 +9126,7 @@ exists, an Error is returned with the property 'missingKeys'. It is array of ke
-
+
src/keychain/util.js
@@ -9501,7 +9205,7 @@ resolve to either true
or false
.
-
+
src/metrics/index.js
@@ -9623,7 +9327,7 @@ resolve to either true
or false
.
-
+
src/metrics/index.js
@@ -9678,7 +9382,7 @@ will be ignored.
-
+
src/metrics/index.js
@@ -9733,7 +9437,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9795,7 +9499,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9857,7 +9561,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9933,7 +9637,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -9995,7 +9699,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -10070,7 +9774,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -10139,7 +9843,7 @@ be stopped and moved to an LRU for temporary retention.
-
+
src/metrics/index.js
@@ -10217,7 +9921,7 @@ placeholder stats will be merged with the existing stats.
-
+
src/metrics/index.js
@@ -10347,7 +10051,7 @@ with the placeholder string returned from here, and the known PeerId
-
+
src/metrics/index.js
@@ -10431,7 +10135,7 @@ and returned.
-
+
src/metrics/old-peers.js
@@ -10506,7 +10210,7 @@ and returned.
-
+
src/metrics/stats.js
@@ -10586,7 +10290,7 @@ and returned.
Stats.stop
was previously called,
Responsible for managing known peers, as well as their addresses, protocols and metadata.
-@@ -12478,6 +12182,43 @@ NO_FATAL should be used for not failing when not listening.
+(Object)
+
+ Name | +Description | +
---|---|
$0.peerId any
+ |
+ + |
Get all the stored information of every peer.
+Get all the stored information of every peer known.
Map known peers to their known Addresses.
+Map known peers to their known Address Entries.
Type: - Map<string, Array<Address>> + Map<string, Array<Entry>>
@@ -13197,6 +12938,247 @@ of a peer. + + + + + + + + + + + +ConsumePeerRecord adds addresses from a signed peer record contained in a record envelope. +This will return a boolean that indicates if the record was successfully processed and added +into the AddressBook.
+ + + + + + + + + + + + + +(Envelope)
+
+ boolean
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Get the raw Envelope for a peer. Returns +undefined if no Envelope is found.
+ +(PeerId)
+
+ (Uint8Array | undefined)
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Get an Envelope containing a PeerRecord for the given peer. +Returns undefined if no record exists.
+ + + + + + + + + + + + + +(PeerId)
+
+ Promise<(Envelope | void)>
:
+
+
+
+
+
+
+
+
+
+
@@ -13225,14 +13207,17 @@ of a peer.
- Set known multiaddrs of a provided peer.
+Set known multiaddrs of a provided peer.
+This will replace previously stored multiaddrs, if available.
+Replacing stored multiaddrs might result in losing obtained certified addresses.
+If you are not sure, it's recommended to use add
instead.
Get the known data of a provided peer.
+ +(PeerId)
+
+ Array<data>
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
undefined
if there are no known multiaddrs for the given pe
-
+
src/peer-store/address-book.js
@@ -13545,7 +13609,7 @@ Returns undefined
if there are no known multiaddrs for the given pe
-
+
src/peer-store/proto-book.js
@@ -13600,7 +13664,7 @@ Returns undefined
if there are no known multiaddrs for the given pe
-
+
src/peer-store/book.js
@@ -13723,7 +13787,7 @@ Returns undefined
if there are no known multiaddrs for the given pe
undefined
if there are no known multiaddrs for the given pe
undefined
if there are no known multiaddrs for the given pe
undefined
if there is no available data for the given peer.
undefined
if there is no available data for the given peer.
-
+
src/peer-store/key-book.js
@@ -14099,7 +14163,7 @@ Returns undefined
if there is no available data for the given peer.
undefined
if there is no available data for the given peer.
undefined
if there is no available data for the given peer.
undefined
if there is no available data for the given peer.
-
+
src/peer-store/metadata-book.js
@@ -14409,7 +14473,7 @@ protocols of a peer.
Type: - Map<string, Map<string, Buffer>> + Map<string, Map<string, Uint8Array>>
@@ -14472,7 +14536,7 @@ protocols of a peer.Set metadata key and value of a provided peer.
- + @@ -14515,7 +14579,7 @@ protocols of a peer.Get the known data of a provided peer.
- + @@ -14731,7 +14795,7 @@ protocols of a peer.Map<string, Buffer>
:
+ Map<string, Uint8Array>
:
@@ -14770,7 +14834,7 @@ protocols of a peer.
Get specific metadata value, if it exists
- +Buffer
:
+ Uint8Array
:
@@ -14857,7 +14921,7 @@ protocols of a peer.
Subscribes to a given topic.
+ +(string)
+
+ (function (msg: InMessage)?)
+
+ void
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Unsubscribe from the given topic.
+ +(string)
+
+ (function (msg: InMessage)?)
+
+ void
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
any
+ any
Get self signed peer record raw envelope.
+ +Uint8Array
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Takes the addr
and converts it to a Multiaddr if possible
The Envelope is responsible for keeping an arbitrary signed record +by a libp2p peer.
+ + + + + + + + + + + + + +(Object)
+
+ Name | +Description | +
---|---|
$0.peerId any
+ |
+ + |
$0.payloadType any
+ |
+ + |
$0.payload any
+ |
+ + |
$0.signature any
+ |
+ + |
(object)
+
+ Unmarshal a serialized Envelope protobuf message.
+ + + + + + + + + + + + + +(Uint8Array)
+
+ Promise<Envelope>
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Seal marshals the given Record, places the marshaled bytes inside an Envelope +and signs it with the given peerId's private key.
+ +(Record)
+
+ (PeerId)
+
+ Envelope
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Open and certify a given marshalled envelope. +Data is unmarshalled and the signature validated for the given domain.
+ + + + + + + + + + + + + +(Uint8Array)
+
+ (string)
+
+ Envelope
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Marshal the envelope content.
+ +Uint8Array
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Verifies if the other Envelope is identical to this one.
+ + + + + + + + + + + + + +(Envelope)
+
+ boolean
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Validate envelope data signature for the given domain.
+ + + + + + + + + + + + + +(string)
+
+ Promise<boolean>
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Helper function that prepares a Uint8Array to sign or verify a signature.
+ +(string)
+
+ (Uint8Array)
+
+ (Uint8Array)
+
+ Uint8Array
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+The PeerRecord is used for distributing peer routing records across the network. +It contains the peer's reachable listen addresses.
+ + + + ++ Extends + + Record + +
+ + + + + + + + + + +(Object)
+
+ Name | +Description | +
---|---|
$0.peerId any
+ |
+ + |
$0.multiaddrs any
+
+ (default [] )
+ |
+ + |
$0.seqNumber any
+
+ (default Date.now() )
+ |
+ + |
(object)
+
+ Unmarshal Peer Record Protobuf.
+ +(Uint8Array)
+ marshaled peer record.
+
+ PeerRecord
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Marshal a record to be used in an envelope.
+ +Uint8Array
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns true if this
record equals the other
.
(Record)
+
+ boolean
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+