diff --git a/assets/anchor.js b/assets/anchor.js index 1f573dcb..f74c2de7 100644 --- a/assets/anchor.js +++ b/assets/anchor.js @@ -6,7 +6,7 @@ /* eslint-env amd, node */ // https://github.com/umdjs/umd/blob/master/templates/returnExports.js -(function (root, factory) { +(function(root, factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -21,7 +21,7 @@ root.AnchorJS = factory(); root.anchors = new root.AnchorJS(); } -})(this, function () { +})(this, function() { 'use strict'; function AnchorJS(options) { this.options = options || {}; @@ -51,7 +51,7 @@ * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40 * @returns {Boolean} - true if the current device supports touch. */ - this.isTouchDevice = function () { + this.isTouchDevice = function() { return !!( 'ontouchstart' in window || (window.DocumentTouch && document instanceof DocumentTouch) @@ -64,7 +64,7 @@ * to. Also accepts an array or nodeList containing the relavant elements. * @returns {this} - The AnchorJS object */ - this.add = function (selector) { + this.add = function(selector) { var elements, elsWithIds, idList, @@ -193,7 +193,7 @@ * OR a nodeList / array containing the DOM elements. * @returns {this} - The AnchorJS object */ - this.remove = function (selector) { + this.remove = function(selector) { var index, domAnchor, elements = _getElements(selector); @@ -216,7 +216,7 @@ /** * Removes all anchorjs links. Mostly used for tests. */ - this.removeAll = function () { + this.removeAll = function() { this.remove(this.elements); }; @@ -229,7 +229,7 @@ * @param {String} text - Any text. Usually pulled from the webpage element we are linking to. * @returns {String} - hyphen-delimited text for use in IDs and URLs. */ - this.urlify = function (text) { + this.urlify = function(text) { // Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\ var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g, urlText; @@ -260,7 +260,7 @@ * @param {HTMLElemnt} el - a DOM node * @returns {Boolean} true/false */ - this.hasAnchorJSLink = function (el) { + this.hasAnchorJSLink = function(el) { var hasLeftAnchor = el.firstChild && (' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1, diff --git a/assets/site.js b/assets/site.js index a624be7b..f86584f2 100644 --- a/assets/site.js +++ b/assets/site.js @@ -7,7 +7,7 @@ anchors.add('h3'); // Filter UI var tocElements = document.getElementById('toc').getElementsByTagName('li'); -document.getElementById('filter-input').addEventListener('keyup', function (e) { +document.getElementById('filter-input').addEventListener('keyup', function(e) { var i, element, children; // enter key @@ -22,14 +22,14 @@ document.getElementById('filter-input').addEventListener('keyup', function (e) { } } - var match = function () { + var match = function() { return true; }; var value = this.value.toLowerCase(); if (!value.match(/^\s*$/)) { - match = function (element) { + match = function(element) { var html = element.firstChild.innerHTML; return html && html.toLowerCase().indexOf(value) !== -1; }; @@ -114,12 +114,12 @@ var cw_without_sb = split_left.clientWidth; split_left.style.overflow = ''; Split(['#split-left', '#split-right'], { - elementStyle: function (dimension, size, gutterSize) { + elementStyle: function(dimension, size, gutterSize) { return { 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)' }; }, - gutterStyle: function (dimension, gutterSize) { + gutterStyle: function(dimension, gutterSize) { return { 'flex-basis': gutterSize + 'px' }; @@ -152,9 +152,9 @@ function loadState(ev) { } } -window.addEventListener('load', function () { +window.addEventListener('load', function() { // Restore after Firefox scrolls to hash. - setTimeout(function () { + setTimeout(function() { loadState(); // Update with initial scroll position. updateState(); diff --git a/index.html b/index.html index 62c62630..2dddfed3 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
-0.28.5
0.27.9
Like new Libp2p(options)
except it will create a PeerId
+
Like new Libp2p(options)
except it will create a PeerInfo
instance if one is not provided in options.
Load keychain keys from the datastore. -Imports the private key as 'self', if needed.
- -void
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Dials to the provided peer. If successful, the known metadata of the +
Dials to the provided peer. If successful, the PeerInfo
of the
peer will be added to the nodes peerStore
peerStore
((PeerId | Multiaddr | string))
+ peer ((PeerInfo | PeerId | Multiaddr | string))
The peer to dial
peerStore
peerStore
Dials to the provided peer and handshakes with the given protocol.
-If successful, the known metadata of the peer will be added to the nodes peerStore
,
-and the Connection
will be returned
PeerInfo
of the peer will be added to the nodes peerStore
,
+and the Connection
will be sent in the callback
- Connection
will be returned
- Get peer advertising multiaddrs by concating the addresses used -by transports to listen with the announce addresses. -Duplicated addresses and noAnnounce addresses are filtered out.
- -Array<Multiaddr>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Disconnects all connections to the given peer
((PeerId | multiaddr | string))
+ peer ((PeerInfo | PeerId | multiaddr | string))
the peer to close connections to
Pings the given peer in order to obtain the operation latency.
+Pings the given peer
- + @@ -2789,7 +2133,7 @@ Duplicated addresses and noAnnounce addresses are filtered out.((PeerId | Multiaddr | string))
+ peer ((PeerInfo | PeerId | Multiaddr | string))
The peer to ping
Iterates over all peer routers in series to find the given peer.
- + @@ -3076,7 +2420,7 @@ will no longer be supported on streams.Promise<{id: PeerId, multiaddrs: Array<Multiaddr>}>
:
+ Promise<PeerInfo>
:
@@ -3111,7 +2455,7 @@ will no longer be supported on streams.
-
+
src/content-routing.js
@@ -3121,7 +2465,7 @@ will no longer be supported on streams.
Iterates over all content routers in series to find providers of the given key. Once a content router succeeds, iteration will stop.
-AsyncIterable<{id: PeerId, multiaddrs: Array<Multiaddr>}>
:
+ AsyncIterable<PeerInfo>
:
@@ -3230,7 +2574,7 @@ Once a content router succeeds, iteration will stop.
-
+
src/content-routing.js
@@ -3307,7 +2651,7 @@ a provider of the given key.
-
+
src/content-routing.js
@@ -3424,7 +2768,7 @@ a provider of the given key.
-
+
src/content-routing.js
@@ -3534,7 +2878,7 @@ Times out after 1 minute by default.
-
+
src/content-routing.js
@@ -3651,7 +2995,7 @@ Times out after 1 minute by default.
-
+
src/pubsub.js
@@ -3735,7 +3079,7 @@ Times out after 1 minute by default.
-
+
src/pubsub.js
@@ -3811,7 +3155,7 @@ Times out after 1 minute by default.
-
+
src/pubsub.js
@@ -3894,7 +3238,7 @@ Times out after 1 minute by default.
-
+
src/pubsub.js
@@ -3956,7 +3300,7 @@ Times out after 1 minute by default.
-
+
src/pubsub.js
@@ -4026,22 +3370,23 @@ Times out after 1 minute by default.
Converts the given peer
to a Peer
object.
-If a multiaddr is received, the addressBook is updated.
Converts the given peer
to a PeerInfo
instance.
+The PeerStore
will be checked for the resulting peer, and
+the peer will be updated in the PeerStore
.
{id: PeerId, multiaddrs: Array<Multiaddr>}
:
+ PeerInfo
:
@@ -4110,25 +3455,22 @@ If a multiaddr is received, the addressBook is updated.
Responsible for managing this peers addresses. -Peers can specify their listen, announce and noAnnounce addresses. -The listen addresses will be used by the libp2p transports to listen for new connections, -while the announce an noAnnounce addresses will be combined with the listen addresses for -address adverstising to other peers in the network.
+If getPeerInfo
does not return a peer with multiaddrs,
+the libp2p
PeerRouter will be used to attempt to find the peer.
Name | -Description | -
---|---|
$0.listen any
-
- (default [] )
- |
- - |
$0.announce any
-
- (default [] )
- |
- - |
$0.noAnnounce any
-
- (default [] )
- |
- - |
Get peer listen multiaddrs.
- -Array<Multiaddr>
:
+ Promise<PeerInfo>
:
@@ -4286,150 +3529,6 @@ address adverstising to other peers in the network.
-Get peer announcing multiaddrs.
- -Array<Multiaddr>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get peer noAnnouncing multiaddrs.
- -Array<Multiaddr>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Responsible for managing known connections.
- - + -- Extends - - EventEmitter - -
@@ -4490,6 +3581,103 @@ address adverstising to other peers in the network.Name | +Description | +
---|---|
options.maxConnections Number
+ |
+ The maximum number of connections allowed. Default=Infinity + | +
options.minConnections Number
+ |
+ The minimum number of connections to avoid pruning. Default=0 + | +
options.maxData Number
+ |
+ The max data (in and out), per average interval to allow. Default=Infinity + | +
options.maxSentData Number
+ |
+ The max outgoing data, per average interval to allow. Default=Infinity + | +
options.maxReceivedData Number
+ |
+ The max incoming data, per average interval to allow.. Default=Infinity + | +
options.maxEventLoopDelay Number
+ |
+ The upper limit the event loop can take to run. Default=Infinity + | +
options.pollInterval Number
+ |
+ How often, in milliseconds, metrics and latency should be checked. Default=2000 + | +
options.movingAverageInterval Number
+ |
+ How often, in milliseconds, to compute averages. Default=60000 + | +
options.defaultPeerValue Number
+ |
+ The value of the peer. Default=1 + | +
Map of peer identifiers to their peer value for pruning connections.
- -Map of connections per peer
- -Get current number of open connections.
- -Cleans up the connections
- -Get a connection with a peer.
- -(PeerId)
-
- Connection
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get all open connections with a peer.
- -(PeerId)
-
- Array<Connection>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Connects to a given peer
by dialing all of its known addresses.
+
Connects to a given PeerId
or Multiaddr
by dialing all of its known addresses.
The dial to the first address that is successfully able to upgrade a connection
will be used.
Converts the given peer
into a PeerInfo
or Multiaddr
.
((PeerInfo | PeerId | Multiaddr | string))
+
+ (PeerInfo | Multiaddr)
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Information about a key.
- -- Type: - Object -
- - - - - - - - - - - - - -Manages the lifecycle of a key. Keys are encrypted at rest using PKCS #8.
-A key in the store has two entries
-(DS)
- where the key are.
-
- (object)
- ???
-
- Generates the options for a keychain. A random salt is produced.
- -object
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Gets an object that can encrypt/decrypt protected data. -The default options for a keychain.
- -object
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Gets an object that can encrypt/decrypt protected data -using the Cryptographic Message Syntax (CMS).
-CMS describes an encapsulation syntax for data protection. It -is used to digitally sign, digest, authenticate, or encrypt -arbitrary message content.
- -CMS
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Create a new key.
- - - - - - - - - - - - - -(string)
- The local key name; cannot already exist.
-
- (string)
- One of the key types; 'rsa'.
-
- (int)
- The key size in bits.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-List all the keys.
- - - - - - - - - - - - - - - - - - -Array<KeyInfo>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Find a key by it's id.
- - - - - - - - - - - - - -(string)
- The universally unique key identifier.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Find a key by it's name.
- - - - - - - - - - - - - -(string)
- The local key name.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Remove an existing key.
- - - - - - - - - - - - - -(string)
- The local key name; must already exist.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Rename a key
- - - - - - - - - - - - - -(string)
- The old local key name; must already exist.
-
- (string)
- The new local key name; must not already exist.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Export an existing key as a PEM encrypted PKCS #8 string
- - - - - - - - - - - - - -(string)
- The local key name; must already exist.
-
- (string)
- The password
-
- string
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Import a new key from a PEM encoded PKCS #8 string
- - - - - - - - - - - - - -(string)
- The local key name; must not already exist.
-
- (string)
- The PEM encoded PKCS #8 string
-
- (string)
- The password.
-
- KeyInfo
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Cryptographic Message Syntax (aka PKCS #7)
-CMS describes an encapsulation syntax for data protection. It -is used to digitally sign, digest, authenticate, or encrypt -arbitrary message content.
-See RFC 5652 for all the details.
- -(Keychain)
- the available keys
-
- Creates some protected data.
-The output Buffer contains the PKCS #7 message in DER.
- - - - - - - - - - - - - -(string)
- The local key name.
-
- (Buffer)
- The data to encrypt.
-
- undefined
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Reads some protected data.
-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.
- - - - - - - - - - - - - -(Buffer)
- The CMS encrypted data to decrypt.
-
- undefined
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Gets a self-signed X.509 certificate for the key.
-The output Buffer contains the PKCS #7 message in DER.
-TODO: move to libp2p-crypto package
- - - - - - - - - - - - - -(KeyInfo)
- The id and name of the key
-
- (RsaPrivateKey)
- The naked key
-
- undefined
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Finds the first item in a collection that is matched in the
-asyncCompare
function.
asyncCompare
is an async function that must
-resolve to either true
or false
.
(Array)
-
- (function (any))
- An async function that returns a boolean
-
- true
or false
.
-
+
src/metrics/index.js
@@ -9543,14 +6909,6 @@ resolve to either true
or false
.
- ConnectionManager
- number
true
or false
.
-
+
src/metrics/index.js
@@ -9678,7 +7036,7 @@ will be ignored.
-
+
src/metrics/index.js
@@ -9733,7 +7091,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9795,7 +7153,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9857,7 +7215,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -9933,7 +7291,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -9995,7 +7353,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -10070,7 +7428,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -10139,7 +7497,7 @@ be stopped and moved to an LRU for temporary retention.
-
+
src/metrics/index.js
@@ -10217,7 +7575,7 @@ placeholder stats will be merged with the existing stats.
-
+
src/metrics/index.js
@@ -10347,7 +7705,7 @@ with the placeholder string returned from here, and the known PeerId
-
+
src/metrics/index.js
@@ -10431,7 +7789,7 @@ and returned.
-
+
src/metrics/old-peers.js
@@ -10506,7 +7864,7 @@ and returned.
-
+
src/metrics/stats.js
@@ -10586,7 +7944,7 @@ and returned.
Stats.stop
was previously called,
boolean
-
- (default FAULT_TOLERANCE.FATAL_ALL
)
- Starts listeners for each listen Multiaddr.
+Starts listeners for each given Multiaddr.
-(Array<Multiaddr>)
+
+ Enum Transport Manager Fault Tolerance values. -FATAL_ALL should be used for failing in any listen circumstance. -NO_FATAL should be used for not failing when not listening.
- -- Type: - number -
- - - - - - - - - - - - - - - - - - - - @@ -11793,7 +9092,7 @@ NO_FATAL should be used for not failing when not listening. - + src/upgrader.js @@ -11954,7 +9253,7 @@ NO_FATAL should be used for not failing when not listening.Responsible for managing known peers, as well as their addresses, protocols and metadata.
+Responsible for managing known peers, as well as their addresses and metadata
AddressBook containing a map of peerIdStr to Address.
- -KeyBook containing a map of peerIdStr to their PeerId with public keys.
- -MetadataBook containing a map of peerIdStr to their metadata Map.
- -ProtoBook containing a map of peerIdStr to supported protocols.
- -Start the PeerStore.
- -Stop the PeerStore.
- -Get all the stored information of every peer.
+Map of peers
Stores the peerInfo of a new peer.
+If already exist, its info is updated. If silent
is set to
+true, no 'peer' event will be emitted. This can be useful if you
+are already in the process of dialing the peer. The peer is technically
+known, but may not have been added to the PeerStore yet.
(PeerInfo)
+
+ Map<string, Peer>
:
+ PeerInfo
:
@@ -12909,11 +9974,11 @@ NO_FATAL should be used for not failing when not listening.
Delete the information of the given peer in every book.
+Add a new peer to the store.
-(PeerId)
+ peerInfo (PeerInfo)
boolean
:
- true if found and removed
+ PeerInfo
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Updates an already known peer.
+ +(PeerInfo)
+
+ PeerInfo
:
+
@@ -13002,16 +10146,16 @@ NO_FATAL should be used for not failing when not listening.
- Get the stored information of a given peer.
+Get the info to the given id.
-PeerInfo
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Has the info to the given id.
+ + + + + + + + + + + + + +((PeerId | string))
+ b58str id
+
+ boolean
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Removes the Peer with the matching peerId
from the PeerStore
((PeerId | string))
+ b58str id
+
+ boolean
:
+ true if found and removed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Completely replaces the existing peers metadata with the given peerInfo
(PeerInfo)
Peer
:
+ void
:
@@ -13067,92 +10451,11 @@ NO_FATAL should be used for not failing when not listening.
The AddressBook is responsible for keeping the known multiaddrs -of a peer.
- -- Extends - - Book - -
- - - - - - - - - - -(PeerStore)
-
- Map known peers to their known Addresses.
- -Set known multiaddrs of a provided peer.
- -(PeerId)
-
- (Array<Multiaddr>)
-
- AddressBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Add known addresses of a provided peer. -If the peer is not known, it is set with the given addresses.
- -(PeerId)
-
- (Array<Multiaddr>)
-
- AddressBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get the known multiaddrs for a given peer. All returned multiaddrs +
Returns the known multiaddrs for a given PeerInfo
. All returned multiaddrs
will include the encapsulated PeerId
of the peer.
PeerId
of the peer.
(PeerId)
+ peer (PeerInfo)
PeerId
of the peer.
-
-
- PeerStore Event emitter, used by the AddressBook to emit: -"peer" - emitted when a peer is discovered by the node. -"change:multiaddrs" - emitted when the known multiaddrs of a peer change.
- -PeerStore Event emitter, used by the ProtoBook to emit: -"change:protocols" - emitted when the known protocols of a peer change.
- -The Book is the skeleton for the PeerStore books.
- - - - - - - - - - - - - -(Object)
-
- Name | -Description | -
---|---|
$0.peerStore any
- |
- - |
$0.eventName any
- |
- - |
$0.eventProperty any
- |
- - |
$0.eventTransformer any
-
- (default passthrough )
- |
- - |
(Object)
-
- Map known peers to their data.
- -Set known data of a provided peer.
- -(PeerId)
-
- ((Array<Data> | Data))
-
- Get the known data of a provided peer.
- -(PeerId)
-
- Array<Data>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Deletes the provided peer from the book.
- -(PeerId)
-
- boolean
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-The KeyBook is responsible for keeping the known public keys of a peer.
- -- Extends - - Book - -
- - - - - - - - - - -(PeerStore)
-
- Map known peers to their known Public Key.
- -Set the Peer public key.
- -(PeerId)
-
- ((RsaPublicKey | Ed25519PublicKey | Secp256k1PublicKey))
-
- KeyBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get Public key of the given PeerId, if stored.
- -(PeerId)
-
- (RsaPublicKey | Ed25519PublicKey | Secp256k1PublicKey)
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-The MetadataBook is responsible for keeping the known supported -protocols of a peer.
- -- Extends - - Book - -
- - - - - - - - - - -(PeerStore)
-
- Set metadata key and value of a provided peer.
- - - - - - - - - - - - - -(PeerId)
-
- (string)
- metadata key
-
- (Buffer)
- metadata value
-
- ProtoBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Set data into the datastructure
- -(any)
-
- (any)
-
- (any)
-
- (Object
- = {}
)
-
- Name | -Description | -
---|---|
$3.emit any
-
- (default true )
- |
- - |
Get the known data of a provided peer.
- - - - - - - - - - - - - -(PeerId)
-
- Map<string, Buffer>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Get specific metadata value, if it exists
- - - - - - - - - - - - - -(PeerId)
-
- (string)
-
- Buffer
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Deletes the provided peer from the book.
- -(PeerId)
-
- boolean
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Deletes the provided peer metadata key from the book.
- - - - - - - - - - - - - -(PeerId)
-
- (string)
-
- boolean
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-PeerStore Event emitter, used by the MetadataBook to emit: -"change:metadata" - emitted when the known metadata of a peer change.
- -The ProtoBook is responsible for keeping the known supported -protocols of a peer.
- -- Extends - - Book - -
- - - - - - - - - - -(PeerStore)
-
- Map known peers to their known protocols.
- -Set known protocols of a provided peer. -If the peer was not known before, it will be added.
- - - - - - - - - - - - - -ProtoBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Adds known protocols of a provided peer. -If the peer was not known before, it will be added.
- - - - - - - - - - - - - -ProtoBook
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Responsible for managing the persistence of data in the PeerStore.
- - - - -- Extends - - PeerStore - -
- - - - - - - - - - -(Object)
-
- Name | -Description | -
---|---|
$0.datastore any
- |
- - |
$0.threshold any
-
- (default 5 )
- |
- - |
(Object)
-
- Backend datastore used to persist data.
- -Peers modified after the latest data persisted.
- -Peers metadata changed mapping peer identifers to metadata changed.
- -Start Persistent PeerStore.
- -Promise<void>
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
any
- Map of connections per peer +TODO: this should be handled by connectionManager
+ +Get a connection with a peer.
+Cleans up the registrar
-Add a new connected peer to the record +TODO: this should live in the ConnectionManager
+ +(PeerId)
+ peerInfo (PeerInfo)
+
+ (Connection)
+
+ void
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Remove a disconnected peer from the record +TODO: this should live in the ConnectionManager
+ +(PeerInfo)
+
+ (Connection)
+
+ (Error?)
+
+ void
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Get a connection with a peer.
+ +(PeerInfo)
Remove a disconnected peer from the record
- -(Connection)
-
- (Error?)
-
- void
:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Ping a given peer and wait for its response, getting the operation latency.
- + @@ -16307,7 +11300,7 @@ If the peer was not known before, it will be added.(PeerId)
+ peer (PeerInfo)
Libp2p
+ Registrar
PeerInfo
+ Replaces the multiaddrs on the given peerInfo
,
+with the provided multiaddrs
Replaces the protocols on the given peerInfo
,
+with the provided protocols