@libp2p/interface 1.1.2 → 1.1.3-bedfd0aa2
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 +0 -14
- package/dist/index.min.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/metrics/index.d.ts +138 -0
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/event-target.ts +10 -0
- package/src/metrics/index.ts +138 -0
- package/dist/typedoc-urls.json +0 -158
package/README.md
CHANGED
|
@@ -5,20 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
> The interface implemented by a libp2p node
|
|
7
7
|
|
|
8
|
-
# About
|
|
9
|
-
|
|
10
|
-
Exports a `Libp2p` type for modules to use as a type argument.
|
|
11
|
-
|
|
12
|
-
## Example
|
|
13
|
-
|
|
14
|
-
```typescript
|
|
15
|
-
import type { Libp2p } from '@libp2p/interface'
|
|
16
|
-
|
|
17
|
-
function doSomethingWithLibp2p (node: Libp2p) {
|
|
18
|
-
// ...
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
8
|
# Install
|
|
23
9
|
|
|
24
10
|
```console
|
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}));
|
|
@@ -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,OAA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,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,CA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I,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"}
|
|
@@ -128,6 +128,144 @@ export interface CounterGroup {
|
|
|
128
128
|
* The libp2p metrics tracking object. This interface is only concerned
|
|
129
129
|
* with the collection of metrics, please see the individual implementations
|
|
130
130
|
* for how to extract metrics for viewing.
|
|
131
|
+
*
|
|
132
|
+
* @example How to register a simple metric
|
|
133
|
+
*
|
|
134
|
+
* ```typescript
|
|
135
|
+
* import { Metrics, Metric } from '@libp2p/interface/metrics
|
|
136
|
+
*
|
|
137
|
+
* interface MyServiceComponents {
|
|
138
|
+
* metrics: Metrics
|
|
139
|
+
* }
|
|
140
|
+
*
|
|
141
|
+
* class MyService {
|
|
142
|
+
* private readonly myMetric: Metric
|
|
143
|
+
*
|
|
144
|
+
* constructor (components: MyServiceComponents) {
|
|
145
|
+
* this.myMetric = components.metrics.registerMetric({
|
|
146
|
+
* name: 'my_metric',
|
|
147
|
+
* label: 'my_label',
|
|
148
|
+
* help: 'my help text'
|
|
149
|
+
* })
|
|
150
|
+
* }
|
|
151
|
+
*
|
|
152
|
+
* // later
|
|
153
|
+
* doSomething () {
|
|
154
|
+
* this.myMetric.update(1)
|
|
155
|
+
* }
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @example How to register a dynamically calculated metric
|
|
160
|
+
*
|
|
161
|
+
* A metric that is expensive to calculate can be created by passing a `calculate` function that will only be invoked when metrics are being scraped:
|
|
162
|
+
*
|
|
163
|
+
* ```typescript
|
|
164
|
+
* import { Metrics, Metric } from '@libp2p/interface/metrics
|
|
165
|
+
*
|
|
166
|
+
* interface MyServiceComponents {
|
|
167
|
+
* metrics: Metrics
|
|
168
|
+
* }
|
|
169
|
+
*
|
|
170
|
+
* class MyService {
|
|
171
|
+
* private readonly myMetric: Metric
|
|
172
|
+
*
|
|
173
|
+
* constructor (components: MyServiceComponents) {
|
|
174
|
+
* this.myMetric = components.metrics.registerMetric({
|
|
175
|
+
* name: 'my_metric',
|
|
176
|
+
* label: 'my_label',
|
|
177
|
+
* help: 'my help text',
|
|
178
|
+
* calculate: async () => {
|
|
179
|
+
* // do something expensive
|
|
180
|
+
* return 1
|
|
181
|
+
* }
|
|
182
|
+
* })
|
|
183
|
+
* }
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @example How to register a group of metrics
|
|
188
|
+
*
|
|
189
|
+
* If several metrics should be grouped together (e.g. for graphing purposes) `registerMetricGroup` can be used instead:
|
|
190
|
+
*
|
|
191
|
+
* ```typescript
|
|
192
|
+
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics
|
|
193
|
+
*
|
|
194
|
+
* interface MyServiceComponents {
|
|
195
|
+
* metrics: Metrics
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* class MyService {
|
|
199
|
+
* private readonly myMetricGroup: MetricGroup
|
|
200
|
+
*
|
|
201
|
+
* constructor (components: MyServiceComponents) {
|
|
202
|
+
* this.myMetricGroup = components.metrics.registerMetricGroup({
|
|
203
|
+
* name: 'my_metric_group',
|
|
204
|
+
* label: 'my_label',
|
|
205
|
+
* help: 'my help text'
|
|
206
|
+
* })
|
|
207
|
+
* }
|
|
208
|
+
*
|
|
209
|
+
* // later
|
|
210
|
+
* doSomething () {
|
|
211
|
+
* this.myMetricGroup.increment({ my_label: 'my_value' })
|
|
212
|
+
* }
|
|
213
|
+
* }
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* There are specific metric groups for tracking libp2p connections and streams:
|
|
217
|
+
*
|
|
218
|
+
* @example How to track multiaddr connections
|
|
219
|
+
*
|
|
220
|
+
* This is something only libp2p transports need to do.
|
|
221
|
+
*
|
|
222
|
+
* ```typescript
|
|
223
|
+
* import { Metrics } from '@libp2p/interface/metrics
|
|
224
|
+
*
|
|
225
|
+
* interface MyServiceComponents {
|
|
226
|
+
* metrics: Metrics
|
|
227
|
+
* }
|
|
228
|
+
*
|
|
229
|
+
* class MyService {
|
|
230
|
+
* private readonly metrics: Metrics
|
|
231
|
+
*
|
|
232
|
+
* constructor (components: MyServiceComponents) {
|
|
233
|
+
* this.metrics = components.metrics
|
|
234
|
+
* }
|
|
235
|
+
*
|
|
236
|
+
* // later
|
|
237
|
+
* doSomething () {
|
|
238
|
+
* const connection = {} // create a connection
|
|
239
|
+
* this.metrics.trackMultiaddrConnection(connection)
|
|
240
|
+
* }
|
|
241
|
+
* }
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @example How to track protocol streams
|
|
245
|
+
*
|
|
246
|
+
* This is something only libp2p connections need to do.
|
|
247
|
+
*
|
|
248
|
+
* ```typescript
|
|
249
|
+
* import { Metrics } from '@libp2p/interface/metrics
|
|
250
|
+
*
|
|
251
|
+
* interface MyServiceComponents {
|
|
252
|
+
* metrics: Metrics
|
|
253
|
+
* }
|
|
254
|
+
*
|
|
255
|
+
* class MyService {
|
|
256
|
+
* private readonly metrics: Metrics
|
|
257
|
+
*
|
|
258
|
+
* constructor (components: MyServiceComponents) {
|
|
259
|
+
* this.metrics = components.metrics
|
|
260
|
+
* }
|
|
261
|
+
*
|
|
262
|
+
* // later
|
|
263
|
+
* doSomething () {
|
|
264
|
+
* const stream = {} // create a stream
|
|
265
|
+
* this.metrics.trackProtocolStream(stream)
|
|
266
|
+
* }
|
|
267
|
+
* }
|
|
268
|
+
* ```
|
|
131
269
|
*/
|
|
132
270
|
export interface Metrics {
|
|
133
271
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAErF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAExE;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,aAAa;IACxE;;;OAGG;IACH,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IAAG,IAAI,IAAI,CAAA;CAAE;AAEvC;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,CAAC,K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AM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;IAElK;;;OAGG;IACH,eAAe,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC,CAAA;IAElI;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;CACrK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3-bedfd0aa2",
|
|
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",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"build": "aegir build"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@multiformats/multiaddr": "^12.1.
|
|
50
|
+
"@multiformats/multiaddr": "^12.1.14",
|
|
51
51
|
"it-pushable": "^3.2.3",
|
|
52
52
|
"it-stream-types": "^2.0.1",
|
|
53
|
-
"multiformats": "^13.0.
|
|
53
|
+
"multiformats": "^13.0.1",
|
|
54
54
|
"progress-events": "^1.0.0",
|
|
55
|
-
"uint8arraylist": "^2.4.
|
|
55
|
+
"uint8arraylist": "^2.4.8"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"aegir": "^42.
|
|
58
|
+
"aegir": "^42.2.3"
|
|
59
59
|
},
|
|
60
60
|
"browser": {
|
|
61
61
|
"events": "./dist/src/events.browser.js"
|
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/metrics/index.ts
CHANGED
|
@@ -146,6 +146,144 @@ export interface CounterGroup {
|
|
|
146
146
|
* The libp2p metrics tracking object. This interface is only concerned
|
|
147
147
|
* with the collection of metrics, please see the individual implementations
|
|
148
148
|
* for how to extract metrics for viewing.
|
|
149
|
+
*
|
|
150
|
+
* @example How to register a simple metric
|
|
151
|
+
*
|
|
152
|
+
* ```typescript
|
|
153
|
+
* import { Metrics, Metric } from '@libp2p/interface/metrics
|
|
154
|
+
*
|
|
155
|
+
* interface MyServiceComponents {
|
|
156
|
+
* metrics: Metrics
|
|
157
|
+
* }
|
|
158
|
+
*
|
|
159
|
+
* class MyService {
|
|
160
|
+
* private readonly myMetric: Metric
|
|
161
|
+
*
|
|
162
|
+
* constructor (components: MyServiceComponents) {
|
|
163
|
+
* this.myMetric = components.metrics.registerMetric({
|
|
164
|
+
* name: 'my_metric',
|
|
165
|
+
* label: 'my_label',
|
|
166
|
+
* help: 'my help text'
|
|
167
|
+
* })
|
|
168
|
+
* }
|
|
169
|
+
*
|
|
170
|
+
* // later
|
|
171
|
+
* doSomething () {
|
|
172
|
+
* this.myMetric.update(1)
|
|
173
|
+
* }
|
|
174
|
+
* }
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @example How to register a dynamically calculated metric
|
|
178
|
+
*
|
|
179
|
+
* A metric that is expensive to calculate can be created by passing a `calculate` function that will only be invoked when metrics are being scraped:
|
|
180
|
+
*
|
|
181
|
+
* ```typescript
|
|
182
|
+
* import { Metrics, Metric } from '@libp2p/interface/metrics
|
|
183
|
+
*
|
|
184
|
+
* interface MyServiceComponents {
|
|
185
|
+
* metrics: Metrics
|
|
186
|
+
* }
|
|
187
|
+
*
|
|
188
|
+
* class MyService {
|
|
189
|
+
* private readonly myMetric: Metric
|
|
190
|
+
*
|
|
191
|
+
* constructor (components: MyServiceComponents) {
|
|
192
|
+
* this.myMetric = components.metrics.registerMetric({
|
|
193
|
+
* name: 'my_metric',
|
|
194
|
+
* label: 'my_label',
|
|
195
|
+
* help: 'my help text',
|
|
196
|
+
* calculate: async () => {
|
|
197
|
+
* // do something expensive
|
|
198
|
+
* return 1
|
|
199
|
+
* }
|
|
200
|
+
* })
|
|
201
|
+
* }
|
|
202
|
+
* }
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @example How to register a group of metrics
|
|
206
|
+
*
|
|
207
|
+
* If several metrics should be grouped together (e.g. for graphing purposes) `registerMetricGroup` can be used instead:
|
|
208
|
+
*
|
|
209
|
+
* ```typescript
|
|
210
|
+
* import { Metrics, MetricGroup } from '@libp2p/interface/metrics
|
|
211
|
+
*
|
|
212
|
+
* interface MyServiceComponents {
|
|
213
|
+
* metrics: Metrics
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* class MyService {
|
|
217
|
+
* private readonly myMetricGroup: MetricGroup
|
|
218
|
+
*
|
|
219
|
+
* constructor (components: MyServiceComponents) {
|
|
220
|
+
* this.myMetricGroup = components.metrics.registerMetricGroup({
|
|
221
|
+
* name: 'my_metric_group',
|
|
222
|
+
* label: 'my_label',
|
|
223
|
+
* help: 'my help text'
|
|
224
|
+
* })
|
|
225
|
+
* }
|
|
226
|
+
*
|
|
227
|
+
* // later
|
|
228
|
+
* doSomething () {
|
|
229
|
+
* this.myMetricGroup.increment({ my_label: 'my_value' })
|
|
230
|
+
* }
|
|
231
|
+
* }
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* There are specific metric groups for tracking libp2p connections and streams:
|
|
235
|
+
*
|
|
236
|
+
* @example How to track multiaddr connections
|
|
237
|
+
*
|
|
238
|
+
* This is something only libp2p transports need to do.
|
|
239
|
+
*
|
|
240
|
+
* ```typescript
|
|
241
|
+
* import { Metrics } from '@libp2p/interface/metrics
|
|
242
|
+
*
|
|
243
|
+
* interface MyServiceComponents {
|
|
244
|
+
* metrics: Metrics
|
|
245
|
+
* }
|
|
246
|
+
*
|
|
247
|
+
* class MyService {
|
|
248
|
+
* private readonly metrics: Metrics
|
|
249
|
+
*
|
|
250
|
+
* constructor (components: MyServiceComponents) {
|
|
251
|
+
* this.metrics = components.metrics
|
|
252
|
+
* }
|
|
253
|
+
*
|
|
254
|
+
* // later
|
|
255
|
+
* doSomething () {
|
|
256
|
+
* const connection = {} // create a connection
|
|
257
|
+
* this.metrics.trackMultiaddrConnection(connection)
|
|
258
|
+
* }
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* @example How to track protocol streams
|
|
263
|
+
*
|
|
264
|
+
* This is something only libp2p connections need to do.
|
|
265
|
+
*
|
|
266
|
+
* ```typescript
|
|
267
|
+
* import { Metrics } from '@libp2p/interface/metrics
|
|
268
|
+
*
|
|
269
|
+
* interface MyServiceComponents {
|
|
270
|
+
* metrics: Metrics
|
|
271
|
+
* }
|
|
272
|
+
*
|
|
273
|
+
* class MyService {
|
|
274
|
+
* private readonly metrics: Metrics
|
|
275
|
+
*
|
|
276
|
+
* constructor (components: MyServiceComponents) {
|
|
277
|
+
* this.metrics = components.metrics
|
|
278
|
+
* }
|
|
279
|
+
*
|
|
280
|
+
* // later
|
|
281
|
+
* doSomething () {
|
|
282
|
+
* const stream = {} // create a stream
|
|
283
|
+
* this.metrics.trackProtocolStream(stream)
|
|
284
|
+
* }
|
|
285
|
+
* }
|
|
286
|
+
* ```
|
|
149
287
|
*/
|
|
150
288
|
export interface Metrics {
|
|
151
289
|
/**
|
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
|
-
}
|