diff --git a/index.html b/index.html index 06258e45..e5f2dc81 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - libp2p 0.28.10 | Documentation + libp2p 0.29.0-rc.0 | Documentation @@ -15,7 +15,7 @@

libp2p

-
0.28.10
+
0.29.0-rc.0
-
  • - Intro - - - -
  • - -
  • @@ -203,56 +193,6 @@
  • -
  • - subscribe - - - -
  • - - -
  • - unsubscribe - - - -
  • - - -
  • - publish - - - -
  • - - -
  • - getTopics - - - -
  • - - -
  • - getSubscribers - - - -
  • - -
  • @@ -1345,6 +1285,24 @@ #data
  • +
  • + #consumePeerRecord +
  • + +
  • + #getRawEnvelope +
  • + +
  • + #getPeerRecord +
  • +
  • @@ -1357,6 +1315,12 @@ #add
  • +
  • + #get +
  • +
  • @@ -1592,6 +1556,26 @@
  • +
  • + subscribe + + + +
  • + + +
  • + unsubscribe + + + +
  • + +
  • @@ -1810,6 +1794,16 @@
  • +
  • + _getSelfPeerRecord + + + +
  • + +
  • @@ -1819,6 +1813,124 @@
  • + +
  • + Envelope + + + + + +
  • + + +
  • + formatSignaturePayload + + + +
  • + + +
  • + PeerRecord + + + + + +
  • +
    @@ -1829,34 +1941,6 @@
    -
    - -

    - Intro -

    - - -

    Installable via npm install --save libp2p, it can also be used directly in the browser.

    -

    Download

    -

    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')
    -

    In the Browser

    -

    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

    - - - -
    - - -
    @@ -1867,7 +1951,7 @@ - + src/index.js @@ -1936,7 +2020,7 @@
    - + src/index.js @@ -2026,7 +2110,7 @@ instance if one is not provided in options.

    - + src/index.js @@ -2114,7 +2198,7 @@ if there is a handler. If not, errors will be logged.

    - + src/index.js @@ -2180,7 +2264,7 @@ if there is a handler. If not, errors will be logged.

    - + src/index.js @@ -2246,7 +2330,7 @@ if there is a handler. If not, errors will be logged.

    - + src/index.js @@ -2313,7 +2397,7 @@ Imports the private key as 'self', if needed.

    - + src/index.js @@ -2380,7 +2464,7 @@ Imports the private key as 'self', if needed.

    - + src/index.js @@ -2493,7 +2577,7 @@ peer will be added to the nodes peerStore

    - + src/index.js @@ -2615,7 +2699,7 @@ and the Connection will be returned

    - + src/index.js @@ -2683,7 +2767,7 @@ Duplicated addresses and noAnnounce addresses are filtered out.

    - + src/index.js @@ -2763,7 +2847,7 @@ Duplicated addresses and noAnnounce addresses are filtered out.

    - + src/index.js @@ -2843,7 +2927,7 @@ Duplicated addresses and noAnnounce addresses are filtered out.

    - + src/index.js @@ -2922,7 +3006,7 @@ Duplicated addresses and noAnnounce addresses are filtered out.

    - + src/index.js @@ -3002,7 +3086,7 @@ will no longer be supported on streams.

    - + src/peer-routing.js @@ -3111,7 +3195,7 @@ will no longer be supported on streams.

    - + src/content-routing.js @@ -3230,7 +3314,7 @@ Once a content router succeeds, iteration will stop.

    - + src/content-routing.js @@ -3307,7 +3391,7 @@ a provider of the given key.

    - + src/content-routing.js @@ -3316,7 +3400,7 @@ a provider of the given key.

    Store the given key/value pair in the DHT.

    -
    put(key: Buffer, value: Buffer, options: Object?): Promise<void>
    +
    put(key: Uint8Array, value: Uint8Array, options: Object?): Promise<void>
    @@ -3333,7 +3417,7 @@ a provider of the given key.

    - key (Buffer) + key (Uint8Array)
    @@ -3341,7 +3425,7 @@ a provider of the given key.

    - value (Buffer) + value (Uint8Array)
    @@ -3424,7 +3508,7 @@ a provider of the given key.

    - + src/content-routing.js @@ -3434,7 +3518,7 @@ a provider of the given key.

    Get the value to the given key. Times out after 1 minute by default.

    -
    get(key: Buffer, options: Object?): Promise<{from: PeerId, val: Buffer}>
    +
    get(key: Uint8Array, options: Object?): Promise<{from: PeerId, val: Uint8Array}>
    @@ -3451,7 +3535,7 @@ Times out after 1 minute by default.

    - key (Buffer) + key (Uint8Array)
    @@ -3499,7 +3583,7 @@ Times out after 1 minute by default.

    Returns
    - 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.

    -
    getMany(key: Buffer, nVals: number, options: Object?): Promise<Array<{from: PeerId, val: Buffer}>>
    +
    getMany(key: Uint8Array, nVals: number, options: Object?): Promise<Array<{from: PeerId, val: Uint8Array}>>
    @@ -3560,7 +3644,7 @@ Times out after 1 minute by default.

    - key (Buffer) + key (Uint8Array)
    @@ -3616,387 +3700,7 @@ Times out after 1 minute by default.

    Returns
    - Promise<Array<{from: PeerId, val: Buffer}>>: - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - subscribe -

    - - - - src/pubsub.js - - -
    - - -

    Subscribe the given handler to a pubsub topic

    - -
    subscribe(topic: string, handler: function): void
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - topic (string) - -
    - -
    - -
    -
    - handler (function) - The handler to subscribe - -
    - -
    - -
    - - - - - - -
    Returns
    - void: - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - unsubscribe -

    - - - - src/pubsub.js - - -
    - - -

    Unsubscribes from a pubsub topic

    - -
    unsubscribe(topic: string, handler: function?)
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - topic (string) - -
    - -
    - -
    -
    - handler (function?) - The handler to unsubscribe from - -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - publish -

    - - - - src/pubsub.js - - -
    - - -

    Publish messages to the given topics.

    - -
    publish(topic: (Array<string> | string), data: Buffer): Promise<void>
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - topic ((Array<string> | string)) - -
    - -
    - -
    -
    - data (Buffer) - -
    - -
    - -
    - - - - - - -
    Returns
    - Promise<void>: - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - getTopics -

    - - - - src/pubsub.js - - -
    - - -

    Get a list of topics the node is subscribed to.

    - -
    getTopics(): Array<String>
    - - - - - - - - - - - - - - - - -
    Returns
    - Array<String>: - topics - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - getSubscribers -

    - - - - src/pubsub.js - - -
    - - -

    Get a list of the peer-ids that are subscribed to one topic.

    - -
    getSubscribers(topic: string): Array<string>
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - topic (string) - -
    - -
    - -
    - - - - - - -
    Returns
    - 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.

    - + src/address-manager/index.js @@ -4305,7 +4009,7 @@ address adverstising to other peers in the network.

    - + src/address-manager/index.js @@ -4371,7 +4075,7 @@ address adverstising to other peers in the network.

    - + src/address-manager/index.js @@ -4445,7 +4149,7 @@ address adverstising to other peers in the network.

    - + src/connection-manager/index.js @@ -4525,7 +4229,7 @@ address adverstising to other peers in the network.

    - + src/connection-manager/index.js @@ -4588,7 +4292,7 @@ address adverstising to other peers in the network.

    - + src/connection-manager/index.js @@ -4651,7 +4355,7 @@ address adverstising to other peers in the network.

    - + src/connection-manager/index.js @@ -4709,7 +4413,7 @@ address adverstising to other peers in the network.

    - + src/connection-manager/index.js @@ -4768,7 +4472,7 @@ only event loop and connection limits will be monitored.

    - + src/connection-manager/index.js @@ -4826,7 +4530,7 @@ only event loop and connection limits will be monitored.

    - + src/connection-manager/index.js @@ -4884,7 +4588,7 @@ only event loop and connection limits will be monitored.

    - + src/connection-manager/index.js @@ -4965,7 +4669,7 @@ will be disconnected first.

    - + src/connection-manager/index.js @@ -5036,7 +4740,7 @@ will be disconnected first.

    - + src/connection-manager/index.js @@ -5107,7 +4811,7 @@ will be disconnected first.

    - + src/connection-manager/index.js @@ -5186,7 +4890,7 @@ will be disconnected first.

    - + src/connection-manager/index.js @@ -5273,7 +4977,7 @@ will be disconnected first.

    - + src/connection-manager/latency-monitor.js @@ -5327,7 +5031,7 @@ will be disconnected first.

    - + src/connection-manager/latency-monitor.js @@ -5425,7 +5129,7 @@ will be disconnected first.

    - + src/connection-manager/latency-monitor.js @@ -5600,7 +5304,7 @@ monitor.on('data', (summary) => - + src/connection-manager/latency-monitor.js @@ -5675,7 +5379,7 @@ it will not count for this time period

    - + src/connection-manager/visibility-change-emitter.js @@ -5729,7 +5433,7 @@ it will not count for this time period

    - + src/connection-manager/visibility-change-emitter.js @@ -5803,7 +5507,7 @@ it will not count for this time period

    - + src/connection-manager/visibility-change-emitter.js @@ -5866,7 +5570,7 @@ it will not count for this time period

    - + src/circuit/index.js @@ -5965,7 +5669,7 @@ it will not count for this time period

    - + src/circuit/index.js @@ -6075,7 +5779,7 @@ it will not count for this time period

    - + src/circuit/index.js @@ -6158,7 +5862,7 @@ it will not count for this time period

    - + src/circuit/index.js @@ -6233,7 +5937,7 @@ it will not count for this time period

    - + src/circuit/index.js @@ -6287,7 +5991,7 @@ it will not count for this time period

    - + src/identify/index.js @@ -6355,7 +6059,7 @@ it will not count for this time period

    - + src/circuit/listener.js @@ -6425,7 +6129,7 @@ it will not count for this time period

    - + src/circuit/listener.js @@ -6504,7 +6208,7 @@ it will not count for this time period

    - + src/circuit/listener.js @@ -6570,7 +6274,7 @@ it will not count for this time period

    - + src/circuit/listener.js @@ -6655,7 +6359,7 @@ be dialed over TCP rather than any other transport

    - + src/circuit/circuit/hop.js @@ -6772,7 +6476,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/utils.js @@ -6847,7 +6551,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/utils.js @@ -6923,7 +6627,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/stream-handler.js @@ -7026,7 +6730,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/stream-handler.js @@ -7088,7 +6792,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/stream-handler.js @@ -7156,7 +6860,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/stream-handler.js @@ -7218,7 +6922,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/circuit/circuit/stream-handler.js @@ -7280,7 +6984,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/dialer/index.js @@ -7468,7 +7172,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/dialer/index.js @@ -7522,7 +7226,7 @@ peer. A new, virtual, connection will be created between the two via the relay.< - + src/dialer/index.js @@ -7634,7 +7338,7 @@ will be used.

    - + src/dialer/index.js @@ -7717,7 +7421,7 @@ will be used.

    - + src/dialer/index.js @@ -7820,7 +7524,7 @@ will be used.

    - + src/dialer/dial-request.js @@ -7931,7 +7635,7 @@ all other dials in the request will be cancelled.

    - + src/dialer/dial-request.js @@ -8030,7 +7734,7 @@ all other dials in the request will be cancelled.

    - + src/keychain/index.js @@ -8108,7 +7812,7 @@ all other dials in the request will be cancelled.

    - + src/keychain/index.js @@ -8186,7 +7890,7 @@ all other dials in the request will be cancelled.

    - + src/keychain/index.js @@ -8252,7 +7956,7 @@ all other dials in the request will be cancelled.

    - + src/keychain/index.js @@ -8327,7 +8031,7 @@ The default options for a keychain.

    - + src/keychain/index.js @@ -8397,7 +8101,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8495,7 +8199,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8561,7 +8265,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8641,7 +8345,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8721,7 +8425,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8801,7 +8505,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8890,7 +8594,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -8979,7 +8683,7 @@ arbitrary message content.

    - + src/keychain/index.js @@ -9085,7 +8789,7 @@ arbitrary message content.

    - + src/keychain/cms.js @@ -9155,7 +8859,7 @@ arbitrary message content.

    - + src/keychain/cms.js @@ -9163,9 +8867,9 @@ arbitrary message content.

    Creates some protected data.

    -

    The output Buffer contains the PKCS #7 message in DER.

    +

    The output Uint8Array contains the PKCS #7 message in DER.

    -
    encrypt(name: string, plain: Buffer): undefined
    +
    encrypt(name: string, plain: Uint8Array): undefined
    @@ -9191,7 +8895,7 @@ arbitrary message content.

    - plain (Buffer) + plain (Uint8Array) The data to encrypt.
    @@ -9245,7 +8949,7 @@ arbitrary message content.

    - + src/keychain/cms.js @@ -9256,7 +8960,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.

    -
    decrypt(cmsData: Buffer): undefined
    +
    decrypt(cmsData: Uint8Array): undefined
    @@ -9273,7 +8977,7 @@ exists, an Error is returned with the property 'missingKeys'. It is array of ke
    - cmsData (Buffer) + cmsData (Uint8Array) The CMS encrypted data to decrypt.
    @@ -9335,7 +9039,7 @@ exists, an Error is returned with the property 'missingKeys'. It is array of ke - + src/keychain/util.js @@ -9343,10 +9047,10 @@ exists, an Error is returned with the property 'missingKeys'. It is array of ke

    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

    -
    certificateForKey(key: KeyInfo, privateKey: RsaPrivateKey): undefined
    +
    certificateForKey(key: KeyInfo, privateKey: RsaPrivateKey): Uint8Array
    @@ -9387,7 +9091,7 @@ exists, an Error is returned with the property 'missingKeys'. It is array of ke
    Returns
    - 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.

    - + src/metrics/stats.js @@ -10654,7 +10358,7 @@ should only need to be called if Stats.stop was previously called,
    - + src/metrics/stats.js @@ -10721,7 +10425,7 @@ timer.

    - + src/metrics/stats.js @@ -10787,7 +10491,7 @@ timer.

    - + src/metrics/stats.js @@ -10853,7 +10557,7 @@ timer.

    - + src/metrics/stats.js @@ -10919,7 +10623,7 @@ timer.

    - + src/metrics/stats.js @@ -11015,7 +10719,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11126,7 +10830,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11219,7 +10923,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11273,7 +10977,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11356,7 +11060,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11418,7 +11122,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11480,7 +11184,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11555,7 +11259,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11609,7 +11313,7 @@ current Timestamp, then resets the update timer.

    - + src/transport-manager.js @@ -11677,7 +11381,7 @@ If a transport has any running listeners, they will be closed.

    - + src/transport-manager.js @@ -11732,7 +11436,7 @@ If any listeners are running, they will be closed.

    - + src/transport-manager.js @@ -11793,7 +11497,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -11954,7 +11658,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -12033,7 +11737,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -12120,7 +11824,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -12284,7 +11988,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -12363,7 +12067,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/upgrader.js @@ -12450,7 +12154,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12459,7 +12163,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.

    -
    new PeerStore()
    +
    new PeerStore($0: Object)

    @@ -12478,6 +12182,43 @@ NO_FATAL should be used for not failing when not listening.

    +
    Parameters
    +
    + +
    +
    + $0 (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    $0.peerId any +
    + +
    + +
    + @@ -12509,7 +12250,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12567,7 +12308,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12625,7 +12366,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12683,7 +12424,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12741,7 +12482,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12799,7 +12540,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -12857,14 +12598,14 @@ NO_FATAL should be used for not failing when not listening.

    -

    Get all the stored information of every peer.

    +

    Get all the stored information of every peer known.

    peers
    @@ -12923,7 +12664,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -13002,7 +12743,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/index.js @@ -13089,7 +12830,7 @@ NO_FATAL should be used for not failing when not listening.

    - + src/peer-store/address-book.js @@ -13162,20 +12903,20 @@ of a peer.

    -

    Map known peers to their known Addresses.

    +

    Map known peers to their known Address Entries.

    data

    Type: - Map<string, Array<Address>> + Map<string, Array<Entry>>

    @@ -13197,6 +12938,247 @@ of a peer.

    + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + consumePeerRecord(envelope) +
    +
    + +
    + +
    +
    +
    + + getRawEnvelope(peerId) +
    +
    + +
    + +
    +
    +
    + + getPeerRecord(peerId) +
    +
    + +
    + +
    +
    +
    + + get(peerId) +
    +
    + @@ -13400,7 +13464,7 @@ If the peer is not known, it is set with the given addresses.

    - + src/peer-store/address-book.js @@ -13489,7 +13553,7 @@ Returns 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
    - + src/peer-store/book.js @@ -13781,7 +13845,7 @@ Returns undefined if there are no known multiaddrs for the given pe
    - + src/peer-store/book.js @@ -13860,7 +13924,7 @@ Returns undefined if there are no known multiaddrs for the given pe
    - + src/peer-store/book.js @@ -13940,7 +14004,7 @@ Returns undefined if there is no available data for the given peer.
    - + src/peer-store/book.js @@ -14027,7 +14091,7 @@ Returns 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.
    - + src/peer-store/key-book.js @@ -14162,7 +14226,7 @@ Returns undefined if there is no available data for the given peer.
    - + src/peer-store/key-book.js @@ -14249,7 +14313,7 @@ Returns undefined if there is no available data for the given peer.
    - + src/peer-store/key-book.js @@ -14336,7 +14400,7 @@ Returns 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.

    - + src/peer-store/metadata-book.js @@ -14422,7 +14486,7 @@ protocols of a peer.

    Type: - Map<string, Map<string, Buffer>> + Map<string, Map<string, Uint8Array>>

    @@ -14472,7 +14536,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -14481,7 +14545,7 @@ protocols of a peer.

    Set metadata key and value of a provided peer.

    -
    set(peerId: PeerId, key: string, value: Buffer): ProtoBook
    +
    set(peerId: PeerId, key: string, value: Uint8Array): ProtoBook
    @@ -14515,7 +14579,7 @@ protocols of a peer.

    - value (Buffer) + value (Uint8Array) metadata value
    @@ -14569,7 +14633,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -14691,7 +14755,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -14700,7 +14764,7 @@ protocols of a peer.

    Get the known data of a provided peer.

    -
    get(peerId: PeerId): Map<string, Buffer>
    +
    get(peerId: PeerId): Map<string, Uint8Array>
    @@ -14731,7 +14795,7 @@ protocols of a peer.

    Returns
    - Map<string, Buffer>: + Map<string, Uint8Array>: @@ -14770,7 +14834,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -14779,7 +14843,7 @@ protocols of a peer.

    Get specific metadata value, if it exists

    -
    getValue(peerId: PeerId, key: string): Buffer
    +
    getValue(peerId: PeerId, key: string): Uint8Array
    @@ -14818,7 +14882,7 @@ protocols of a peer.

    Returns
    - Buffer: + Uint8Array: @@ -14857,7 +14921,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -14936,7 +15000,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -15031,7 +15095,7 @@ protocols of a peer.

    - + src/peer-store/metadata-book.js @@ -15086,7 +15150,7 @@ protocols of a peer.

    - + src/peer-store/proto-book.js @@ -15159,7 +15223,7 @@ protocols of a peer.

    - + src/peer-store/proto-book.js @@ -15222,7 +15286,7 @@ protocols of a peer.

    - + src/peer-store/proto-book.js @@ -15310,7 +15374,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/proto-book.js @@ -15391,6 +15455,172 @@ If the peer was not known before, it will be added.

    + + + + + +
    + + +
    + +

    + subscribe +

    + + + + src/pubsub-adapter.js + + +
    + + +

    Subscribes to a given topic.

    + +
    subscribe(topic: string, handler: function (msg: InMessage)?): void
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + topic (string) + +
    + +
    + +
    +
    + handler (function (msg: InMessage)?) + +
    + +
    + +
    + + + + + + +
    Returns
    + void: + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + unsubscribe +

    + + + + src/pubsub-adapter.js + + +
    + + +

    Unsubscribe from the given topic.

    + +
    unsubscribe(topic: string, handler: function (msg: InMessage)?): void
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + topic (string) + +
    + +
    + +
    +
    + handler (function (msg: InMessage)?) + +
    + +
    + +
    + + + + + + +
    Returns
    + void: + + + + + + + + + + + + + + + + + + +
    @@ -15406,7 +15636,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/persistent/index.js @@ -15456,6 +15686,14 @@ If the peer was not known before, it will be added.

    + + $0.peerId any + + + + + + $0.datastore any @@ -15520,7 +15758,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/persistent/index.js @@ -15578,7 +15816,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/persistent/index.js @@ -15636,7 +15874,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/persistent/index.js @@ -15699,7 +15937,7 @@ If the peer was not known before, it will be added.

    - + src/peer-store/persistent/index.js @@ -15773,7 +16011,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -15878,7 +16116,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -15941,7 +16179,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -16020,7 +16258,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -16100,7 +16338,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -16180,7 +16418,7 @@ If the peer was not known before, it will be added.

    - + src/registrar.js @@ -16275,7 +16513,7 @@ If the peer was not known before, it will be added.

    - + src/ping/index.js @@ -16358,7 +16596,7 @@ If the peer was not known before, it will be added.

    - + src/ping/index.js @@ -16425,7 +16663,7 @@ If the peer was not known before, it will be added.

    - + src/ping/index.js @@ -16492,7 +16730,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16591,7 +16829,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16644,7 +16882,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16697,7 +16935,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16750,7 +16988,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16803,7 +17041,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16878,7 +17116,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -16945,7 +17183,7 @@ If the peer was not known before, it will be added.

    - + src/identify/index.js @@ -17022,7 +17260,7 @@ an error will be thrown.

    - + src/identify/index.js @@ -17122,6 +17360,68 @@ an error will be thrown.

    + + + + + +
    + + +
    + +

    + _getSelfPeerRecord +

    + + + + src/identify/index.js + + +
    + + +

    Get self signed peer record raw envelope.

    + +
    _getSelfPeerRecord(): Uint8Array
    + + + + + + + + + + + + + + + + +
    Returns
    + Uint8Array: + + + + + + + + + + + + + + + + + + +
    @@ -17137,7 +17437,7 @@ an error will be thrown.

    - + src/identify/index.js @@ -17146,7 +17446,7 @@ an error will be thrown.

    Takes the addr and converts it to a Multiaddr if possible

    -
    getCleanMultiaddr(addr: (Buffer | String)): (Multiaddr | null)
    +
    getCleanMultiaddr(addr: (Uint8Array | String)): (Multiaddr | null)
    @@ -17163,7 +17463,7 @@ an error will be thrown.

    - addr ((Buffer | String)) + addr ((Uint8Array | String))
    @@ -17197,6 +17497,1076 @@ an error will be thrown.

    + + + + + +
    + + +
    + +

    + Envelope +

    + + + + src/record/envelope/index.js + + +
    + + +

    The Envelope is responsible for keeping an arbitrary signed record +by a libp2p peer.

    + +
    new Envelope($0: Object, params: object)
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + $0 (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    $0.peerId any +
    $0.payloadType any +
    $0.payload any +
    $0.signature any +
    + +
    + +
    +
    + params (object) + +
    + +
    + +
    + + + + + + + + + + + + + +
    Static Members
    +
    + +
    +
    +
    + + createFromProtobuf(data) +
    +
    + +
    + +
    +
    +
    + + seal(record, peerId) +
    +
    + +
    + +
    +
    +
    + + openAndCertify(data, domain) +
    +
    + +
    + +
    + + + + +
    Instance Members
    +
    + +
    +
    +
    + + marshal() +
    +
    + +
    + +
    +
    +
    + + equals(other) +
    +
    + +
    + +
    +
    +
    + + validate(domain) +
    +
    + +
    + +
    + + + + + + +
    + + + + +
    + + +
    + +

    + formatSignaturePayload +

    + + + + src/record/envelope/index.js + + +
    + + +

    Helper function that prepares a Uint8Array to sign or verify a signature.

    + +
    formatSignaturePayload
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + domain (string) + +
    + +
    + +
    +
    + payloadType (Uint8Array) + +
    + +
    + +
    +
    + payload (Uint8Array) + +
    + +
    + +
    + + + + + + +
    Returns
    + Uint8Array: + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + PeerRecord +

    + + + + src/record/peer-record/index.js + + +
    + + +

    The PeerRecord is used for distributing peer routing records across the network. +It contains the peer's reachable listen addresses.

    + +
    new PeerRecord($0: Object, params: object)
    + + +

    + Extends + + Record + +

    + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + $0 (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    $0.peerId any +
    $0.multiaddrs any + + (default []) +
    $0.seqNumber any + + (default Date.now()) +
    + +
    + +
    +
    + params (object) + +
    + +
    + +
    + + + + + + + + + + + + + +
    Static Members
    +
    + +
    +
    +
    + + createFromProtobuf(buf) +
    +
    + +
    + +
    + + + + +
    Instance Members
    +
    + +
    +
    +
    + + marshal() +
    +
    + +
    + +
    +
    +
    + + equals(other) +
    +
    + +
    + +
    + + + + + +