@libp2p/interface 1.1.3 → 1.1.4-2122a713d
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 +17 -8
- package/dist/index.min.js +1 -1
- package/dist/src/content-routing/index.d.ts +5 -5
- package/dist/src/content-routing/index.js +1 -1
- package/dist/src/event-target.d.ts +1 -0
- package/dist/src/event-target.d.ts.map +1 -1
- package/dist/src/event-target.js +7 -0
- package/dist/src/event-target.js.map +1 -1
- package/dist/src/index.d.ts +26 -26
- package/dist/src/peer-discovery/index.d.ts +1 -1
- package/dist/src/peer-discovery/index.js +1 -1
- package/dist/src/peer-routing/index.d.ts +3 -3
- package/dist/src/peer-routing/index.js +1 -1
- package/dist/src/peer-store/index.d.ts +9 -9
- package/dist/src/pubsub/index.d.ts +6 -6
- package/package.json +5 -4
- package/src/content-routing/index.ts +5 -5
- package/src/event-target.ts +10 -0
- package/src/index.ts +26 -26
- package/src/peer-discovery/index.ts +1 -1
- package/src/peer-routing/index.ts +3 -3
- package/src/peer-store/index.ts +9 -9
- package/src/pubsub/index.ts +6 -6
- package/dist/typedoc-urls.json +0 -158
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# @libp2p/interface
|
|
2
|
+
|
|
1
3
|
[](http://libp2p.io/)
|
|
2
4
|
[](https://discuss.libp2p.io)
|
|
3
5
|
[](https://codecov.io/gh/libp2p/js-libp2p)
|
|
@@ -7,6 +9,21 @@
|
|
|
7
9
|
|
|
8
10
|
# About
|
|
9
11
|
|
|
12
|
+
<!--
|
|
13
|
+
|
|
14
|
+
!IMPORTANT!
|
|
15
|
+
|
|
16
|
+
Everything in this README between "# About" and "# Install" is automatically
|
|
17
|
+
generated and will be overwritten the next time the doc generator is run.
|
|
18
|
+
|
|
19
|
+
To make changes to this section, please update the @packageDocumentation section
|
|
20
|
+
of src/index.js or src/index.ts
|
|
21
|
+
|
|
22
|
+
To experiment with formatting, please run "npm run docs" from the root of this
|
|
23
|
+
repo and examine the changes made.
|
|
24
|
+
|
|
25
|
+
-->
|
|
26
|
+
|
|
10
27
|
Exports a `Libp2p` type for modules to use as a type argument.
|
|
11
28
|
|
|
12
29
|
## Example
|
|
@@ -25,14 +42,6 @@ function doSomethingWithLibp2p (node: Libp2p) {
|
|
|
25
42
|
$ npm i @libp2p/interface
|
|
26
43
|
```
|
|
27
44
|
|
|
28
|
-
## Browser `<script>` tag
|
|
29
|
-
|
|
30
|
-
Loading this module through a script tag will make it's exports available as `Libp2pInterface` in the global namespace.
|
|
31
|
-
|
|
32
|
-
```html
|
|
33
|
-
<script src="https://unpkg.com/@libp2p/interface/dist/index.min.js"></script>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
45
|
# API Docs
|
|
37
46
|
|
|
38
47
|
- <https://libp2p.github.io/js-libp2p/modules/_libp2p_interface.html>
|
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var
|
|
2
|
+
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},N=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!g.call(e,r)&&r!==o&&n(e,r,{get:()=>t[r],enumerable:!(s=L(t,r))||s.enumerable});return e};var T=e=>N(n({},"__esModule",{value:!0}),e);var q={};I(q,{AbortError:()=>i,AggregateCodeError:()=>l,CodeError:()=>a,CustomEvent:()=>b,ERR_INVALID_MESSAGE:()=>Y,ERR_INVALID_PARAMETERS:()=>j,ERR_NOT_FOUND:()=>X,ERR_TIMEOUT:()=>G,Ed25519:()=>P,FaultTolerance:()=>p,InvalidCryptoExchangeError:()=>x,InvalidCryptoTransmissionError:()=>u,KEEP_ALIVE:()=>U,RSA:()=>M,StrictNoSign:()=>B,StrictSign:()=>k,TopicValidatorResult:()=>c,TypedEventEmitter:()=>d,UnexpectedPeerError:()=>f,connectionSymbol:()=>R,contentRoutingSymbol:()=>w,isConnection:()=>v,isPeerId:()=>V,isStartable:()=>S,isTransport:()=>F,peerDiscoverySymbol:()=>D,peerIdSymbol:()=>h,peerRoutingSymbol:()=>C,secp256k1:()=>O,setMaxListeners:()=>m,start:()=>H,stop:()=>K,transportSymbol:()=>A});var R=Symbol.for("@libp2p/connection");function v(e){return e!=null&&!!e[R]}var w=Symbol.for("@libp2p/content-routing");var P="Ed25519",M="RSA",O="secp256k1";var D=Symbol.for("@libp2p/peer-discovery");var h=Symbol.for("@libp2p/peer-id");function V(e){return e!=null&&!!e[h]}var C=Symbol.for("@libp2p/peer-routing");var U="keep-alive";var k="StrictSign",B="StrictNoSign",c;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(c||(c={}));var A=Symbol.for("@libp2p/transport");function F(e){return e!=null&&!!e[A]}var p;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(p||(p={}));var i=class e extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=e.code,this.type=e.type}static code="ABORT_ERR";static type="aborted"},a=class extends Error{code;props;constructor(t,o,s){super(t),this.code=o,this.name=s?.name??"CodeError",this.props=s??{}}},l=class extends AggregateError{code;props;constructor(t,o,s,r){super(t,o),this.code=s,this.name=r?.name??"AggregateCodeError",this.props=r??{}}},f=class e extends Error{code;constructor(t="Unexpected Peer"){super(t),this.code=e.code}static code="ERR_UNEXPECTED_PEER"},x=class e extends Error{code;constructor(t="Invalid crypto exchange"){super(t),this.code=e.code}static code="ERR_INVALID_CRYPTO_EXCHANGE"},u=class e extends Error{code;constructor(t="Invalid crypto transmission"){super(t),this.code=e.code}static code="ERR_INVALID_CRYPTO_TRANSMISSION"},G="ERR_TIMEOUT",j="ERR_INVALID_PARAMETERS",X="ERR_NOT_FOUND",Y="ERR_INVALID_MESSAGE";var m=(e,...t)=>{try{[...t]}catch{}};var d=class extends EventTarget{#t=new Map;constructor(){super(),m(1/0,this)}listenerCount(t){let o=this.#t.get(t);return o==null?0:o.length}addEventListener(t,o,s){super.addEventListener(t,o,s);let r=this.#t.get(t);r==null&&(r=[],this.#t.set(t,r)),r.push({callback:o,once:(s!==!0&&s!==!1&&s?.once)??!1})}removeEventListener(t,o,s){super.removeEventListener(t.toString(),o??null,s);let r=this.#t.get(t);r!=null&&(r=r.filter(({callback:y})=>y!==o),this.#t.set(t,r))}dispatchEvent(t){let o=super.dispatchEvent(t),s=this.#t.get(t.type);return s==null||(s=s.filter(({once:r})=>!r),this.#t.set(t.type,s)),o}safeDispatchEvent(t,o={}){return this.dispatchEvent(new b(t,o))}},E=class extends Event{detail;constructor(t,o){super(t,o),this.detail=o?.detail}},b=globalThis.CustomEvent??E;function S(e){return e!=null&&typeof e.start=="function"&&typeof e.stop=="function"}async function H(...e){let t=[];for(let o of e)S(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStart!=null&&await o.beforeStart()})),await Promise.all(t.map(async o=>{await o.start()})),await Promise.all(t.map(async o=>{o.afterStart!=null&&await o.afterStart()}))}async function K(...e){let t=[];for(let o of e)S(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStop!=null&&await o.beforeStop()})),await Promise.all(t.map(async o=>{await o.stop()})),await Promise.all(t.map(async o=>{o.afterStop!=null&&await o.afterStop()}))}return T(q);})();
|
|
3
3
|
return Libp2PInterface}));
|
|
@@ -8,7 +8,7 @@ import type { CID } from 'multiformats/cid';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
*
|
|
11
|
-
* ```
|
|
11
|
+
* ```TypeScript
|
|
12
12
|
* import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing'
|
|
13
13
|
*
|
|
14
14
|
* class MyContentRouter implements ContentRouting {
|
|
@@ -35,7 +35,7 @@ export interface ContentRouting {
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
*
|
|
38
|
-
* ```
|
|
38
|
+
* ```TypeScript
|
|
39
39
|
* // ...
|
|
40
40
|
* await contentRouting.provide(cid)
|
|
41
41
|
* ```
|
|
@@ -46,7 +46,7 @@ export interface ContentRouting {
|
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
*
|
|
49
|
-
* ```
|
|
49
|
+
* ```TypeScript
|
|
50
50
|
* // Iterate over the providers found for the given cid
|
|
51
51
|
* for await (const provider of contentRouting.findProviders(cid)) {
|
|
52
52
|
* console.log(provider.id, provider.multiaddrs)
|
|
@@ -60,7 +60,7 @@ export interface ContentRouting {
|
|
|
60
60
|
*
|
|
61
61
|
* @example
|
|
62
62
|
*
|
|
63
|
-
* ```
|
|
63
|
+
* ```TypeScript
|
|
64
64
|
* // ...
|
|
65
65
|
* const key = '/key'
|
|
66
66
|
* const value = uint8ArrayFromString('oh hello there')
|
|
@@ -74,7 +74,7 @@ export interface ContentRouting {
|
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
76
|
*
|
|
77
|
-
* ```
|
|
77
|
+
* ```TypeScript
|
|
78
78
|
* // ...
|
|
79
79
|
*
|
|
80
80
|
* const key = '/key'
|
|
@@ -26,6 +26,7 @@ export interface TypedEventTarget<EventMap extends Record<string, any>> extends
|
|
|
26
26
|
*/
|
|
27
27
|
export declare class TypedEventEmitter<EventMap extends Record<string, any>> extends EventTarget implements TypedEventTarget<EventMap> {
|
|
28
28
|
#private;
|
|
29
|
+
constructor();
|
|
29
30
|
listenerCount(type: string): number;
|
|
30
31
|
addEventListener<K extends keyof EventMap>(type: K, listener: EventHandler<EventMap[K]> | null, options?: boolean | AddEventListenerOptions): void;
|
|
31
32
|
removeEventListener<K extends keyof EventMap>(type: K, listener?: EventHandler<EventMap[K]> | null, options?: boolean | EventListenerOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-target.d.ts","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-target.d.ts","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa,CAAC,SAAS;IAAI,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE;AACpE,MAAM,WAAW,WAAW,CAAC,SAAS;IAAI,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;CAAE;AACjF,MAAM,MAAM,YAAY,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC,CAAA;AAOvF;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAE,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAE,SAAQ,WAAW;IAC1F,gBAAgB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAAA;IAElJ,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IAEpC,mBAAmB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI,CAAA;IAEnJ,mBAAmB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI,CAAA;IAElH,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,OAAO,CAAA;CAC1F;AAED;;;GAGG;AACH,qBAAa,iBAAiB,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAE,SAAQ,WAAY,YAAW,gBAAgB,CAAC,QAAQ,CAAC;;;IAW5H,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAUpC,gBAAgB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI;IAiBlJ,mBAAmB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI;IAcnJ,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,OAAO;IAerC,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,EAAE,MAAM,GAAE,eAAe,CAAC,MAAM,CAAM,GAAG,OAAO;CAG/F;AAoBD,eAAO,MAAM,WAAW;;;CAAgD,CAAA"}
|
package/dist/src/event-target.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { setMaxListeners } from './events.js';
|
|
1
2
|
/**
|
|
2
3
|
* An implementation of a typed event target
|
|
3
4
|
* etc
|
|
4
5
|
*/
|
|
5
6
|
export class TypedEventEmitter extends EventTarget {
|
|
6
7
|
#listeners = new Map();
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
// silence MaxListenersExceededWarning warning on Node.js, this is a red
|
|
11
|
+
// herring almost all of the time
|
|
12
|
+
setMaxListeners(Infinity, this);
|
|
13
|
+
}
|
|
7
14
|
listenerCount(type) {
|
|
8
15
|
const listeners = this.#listeners.get(type);
|
|
9
16
|
if (listeners == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-target.js","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-target.js","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AA+B7C;;;GAGG;AACH,MAAM,OAAO,iBAAwD,SAAQ,WAAW;IACtF,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAA;IAEvC;QACE,KAAK,EAAE,CAAA;QAEP,wEAAwE;QACxE,iCAAiC;QACjC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,aAAa,CAAE,IAAY;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAE3C,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,OAAO,CAAC,CAAA;QACV,CAAC;QAED,OAAO,SAAS,CAAC,MAAM,CAAA;IACzB,CAAC;IAGD,gBAAgB,CAAE,IAAY,EAAE,QAA6B,EAAE,OAA2C;QACxG,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;QAE/C,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEpC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,IAAI,GAAG,EAAE,CAAA;YACT,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACjC,CAAC;QAED,IAAI,CAAC,IAAI,CAAC;YACR,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK;SACxE,CAAC,CAAA;IACJ,CAAC;IAGD,mBAAmB,CAAE,IAAY,EAAE,QAA8B,EAAE,OAAwC;QACzG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,IAAI,IAAI,EAAE,OAAO,CAAC,CAAA;QAErE,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEpC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAM;QACR,CAAC;QAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAA;QAC3D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,aAAa,CAAE,KAAY;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAEzC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE1C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAO,MAAM,CAAA;QACf,CAAC;QAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAErC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,iBAAiB,CAAS,IAAoB,EAAE,SAAkC,EAAE;QAClF,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAS,IAAc,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5E,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,mBAA6B,SAAQ,KAAK;IAC9C,2FAA2F;IACpF,MAAM,CAAG;IAEhB,YAAa,OAAe,EAAE,IAAgC;QAC5D,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACpB,sCAAsC;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,CAAA;IAC5B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,mBAAmB,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
120
120
|
*
|
|
121
121
|
* @example
|
|
122
122
|
*
|
|
123
|
-
* ```
|
|
123
|
+
* ```TypeScript
|
|
124
124
|
* libp2p.addEventListener('peer:discovery', (event) => {
|
|
125
125
|
* const peerInfo = event.detail
|
|
126
126
|
* // ...
|
|
@@ -133,7 +133,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
133
133
|
*
|
|
134
134
|
* @example
|
|
135
135
|
*
|
|
136
|
-
* ```
|
|
136
|
+
* ```TypeScript
|
|
137
137
|
* libp2p.addEventListener('peer:connect', (event) => {
|
|
138
138
|
* const peerId = event.detail
|
|
139
139
|
* // ...
|
|
@@ -148,7 +148,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
148
148
|
*
|
|
149
149
|
* @example
|
|
150
150
|
*
|
|
151
|
-
* ```
|
|
151
|
+
* ```TypeScript
|
|
152
152
|
* libp2p.addEventListener('peer:disconnect', (event) => {
|
|
153
153
|
* const peerId = event.detail
|
|
154
154
|
* // ...
|
|
@@ -163,7 +163,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
163
163
|
*
|
|
164
164
|
* @example
|
|
165
165
|
*
|
|
166
|
-
* ```
|
|
166
|
+
* ```TypeScript
|
|
167
167
|
* libp2p.addEventListener('peer:identify', (event) => {
|
|
168
168
|
* const identifyResult = event.detail
|
|
169
169
|
* // ...
|
|
@@ -189,7 +189,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
189
189
|
*
|
|
190
190
|
* @example
|
|
191
191
|
*
|
|
192
|
-
* ```
|
|
192
|
+
* ```TypeScript
|
|
193
193
|
* libp2p.addEventListener('self:peer:update', (event) => {
|
|
194
194
|
* const { peer } = event.detail
|
|
195
195
|
* // ...
|
|
@@ -224,7 +224,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
224
224
|
/**
|
|
225
225
|
* This event notifies listeners that the node has started
|
|
226
226
|
*
|
|
227
|
-
* ```
|
|
227
|
+
* ```TypeScript
|
|
228
228
|
* libp2p.addEventListener('start', (event) => {
|
|
229
229
|
* console.info(libp2p.isStarted()) // true
|
|
230
230
|
* })
|
|
@@ -234,7 +234,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
234
234
|
/**
|
|
235
235
|
* This event notifies listeners that the node has stopped
|
|
236
236
|
*
|
|
237
|
-
* ```
|
|
237
|
+
* ```TypeScript
|
|
238
238
|
* libp2p.addEventListener('stop', (event) => {
|
|
239
239
|
* console.info(libp2p.isStarted()) // false
|
|
240
240
|
* })
|
|
@@ -248,7 +248,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
248
248
|
*
|
|
249
249
|
* @example
|
|
250
250
|
*
|
|
251
|
-
* ```
|
|
251
|
+
* ```TypeScript
|
|
252
252
|
* const node = await createLibp2p({
|
|
253
253
|
* // ...other options
|
|
254
254
|
* services: {
|
|
@@ -300,7 +300,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
300
300
|
*
|
|
301
301
|
* @example
|
|
302
302
|
*
|
|
303
|
-
* ```
|
|
303
|
+
* ```TypeScript
|
|
304
304
|
* console.info(libp2p.peerId)
|
|
305
305
|
* // PeerId(12D3Foo...)
|
|
306
306
|
* ````
|
|
@@ -312,7 +312,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
312
312
|
*
|
|
313
313
|
* @example
|
|
314
314
|
*
|
|
315
|
-
* ```
|
|
315
|
+
* ```TypeScript
|
|
316
316
|
* const peer = await libp2p.peerStore.get(peerId)
|
|
317
317
|
* console.info(peer)
|
|
318
318
|
* // { id: PeerId(12D3Foo...), addresses: [] ... }
|
|
@@ -325,7 +325,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
325
325
|
*
|
|
326
326
|
* @example
|
|
327
327
|
*
|
|
328
|
-
* ```
|
|
328
|
+
* ```TypeScript
|
|
329
329
|
* const peerInfo = await libp2p.peerRouting.findPeer(peerId)
|
|
330
330
|
* console.info(peerInfo)
|
|
331
331
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -333,7 +333,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
333
333
|
*
|
|
334
334
|
* @example
|
|
335
335
|
*
|
|
336
|
-
* ```
|
|
336
|
+
* ```TypeScript
|
|
337
337
|
* for await (const peerInfo of libp2p.peerRouting.getClosestPeers(key)) {
|
|
338
338
|
* console.info(peerInfo)
|
|
339
339
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -348,7 +348,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
348
348
|
*
|
|
349
349
|
* @example
|
|
350
350
|
*
|
|
351
|
-
* ```
|
|
351
|
+
* ```TypeScript
|
|
352
352
|
* for await (const peerInfo of libp2p.contentRouting.findProviders(cid)) {
|
|
353
353
|
* console.info(peerInfo)
|
|
354
354
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -362,7 +362,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
362
362
|
*
|
|
363
363
|
* @example
|
|
364
364
|
*
|
|
365
|
-
* ```
|
|
365
|
+
* ```TypeScript
|
|
366
366
|
* const metric = libp2p.metrics.registerMetric({
|
|
367
367
|
* 'my-metric'
|
|
368
368
|
* })
|
|
@@ -390,7 +390,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
390
390
|
*
|
|
391
391
|
* @example
|
|
392
392
|
*
|
|
393
|
-
* ```
|
|
393
|
+
* ```TypeScript
|
|
394
394
|
* const listenMa = libp2p.getMultiaddrs()
|
|
395
395
|
* // [ <Multiaddr 047f00000106f9ba - /ip4/127.0.0.1/tcp/63930> ]
|
|
396
396
|
* ```
|
|
@@ -401,7 +401,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
401
401
|
*
|
|
402
402
|
* @example
|
|
403
403
|
*
|
|
404
|
-
* ```
|
|
404
|
+
* ```TypeScript
|
|
405
405
|
* const protocols = libp2p.getProtocols()
|
|
406
406
|
* // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ]
|
|
407
407
|
* ```
|
|
@@ -413,7 +413,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
413
413
|
*
|
|
414
414
|
* @example
|
|
415
415
|
*
|
|
416
|
-
* ```
|
|
416
|
+
* ```TypeScript
|
|
417
417
|
* for (const connection of libp2p.getConnections()) {
|
|
418
418
|
* console.log(peerId, connection.remoteAddr.toString())
|
|
419
419
|
* // Logs the PeerId string and the observed remote multiaddr of each Connection
|
|
@@ -426,7 +426,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
426
426
|
*
|
|
427
427
|
* @example
|
|
428
428
|
*
|
|
429
|
-
* ```
|
|
429
|
+
* ```TypeScript
|
|
430
430
|
* for (const pendingDial of libp2p.getDialQueue()) {
|
|
431
431
|
* console.log(pendingDial)
|
|
432
432
|
* }
|
|
@@ -445,7 +445,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
445
445
|
*
|
|
446
446
|
* @example
|
|
447
447
|
*
|
|
448
|
-
* ```
|
|
448
|
+
* ```TypeScript
|
|
449
449
|
* const conn = await libp2p.dial(remotePeerId)
|
|
450
450
|
*
|
|
451
451
|
* // create a new stream within the connection
|
|
@@ -465,7 +465,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
465
465
|
*
|
|
466
466
|
* @example
|
|
467
467
|
*
|
|
468
|
-
* ```
|
|
468
|
+
* ```TypeScript
|
|
469
469
|
* import { pipe } from 'it-pipe'
|
|
470
470
|
*
|
|
471
471
|
* const { stream, protocol } = await libp2p.dialProtocol(remotePeerId, protocols)
|
|
@@ -484,7 +484,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
484
484
|
*
|
|
485
485
|
* @example
|
|
486
486
|
*
|
|
487
|
-
* ```
|
|
487
|
+
* ```TypeScript
|
|
488
488
|
* await libp2p.hangUp(remotePeerId)
|
|
489
489
|
* ```
|
|
490
490
|
*/
|
|
@@ -498,7 +498,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
498
498
|
*
|
|
499
499
|
* @example
|
|
500
500
|
*
|
|
501
|
-
* ```
|
|
501
|
+
* ```TypeScript
|
|
502
502
|
* const handler = ({ connection, stream, protocol }) => {
|
|
503
503
|
* // use stream or connection according to the needs
|
|
504
504
|
* }
|
|
@@ -516,7 +516,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
516
516
|
*
|
|
517
517
|
* @example
|
|
518
518
|
*
|
|
519
|
-
* ```
|
|
519
|
+
* ```TypeScript
|
|
520
520
|
* libp2p.unhandle(['/echo/1.0.0'])
|
|
521
521
|
* ```
|
|
522
522
|
*/
|
|
@@ -527,7 +527,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
527
527
|
*
|
|
528
528
|
* @example
|
|
529
529
|
*
|
|
530
|
-
* ```
|
|
530
|
+
* ```TypeScript
|
|
531
531
|
* const id = await libp2p.register('/echo/1.0.0', {
|
|
532
532
|
* onConnect: (peer, connection) => {
|
|
533
533
|
* // handle connect
|
|
@@ -545,7 +545,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
545
545
|
*
|
|
546
546
|
* @example
|
|
547
547
|
*
|
|
548
|
-
* ```
|
|
548
|
+
* ```TypeScript
|
|
549
549
|
* const id = await libp2p.register(...)
|
|
550
550
|
*
|
|
551
551
|
* libp2p.unregister(id)
|
|
@@ -582,7 +582,7 @@ export interface NodeInfo {
|
|
|
582
582
|
*
|
|
583
583
|
* @example
|
|
584
584
|
*
|
|
585
|
-
* ```
|
|
585
|
+
* ```TypeScript
|
|
586
586
|
* const controller = new AbortController()
|
|
587
587
|
*
|
|
588
588
|
* aLongRunningOperation({
|
|
@@ -8,7 +8,7 @@ import type { PeerInfo } from '../peer-info/index.js';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
*
|
|
11
|
-
* ```
|
|
11
|
+
* ```TypeScript
|
|
12
12
|
* import { peerRouting, PeerRouting } from '@libp2p/peer-routing'
|
|
13
13
|
*
|
|
14
14
|
* class MyPeerRouter implements PeerRouting {
|
|
@@ -34,7 +34,7 @@ export interface PeerRouting {
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
*
|
|
37
|
-
* ```
|
|
37
|
+
* ```TypeScript
|
|
38
38
|
* // ...
|
|
39
39
|
* const peer = await peerRouting.findPeer(peerId, options)
|
|
40
40
|
* ```
|
|
@@ -46,7 +46,7 @@ export interface PeerRouting {
|
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
*
|
|
49
|
-
* ```
|
|
49
|
+
* ```TypeScript
|
|
50
50
|
* // Iterate over the closest peers found for the given key
|
|
51
51
|
* for await (const peer of peerRouting.getClosestPeers(key)) {
|
|
52
52
|
* console.log(peer.id, peer.multiaddrs)
|
|
@@ -132,7 +132,7 @@ export interface PeerStore {
|
|
|
132
132
|
*
|
|
133
133
|
* @example
|
|
134
134
|
*
|
|
135
|
-
* ```
|
|
135
|
+
* ```TypeScript
|
|
136
136
|
* await peerStore.forEach(peer => {
|
|
137
137
|
* // ...
|
|
138
138
|
* })
|
|
@@ -144,7 +144,7 @@ export interface PeerStore {
|
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
146
|
*
|
|
147
|
-
* ```
|
|
147
|
+
* ```TypeScript
|
|
148
148
|
* for (const peer of await peerStore.all()) {
|
|
149
149
|
* // ...
|
|
150
150
|
* }
|
|
@@ -156,7 +156,7 @@ export interface PeerStore {
|
|
|
156
156
|
*
|
|
157
157
|
* @example
|
|
158
158
|
*
|
|
159
|
-
* ```
|
|
159
|
+
* ```TypeScript
|
|
160
160
|
* await peerStore.addressBook.set(peerId, multiaddrs)
|
|
161
161
|
* await peerStore.addressBook.get(peerId)
|
|
162
162
|
* // multiaddrs[]
|
|
@@ -173,7 +173,7 @@ export interface PeerStore {
|
|
|
173
173
|
*
|
|
174
174
|
* @example
|
|
175
175
|
*
|
|
176
|
-
* ```
|
|
176
|
+
* ```TypeScript
|
|
177
177
|
* await peerStore.has(peerId)
|
|
178
178
|
* // false
|
|
179
179
|
* await peerStore.addressBook.add(peerId, multiaddrs)
|
|
@@ -187,7 +187,7 @@ export interface PeerStore {
|
|
|
187
187
|
*
|
|
188
188
|
* @example
|
|
189
189
|
*
|
|
190
|
-
* ```
|
|
190
|
+
* ```TypeScript
|
|
191
191
|
* const peer = await peerStore.get(peerId)
|
|
192
192
|
* // { .. }
|
|
193
193
|
* ```
|
|
@@ -198,7 +198,7 @@ export interface PeerStore {
|
|
|
198
198
|
*
|
|
199
199
|
* @example
|
|
200
200
|
*
|
|
201
|
-
* ```
|
|
201
|
+
* ```TypeScript
|
|
202
202
|
* await peerStore.save(peerId, {
|
|
203
203
|
* multiaddrs
|
|
204
204
|
* })
|
|
@@ -210,7 +210,7 @@ export interface PeerStore {
|
|
|
210
210
|
*
|
|
211
211
|
* @example
|
|
212
212
|
*
|
|
213
|
-
* ```
|
|
213
|
+
* ```TypeScript
|
|
214
214
|
* await peerStore.patch(peerId, {
|
|
215
215
|
* multiaddrs
|
|
216
216
|
* })
|
|
@@ -222,7 +222,7 @@ export interface PeerStore {
|
|
|
222
222
|
*
|
|
223
223
|
* @example
|
|
224
224
|
*
|
|
225
|
-
* ```
|
|
225
|
+
* ```TypeScript
|
|
226
226
|
* await peerStore.merge(peerId, {
|
|
227
227
|
* multiaddrs
|
|
228
228
|
* })
|
|
@@ -238,7 +238,7 @@ export interface PeerStore {
|
|
|
238
238
|
*
|
|
239
239
|
* @example
|
|
240
240
|
*
|
|
241
|
-
* ```
|
|
241
|
+
* ```TypeScript
|
|
242
242
|
* await peerStore.consumePeerRecord(buf, expectedPeer)
|
|
243
243
|
* ```
|
|
244
244
|
*/
|
|
@@ -146,7 +146,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
146
146
|
*
|
|
147
147
|
* @example
|
|
148
148
|
*
|
|
149
|
-
* ```
|
|
149
|
+
* ```TypeScript
|
|
150
150
|
* const topic = 'topic'
|
|
151
151
|
* const validateMessage = (msgTopic, msg) => {
|
|
152
152
|
* const input = uint8ArrayToString(msg.data)
|
|
@@ -164,7 +164,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
164
164
|
/**
|
|
165
165
|
* Gets a list of topics the node is subscribed to.
|
|
166
166
|
*
|
|
167
|
-
* ```
|
|
167
|
+
* ```TypeScript
|
|
168
168
|
* const topics = libp2p.pubsub.getTopics()
|
|
169
169
|
* ```
|
|
170
170
|
*/
|
|
@@ -174,7 +174,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
174
174
|
*
|
|
175
175
|
* @example
|
|
176
176
|
*
|
|
177
|
-
* ```
|
|
177
|
+
* ```TypeScript
|
|
178
178
|
* const topic = 'topic'
|
|
179
179
|
* const handler = (msg) => {
|
|
180
180
|
* if (msg.topic === topic) {
|
|
@@ -192,7 +192,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
192
192
|
*
|
|
193
193
|
* @example
|
|
194
194
|
*
|
|
195
|
-
* ```
|
|
195
|
+
* ```TypeScript
|
|
196
196
|
* const topic = 'topic'
|
|
197
197
|
* const handler = (msg) => {
|
|
198
198
|
* // msg.data - pubsub data received
|
|
@@ -208,7 +208,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
208
208
|
*
|
|
209
209
|
* @example
|
|
210
210
|
*
|
|
211
|
-
* ```
|
|
211
|
+
* ```TypeScript
|
|
212
212
|
* const peerIds = libp2p.pubsub.getSubscribers(topic)
|
|
213
213
|
* ```
|
|
214
214
|
*/
|
|
@@ -218,7 +218,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
218
218
|
*
|
|
219
219
|
* @example
|
|
220
220
|
*
|
|
221
|
-
* ```
|
|
221
|
+
* ```TypeScript
|
|
222
222
|
* const topic = 'topic'
|
|
223
223
|
* const data = uint8ArrayFromString('data')
|
|
224
224
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4-2122a713d",
|
|
4
4
|
"description": "The interface implemented by a libp2p node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
|
|
@@ -43,19 +43,20 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"clean": "aegir clean",
|
|
45
45
|
"lint": "aegir lint",
|
|
46
|
-
"dep-check": "aegir dep-check
|
|
46
|
+
"dep-check": "aegir dep-check",
|
|
47
|
+
"doc-check": "aegir doc-check",
|
|
47
48
|
"build": "aegir build"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@multiformats/multiaddr": "^12.1.14",
|
|
51
52
|
"it-pushable": "^3.2.3",
|
|
52
53
|
"it-stream-types": "^2.0.1",
|
|
53
|
-
"multiformats": "^13.0
|
|
54
|
+
"multiformats": "^13.1.0",
|
|
54
55
|
"progress-events": "^1.0.0",
|
|
55
56
|
"uint8arraylist": "^2.4.8"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"aegir": "^42.2.
|
|
59
|
+
"aegir": "^42.2.4"
|
|
59
60
|
},
|
|
60
61
|
"browser": {
|
|
61
62
|
"events": "./dist/src/events.browser.js"
|
|
@@ -9,7 +9,7 @@ import type { CID } from 'multiformats/cid'
|
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
*
|
|
12
|
-
* ```
|
|
12
|
+
* ```TypeScript
|
|
13
13
|
* import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing'
|
|
14
14
|
*
|
|
15
15
|
* class MyContentRouter implements ContentRouting {
|
|
@@ -38,7 +38,7 @@ export interface ContentRouting {
|
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
*
|
|
41
|
-
* ```
|
|
41
|
+
* ```TypeScript
|
|
42
42
|
* // ...
|
|
43
43
|
* await contentRouting.provide(cid)
|
|
44
44
|
* ```
|
|
@@ -50,7 +50,7 @@ export interface ContentRouting {
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
*
|
|
53
|
-
* ```
|
|
53
|
+
* ```TypeScript
|
|
54
54
|
* // Iterate over the providers found for the given cid
|
|
55
55
|
* for await (const provider of contentRouting.findProviders(cid)) {
|
|
56
56
|
* console.log(provider.id, provider.multiaddrs)
|
|
@@ -65,7 +65,7 @@ export interface ContentRouting {
|
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
*
|
|
68
|
-
* ```
|
|
68
|
+
* ```TypeScript
|
|
69
69
|
* // ...
|
|
70
70
|
* const key = '/key'
|
|
71
71
|
* const value = uint8ArrayFromString('oh hello there')
|
|
@@ -80,7 +80,7 @@ export interface ContentRouting {
|
|
|
80
80
|
*
|
|
81
81
|
* @example
|
|
82
82
|
*
|
|
83
|
-
* ```
|
|
83
|
+
* ```TypeScript
|
|
84
84
|
* // ...
|
|
85
85
|
*
|
|
86
86
|
* const key = '/key'
|
package/src/event-target.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { setMaxListeners } from './events.js'
|
|
2
|
+
|
|
1
3
|
export interface EventCallback<EventType> { (evt: EventType): void }
|
|
2
4
|
export interface EventObject<EventType> { handleEvent: EventCallback<EventType> }
|
|
3
5
|
export type EventHandler<EventType> = EventCallback<EventType> | EventObject<EventType>
|
|
@@ -34,6 +36,14 @@ export interface TypedEventTarget <EventMap extends Record<string, any>> extends
|
|
|
34
36
|
export class TypedEventEmitter<EventMap extends Record<string, any>> extends EventTarget implements TypedEventTarget<EventMap> {
|
|
35
37
|
#listeners = new Map<any, Listener[]>()
|
|
36
38
|
|
|
39
|
+
constructor () {
|
|
40
|
+
super()
|
|
41
|
+
|
|
42
|
+
// silence MaxListenersExceededWarning warning on Node.js, this is a red
|
|
43
|
+
// herring almost all of the time
|
|
44
|
+
setMaxListeners(Infinity, this)
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
listenerCount (type: string): number {
|
|
38
48
|
const listeners = this.#listeners.get(type)
|
|
39
49
|
|
package/src/index.ts
CHANGED
|
@@ -136,7 +136,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
136
136
|
*
|
|
137
137
|
* @example
|
|
138
138
|
*
|
|
139
|
-
* ```
|
|
139
|
+
* ```TypeScript
|
|
140
140
|
* libp2p.addEventListener('peer:discovery', (event) => {
|
|
141
141
|
* const peerInfo = event.detail
|
|
142
142
|
* // ...
|
|
@@ -150,7 +150,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
150
150
|
*
|
|
151
151
|
* @example
|
|
152
152
|
*
|
|
153
|
-
* ```
|
|
153
|
+
* ```TypeScript
|
|
154
154
|
* libp2p.addEventListener('peer:connect', (event) => {
|
|
155
155
|
* const peerId = event.detail
|
|
156
156
|
* // ...
|
|
@@ -166,7 +166,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
166
166
|
*
|
|
167
167
|
* @example
|
|
168
168
|
*
|
|
169
|
-
* ```
|
|
169
|
+
* ```TypeScript
|
|
170
170
|
* libp2p.addEventListener('peer:disconnect', (event) => {
|
|
171
171
|
* const peerId = event.detail
|
|
172
172
|
* // ...
|
|
@@ -182,7 +182,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
182
182
|
*
|
|
183
183
|
* @example
|
|
184
184
|
*
|
|
185
|
-
* ```
|
|
185
|
+
* ```TypeScript
|
|
186
186
|
* libp2p.addEventListener('peer:identify', (event) => {
|
|
187
187
|
* const identifyResult = event.detail
|
|
188
188
|
* // ...
|
|
@@ -210,7 +210,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
210
210
|
*
|
|
211
211
|
* @example
|
|
212
212
|
*
|
|
213
|
-
* ```
|
|
213
|
+
* ```TypeScript
|
|
214
214
|
* libp2p.addEventListener('self:peer:update', (event) => {
|
|
215
215
|
* const { peer } = event.detail
|
|
216
216
|
* // ...
|
|
@@ -251,7 +251,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
251
251
|
/**
|
|
252
252
|
* This event notifies listeners that the node has started
|
|
253
253
|
*
|
|
254
|
-
* ```
|
|
254
|
+
* ```TypeScript
|
|
255
255
|
* libp2p.addEventListener('start', (event) => {
|
|
256
256
|
* console.info(libp2p.isStarted()) // true
|
|
257
257
|
* })
|
|
@@ -262,7 +262,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
262
262
|
/**
|
|
263
263
|
* This event notifies listeners that the node has stopped
|
|
264
264
|
*
|
|
265
|
-
* ```
|
|
265
|
+
* ```TypeScript
|
|
266
266
|
* libp2p.addEventListener('stop', (event) => {
|
|
267
267
|
* console.info(libp2p.isStarted()) // false
|
|
268
268
|
* })
|
|
@@ -277,7 +277,7 @@ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
|
|
|
277
277
|
*
|
|
278
278
|
* @example
|
|
279
279
|
*
|
|
280
|
-
* ```
|
|
280
|
+
* ```TypeScript
|
|
281
281
|
* const node = await createLibp2p({
|
|
282
282
|
* // ...other options
|
|
283
283
|
* services: {
|
|
@@ -336,7 +336,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
336
336
|
*
|
|
337
337
|
* @example
|
|
338
338
|
*
|
|
339
|
-
* ```
|
|
339
|
+
* ```TypeScript
|
|
340
340
|
* console.info(libp2p.peerId)
|
|
341
341
|
* // PeerId(12D3Foo...)
|
|
342
342
|
* ````
|
|
@@ -349,7 +349,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
349
349
|
*
|
|
350
350
|
* @example
|
|
351
351
|
*
|
|
352
|
-
* ```
|
|
352
|
+
* ```TypeScript
|
|
353
353
|
* const peer = await libp2p.peerStore.get(peerId)
|
|
354
354
|
* console.info(peer)
|
|
355
355
|
* // { id: PeerId(12D3Foo...), addresses: [] ... }
|
|
@@ -363,7 +363,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
363
363
|
*
|
|
364
364
|
* @example
|
|
365
365
|
*
|
|
366
|
-
* ```
|
|
366
|
+
* ```TypeScript
|
|
367
367
|
* const peerInfo = await libp2p.peerRouting.findPeer(peerId)
|
|
368
368
|
* console.info(peerInfo)
|
|
369
369
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -371,7 +371,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
371
371
|
*
|
|
372
372
|
* @example
|
|
373
373
|
*
|
|
374
|
-
* ```
|
|
374
|
+
* ```TypeScript
|
|
375
375
|
* for await (const peerInfo of libp2p.peerRouting.getClosestPeers(key)) {
|
|
376
376
|
* console.info(peerInfo)
|
|
377
377
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -387,7 +387,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
387
387
|
*
|
|
388
388
|
* @example
|
|
389
389
|
*
|
|
390
|
-
* ```
|
|
390
|
+
* ```TypeScript
|
|
391
391
|
* for await (const peerInfo of libp2p.contentRouting.findProviders(cid)) {
|
|
392
392
|
* console.info(peerInfo)
|
|
393
393
|
* // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
|
|
@@ -402,7 +402,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
402
402
|
*
|
|
403
403
|
* @example
|
|
404
404
|
*
|
|
405
|
-
* ```
|
|
405
|
+
* ```TypeScript
|
|
406
406
|
* const metric = libp2p.metrics.registerMetric({
|
|
407
407
|
* 'my-metric'
|
|
408
408
|
* })
|
|
@@ -433,7 +433,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
433
433
|
*
|
|
434
434
|
* @example
|
|
435
435
|
*
|
|
436
|
-
* ```
|
|
436
|
+
* ```TypeScript
|
|
437
437
|
* const listenMa = libp2p.getMultiaddrs()
|
|
438
438
|
* // [ <Multiaddr 047f00000106f9ba - /ip4/127.0.0.1/tcp/63930> ]
|
|
439
439
|
* ```
|
|
@@ -445,7 +445,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
445
445
|
*
|
|
446
446
|
* @example
|
|
447
447
|
*
|
|
448
|
-
* ```
|
|
448
|
+
* ```TypeScript
|
|
449
449
|
* const protocols = libp2p.getProtocols()
|
|
450
450
|
* // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ]
|
|
451
451
|
* ```
|
|
@@ -458,7 +458,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
458
458
|
*
|
|
459
459
|
* @example
|
|
460
460
|
*
|
|
461
|
-
* ```
|
|
461
|
+
* ```TypeScript
|
|
462
462
|
* for (const connection of libp2p.getConnections()) {
|
|
463
463
|
* console.log(peerId, connection.remoteAddr.toString())
|
|
464
464
|
* // Logs the PeerId string and the observed remote multiaddr of each Connection
|
|
@@ -472,7 +472,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
472
472
|
*
|
|
473
473
|
* @example
|
|
474
474
|
*
|
|
475
|
-
* ```
|
|
475
|
+
* ```TypeScript
|
|
476
476
|
* for (const pendingDial of libp2p.getDialQueue()) {
|
|
477
477
|
* console.log(pendingDial)
|
|
478
478
|
* }
|
|
@@ -493,7 +493,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
493
493
|
*
|
|
494
494
|
* @example
|
|
495
495
|
*
|
|
496
|
-
* ```
|
|
496
|
+
* ```TypeScript
|
|
497
497
|
* const conn = await libp2p.dial(remotePeerId)
|
|
498
498
|
*
|
|
499
499
|
* // create a new stream within the connection
|
|
@@ -514,7 +514,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
514
514
|
*
|
|
515
515
|
* @example
|
|
516
516
|
*
|
|
517
|
-
* ```
|
|
517
|
+
* ```TypeScript
|
|
518
518
|
* import { pipe } from 'it-pipe'
|
|
519
519
|
*
|
|
520
520
|
* const { stream, protocol } = await libp2p.dialProtocol(remotePeerId, protocols)
|
|
@@ -534,7 +534,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
534
534
|
*
|
|
535
535
|
* @example
|
|
536
536
|
*
|
|
537
|
-
* ```
|
|
537
|
+
* ```TypeScript
|
|
538
538
|
* await libp2p.hangUp(remotePeerId)
|
|
539
539
|
* ```
|
|
540
540
|
*/
|
|
@@ -549,7 +549,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
549
549
|
*
|
|
550
550
|
* @example
|
|
551
551
|
*
|
|
552
|
-
* ```
|
|
552
|
+
* ```TypeScript
|
|
553
553
|
* const handler = ({ connection, stream, protocol }) => {
|
|
554
554
|
* // use stream or connection according to the needs
|
|
555
555
|
* }
|
|
@@ -568,7 +568,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
568
568
|
*
|
|
569
569
|
* @example
|
|
570
570
|
*
|
|
571
|
-
* ```
|
|
571
|
+
* ```TypeScript
|
|
572
572
|
* libp2p.unhandle(['/echo/1.0.0'])
|
|
573
573
|
* ```
|
|
574
574
|
*/
|
|
@@ -580,7 +580,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
580
580
|
*
|
|
581
581
|
* @example
|
|
582
582
|
*
|
|
583
|
-
* ```
|
|
583
|
+
* ```TypeScript
|
|
584
584
|
* const id = await libp2p.register('/echo/1.0.0', {
|
|
585
585
|
* onConnect: (peer, connection) => {
|
|
586
586
|
* // handle connect
|
|
@@ -599,7 +599,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
599
599
|
*
|
|
600
600
|
* @example
|
|
601
601
|
*
|
|
602
|
-
* ```
|
|
602
|
+
* ```TypeScript
|
|
603
603
|
* const id = await libp2p.register(...)
|
|
604
604
|
*
|
|
605
605
|
* libp2p.unregister(id)
|
|
@@ -641,7 +641,7 @@ export interface NodeInfo {
|
|
|
641
641
|
*
|
|
642
642
|
* @example
|
|
643
643
|
*
|
|
644
|
-
* ```
|
|
644
|
+
* ```TypeScript
|
|
645
645
|
* const controller = new AbortController()
|
|
646
646
|
*
|
|
647
647
|
* aLongRunningOperation({
|
|
@@ -9,7 +9,7 @@ import type { PeerInfo } from '../peer-info/index.js'
|
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
*
|
|
12
|
-
* ```
|
|
12
|
+
* ```TypeScript
|
|
13
13
|
* import { peerRouting, PeerRouting } from '@libp2p/peer-routing'
|
|
14
14
|
*
|
|
15
15
|
* class MyPeerRouter implements PeerRouting {
|
|
@@ -37,7 +37,7 @@ export interface PeerRouting {
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
*
|
|
40
|
-
* ```
|
|
40
|
+
* ```TypeScript
|
|
41
41
|
* // ...
|
|
42
42
|
* const peer = await peerRouting.findPeer(peerId, options)
|
|
43
43
|
* ```
|
|
@@ -50,7 +50,7 @@ export interface PeerRouting {
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
*
|
|
53
|
-
* ```
|
|
53
|
+
* ```TypeScript
|
|
54
54
|
* // Iterate over the closest peers found for the given key
|
|
55
55
|
* for await (const peer of peerRouting.getClosestPeers(key)) {
|
|
56
56
|
* console.log(peer.id, peer.multiaddrs)
|
package/src/peer-store/index.ts
CHANGED
|
@@ -150,7 +150,7 @@ export interface PeerStore {
|
|
|
150
150
|
*
|
|
151
151
|
* @example
|
|
152
152
|
*
|
|
153
|
-
* ```
|
|
153
|
+
* ```TypeScript
|
|
154
154
|
* await peerStore.forEach(peer => {
|
|
155
155
|
* // ...
|
|
156
156
|
* })
|
|
@@ -163,7 +163,7 @@ export interface PeerStore {
|
|
|
163
163
|
*
|
|
164
164
|
* @example
|
|
165
165
|
*
|
|
166
|
-
* ```
|
|
166
|
+
* ```TypeScript
|
|
167
167
|
* for (const peer of await peerStore.all()) {
|
|
168
168
|
* // ...
|
|
169
169
|
* }
|
|
@@ -176,7 +176,7 @@ export interface PeerStore {
|
|
|
176
176
|
*
|
|
177
177
|
* @example
|
|
178
178
|
*
|
|
179
|
-
* ```
|
|
179
|
+
* ```TypeScript
|
|
180
180
|
* await peerStore.addressBook.set(peerId, multiaddrs)
|
|
181
181
|
* await peerStore.addressBook.get(peerId)
|
|
182
182
|
* // multiaddrs[]
|
|
@@ -194,7 +194,7 @@ export interface PeerStore {
|
|
|
194
194
|
*
|
|
195
195
|
* @example
|
|
196
196
|
*
|
|
197
|
-
* ```
|
|
197
|
+
* ```TypeScript
|
|
198
198
|
* await peerStore.has(peerId)
|
|
199
199
|
* // false
|
|
200
200
|
* await peerStore.addressBook.add(peerId, multiaddrs)
|
|
@@ -209,7 +209,7 @@ export interface PeerStore {
|
|
|
209
209
|
*
|
|
210
210
|
* @example
|
|
211
211
|
*
|
|
212
|
-
* ```
|
|
212
|
+
* ```TypeScript
|
|
213
213
|
* const peer = await peerStore.get(peerId)
|
|
214
214
|
* // { .. }
|
|
215
215
|
* ```
|
|
@@ -221,7 +221,7 @@ export interface PeerStore {
|
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
*
|
|
224
|
-
* ```
|
|
224
|
+
* ```TypeScript
|
|
225
225
|
* await peerStore.save(peerId, {
|
|
226
226
|
* multiaddrs
|
|
227
227
|
* })
|
|
@@ -234,7 +234,7 @@ export interface PeerStore {
|
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
236
|
*
|
|
237
|
-
* ```
|
|
237
|
+
* ```TypeScript
|
|
238
238
|
* await peerStore.patch(peerId, {
|
|
239
239
|
* multiaddrs
|
|
240
240
|
* })
|
|
@@ -247,7 +247,7 @@ export interface PeerStore {
|
|
|
247
247
|
*
|
|
248
248
|
* @example
|
|
249
249
|
*
|
|
250
|
-
* ```
|
|
250
|
+
* ```TypeScript
|
|
251
251
|
* await peerStore.merge(peerId, {
|
|
252
252
|
* multiaddrs
|
|
253
253
|
* })
|
|
@@ -264,7 +264,7 @@ export interface PeerStore {
|
|
|
264
264
|
*
|
|
265
265
|
* @example
|
|
266
266
|
*
|
|
267
|
-
* ```
|
|
267
|
+
* ```TypeScript
|
|
268
268
|
* await peerStore.consumePeerRecord(buf, expectedPeer)
|
|
269
269
|
* ```
|
|
270
270
|
*/
|
package/src/pubsub/index.ts
CHANGED
|
@@ -174,7 +174,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
174
174
|
*
|
|
175
175
|
* @example
|
|
176
176
|
*
|
|
177
|
-
* ```
|
|
177
|
+
* ```TypeScript
|
|
178
178
|
* const topic = 'topic'
|
|
179
179
|
* const validateMessage = (msgTopic, msg) => {
|
|
180
180
|
* const input = uint8ArrayToString(msg.data)
|
|
@@ -194,7 +194,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
194
194
|
/**
|
|
195
195
|
* Gets a list of topics the node is subscribed to.
|
|
196
196
|
*
|
|
197
|
-
* ```
|
|
197
|
+
* ```TypeScript
|
|
198
198
|
* const topics = libp2p.pubsub.getTopics()
|
|
199
199
|
* ```
|
|
200
200
|
*/
|
|
@@ -205,7 +205,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
205
205
|
*
|
|
206
206
|
* @example
|
|
207
207
|
*
|
|
208
|
-
* ```
|
|
208
|
+
* ```TypeScript
|
|
209
209
|
* const topic = 'topic'
|
|
210
210
|
* const handler = (msg) => {
|
|
211
211
|
* if (msg.topic === topic) {
|
|
@@ -224,7 +224,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
224
224
|
*
|
|
225
225
|
* @example
|
|
226
226
|
*
|
|
227
|
-
* ```
|
|
227
|
+
* ```TypeScript
|
|
228
228
|
* const topic = 'topic'
|
|
229
229
|
* const handler = (msg) => {
|
|
230
230
|
* // msg.data - pubsub data received
|
|
@@ -241,7 +241,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
241
241
|
*
|
|
242
242
|
* @example
|
|
243
243
|
*
|
|
244
|
-
* ```
|
|
244
|
+
* ```TypeScript
|
|
245
245
|
* const peerIds = libp2p.pubsub.getSubscribers(topic)
|
|
246
246
|
* ```
|
|
247
247
|
*/
|
|
@@ -252,7 +252,7 @@ export interface PubSub<Events extends Record<string, any> = PubSubEvents> exten
|
|
|
252
252
|
*
|
|
253
253
|
* @example
|
|
254
254
|
*
|
|
255
|
-
* ```
|
|
255
|
+
* ```TypeScript
|
|
256
256
|
* const topic = 'topic'
|
|
257
257
|
* const data = uint8ArrayFromString('data')
|
|
258
258
|
*
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"FaultTolerance": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.FaultTolerance.html",
|
|
3
|
-
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.TopicValidatorResult.html",
|
|
4
|
-
"AbortError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.AbortError.html",
|
|
5
|
-
"AggregateCodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.AggregateCodeError.html",
|
|
6
|
-
"CodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.CodeError.html",
|
|
7
|
-
"InvalidCryptoExchangeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.InvalidCryptoExchangeError.html",
|
|
8
|
-
"InvalidCryptoTransmissionError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.InvalidCryptoTransmissionError.html",
|
|
9
|
-
"TypedEventEmitter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.TypedEventEmitter.html",
|
|
10
|
-
"UnexpectedPeerError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.UnexpectedPeerError.html",
|
|
11
|
-
"AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.AbortOptions.html",
|
|
12
|
-
".:AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.AbortOptions.html",
|
|
13
|
-
"Address": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Address.html",
|
|
14
|
-
"AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.AddressSorter.html",
|
|
15
|
-
".:AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.AddressSorter.html",
|
|
16
|
-
"CalculatedMetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.CalculatedMetricOptions.html",
|
|
17
|
-
"ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ComponentLogger.html",
|
|
18
|
-
".:ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ComponentLogger.html",
|
|
19
|
-
"Connection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Connection.html",
|
|
20
|
-
"ConnectionEncrypter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ConnectionEncrypter.html",
|
|
21
|
-
"ConnectionGater": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ConnectionGater.html",
|
|
22
|
-
"ConnectionHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ConnectionHandler.html",
|
|
23
|
-
"ConnectionProtector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ConnectionProtector.html",
|
|
24
|
-
"ConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ConnectionTimeline.html",
|
|
25
|
-
"ContentRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ContentRouting.html",
|
|
26
|
-
"ContentRoutingProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ContentRoutingProvider.html",
|
|
27
|
-
"Counter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Counter.html",
|
|
28
|
-
"CounterGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.CounterGroup.html",
|
|
29
|
-
"CreateListenerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.CreateListenerOptions.html",
|
|
30
|
-
"DialOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.DialOptions.html",
|
|
31
|
-
"Ed25519PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Ed25519PeerId.html",
|
|
32
|
-
"Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Envelope.html",
|
|
33
|
-
"EventCallback": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.EventCallback.html",
|
|
34
|
-
"EventObject": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.EventObject.html",
|
|
35
|
-
"IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.IdentifyResult.html",
|
|
36
|
-
".:IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.IdentifyResult.html",
|
|
37
|
-
"IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.IncomingStreamData.html",
|
|
38
|
-
"Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Libp2p.html",
|
|
39
|
-
".:Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2p.html",
|
|
40
|
-
"Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Libp2pEvents.html",
|
|
41
|
-
".:Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Libp2pEvents.html",
|
|
42
|
-
"Listener": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Listener.html",
|
|
43
|
-
"ListenerEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.ListenerEvents.html",
|
|
44
|
-
"Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Logger.html",
|
|
45
|
-
".:Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Logger.html",
|
|
46
|
-
"LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.LoggerOptions.html",
|
|
47
|
-
".:LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.LoggerOptions.html",
|
|
48
|
-
"Metric": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Metric.html",
|
|
49
|
-
"MetricGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.MetricGroup.html",
|
|
50
|
-
"MetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.MetricOptions.html",
|
|
51
|
-
"Metrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Metrics.html",
|
|
52
|
-
"MultiaddrConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.MultiaddrConnection.html",
|
|
53
|
-
"MultiaddrConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.MultiaddrConnectionTimeline.html",
|
|
54
|
-
"MultiaddrFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.MultiaddrFilter.html",
|
|
55
|
-
"NewStreamOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.NewStreamOptions.html",
|
|
56
|
-
"NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.NodeInfo.html",
|
|
57
|
-
".:NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.NodeInfo.html",
|
|
58
|
-
"Peer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Peer.html",
|
|
59
|
-
"PeerData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerData.html",
|
|
60
|
-
"PeerDiscovery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerDiscovery.html",
|
|
61
|
-
"PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerDiscoveryEvents.html",
|
|
62
|
-
"PeerDiscoveryProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerDiscoveryProvider.html",
|
|
63
|
-
"PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerInfo.html",
|
|
64
|
-
"PeerQuery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerQuery.html",
|
|
65
|
-
"PeerQueryFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerQueryFilter.html",
|
|
66
|
-
"PeerQueryOrder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerQueryOrder.html",
|
|
67
|
-
"PeerRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerRouting.html",
|
|
68
|
-
"PeerRoutingProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerRoutingProvider.html",
|
|
69
|
-
"PeerStore": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerStore.html",
|
|
70
|
-
"PeerStreamEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerStreamEvents.html",
|
|
71
|
-
"PeerStreams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerStreams.html",
|
|
72
|
-
"PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerUpdate.html",
|
|
73
|
-
".:PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PeerUpdate.html",
|
|
74
|
-
"PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PendingDial.html",
|
|
75
|
-
".:PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PendingDial.html",
|
|
76
|
-
"PrivateKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PrivateKey.html",
|
|
77
|
-
"PubSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSub.html",
|
|
78
|
-
"PubSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSubEvents.html",
|
|
79
|
-
"PubSubInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSubInit.html",
|
|
80
|
-
"PubSubRPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSubRPC.html",
|
|
81
|
-
"PubSubRPCMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSubRPCMessage.html",
|
|
82
|
-
"PubSubRPCSubscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PubSubRPCSubscription.html",
|
|
83
|
-
"PublicKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PublicKey.html",
|
|
84
|
-
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.PublishResult.html",
|
|
85
|
-
"RSAPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.RSAPeerId.html",
|
|
86
|
-
"Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Record.html",
|
|
87
|
-
"RoutingOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.RoutingOptions.html",
|
|
88
|
-
".:RoutingOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.RoutingOptions.html",
|
|
89
|
-
"Secp256k1PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Secp256k1PeerId.html",
|
|
90
|
-
"SecuredConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.SecuredConnection.html",
|
|
91
|
-
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.SignedMessage.html",
|
|
92
|
-
"SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.SignedPeerRecord.html",
|
|
93
|
-
".:SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.SignedPeerRecord.html",
|
|
94
|
-
"Startable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Startable.html",
|
|
95
|
-
"StopTimer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StopTimer.html",
|
|
96
|
-
"Stream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Stream.html",
|
|
97
|
-
"StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamHandler.html",
|
|
98
|
-
"StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamHandlerOptions.html",
|
|
99
|
-
"StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamHandlerRecord.html",
|
|
100
|
-
"StreamMuxer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamMuxer.html",
|
|
101
|
-
"StreamMuxerFactory": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamMuxerFactory.html",
|
|
102
|
-
"StreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamMuxerInit.html",
|
|
103
|
-
"StreamTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.StreamTimeline.html",
|
|
104
|
-
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.SubscriptionChangeData.html",
|
|
105
|
-
"Tag": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Tag.html",
|
|
106
|
-
"TagOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.TagOptions.html",
|
|
107
|
-
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.TopicValidatorFn.html",
|
|
108
|
-
"Topology": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Topology.html",
|
|
109
|
-
"Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Transport.html",
|
|
110
|
-
"TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.TypedEventTarget.html",
|
|
111
|
-
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.UnsignedMessage.html",
|
|
112
|
-
"Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Upgrader.html",
|
|
113
|
-
"UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.UpgraderOptions.html",
|
|
114
|
-
"CalculateMetric": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.CalculateMetric.html",
|
|
115
|
-
"ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.ConnectionStatus.html",
|
|
116
|
-
"Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Direction.html",
|
|
117
|
-
"EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.EventHandler.html",
|
|
118
|
-
"KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.KeyType.html",
|
|
119
|
-
"Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Libp2pStatus.html",
|
|
120
|
-
".:Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Libp2pStatus.html",
|
|
121
|
-
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Message.html",
|
|
122
|
-
"PeerId": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PeerId.html",
|
|
123
|
-
"PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PeerIdType.html",
|
|
124
|
-
"PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PendingDialStatus.html",
|
|
125
|
-
".:PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PendingDialStatus.html",
|
|
126
|
-
"ReadStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.ReadStatus.html",
|
|
127
|
-
"RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.RecursivePartial.html",
|
|
128
|
-
".:RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.RecursivePartial.html",
|
|
129
|
-
"ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.ServiceMap.html",
|
|
130
|
-
".:ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.ServiceMap.html",
|
|
131
|
-
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.SignaturePolicy.html",
|
|
132
|
-
"StreamStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.StreamStatus.html",
|
|
133
|
-
"WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.WriteStatus.html",
|
|
134
|
-
"CustomEvent": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.CustomEvent.html",
|
|
135
|
-
"ERR_INVALID_MESSAGE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.ERR_INVALID_MESSAGE.html",
|
|
136
|
-
"ERR_INVALID_PARAMETERS": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.ERR_INVALID_PARAMETERS.html",
|
|
137
|
-
"ERR_NOT_FOUND": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.ERR_NOT_FOUND.html",
|
|
138
|
-
"ERR_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.ERR_TIMEOUT.html",
|
|
139
|
-
"Ed25519": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.Ed25519.html",
|
|
140
|
-
"KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.KEEP_ALIVE.html",
|
|
141
|
-
"RSA": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.RSA.html",
|
|
142
|
-
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.StrictNoSign.html",
|
|
143
|
-
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.StrictSign.html",
|
|
144
|
-
"connectionSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.connectionSymbol.html",
|
|
145
|
-
"contentRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.contentRoutingSymbol.html",
|
|
146
|
-
"peerDiscoverySymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peerDiscoverySymbol.html",
|
|
147
|
-
"peerIdSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peerIdSymbol.html",
|
|
148
|
-
"peerRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peerRoutingSymbol.html",
|
|
149
|
-
"secp256k1": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.secp256k1.html",
|
|
150
|
-
"transportSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.transportSymbol.html",
|
|
151
|
-
"isConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.isConnection.html",
|
|
152
|
-
"isPeerId": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.isPeerId.html",
|
|
153
|
-
"isStartable": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.isStartable.html",
|
|
154
|
-
"isTransport": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.isTransport.html",
|
|
155
|
-
"setMaxListeners": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.setMaxListeners.html",
|
|
156
|
-
"start": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.start.html",
|
|
157
|
-
"stop": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.stop.html"
|
|
158
|
-
}
|