@libp2p/interface 1.0.2 → 1.1.0-388d02b33

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.
@@ -159,8 +159,36 @@ export interface NewStreamOptions extends AbortOptions {
159
159
  /**
160
160
  * Opt-in to running over a transient connection - one that has time/data limits
161
161
  * placed on it.
162
+ *
163
+ * @default false
162
164
  */
163
165
  runOnTransientConnection?: boolean;
166
+ /**
167
+ * By default when negotiating a protocol the dialer writes then protocol name
168
+ * then reads the response.
169
+ *
170
+ * When a only a single protocol is being negotiated on an outbound stream,
171
+ * and the stream is written to before being read from, we can optimistically
172
+ * write the protocol name and the first chunk of data together in the first
173
+ * message.
174
+ *
175
+ * Reading and handling the protocol response is done asynchronously, which
176
+ * means we can skip a round trip on writing to newly opened streams which
177
+ * significantly reduces the time-to-first-byte on a stream.
178
+ *
179
+ * The side-effect of this is that the underlying stream won't negotiate the
180
+ * protocol until either data is written to or read from the stream so it will
181
+ * not be opened on the remote until this is done.
182
+ *
183
+ * Pass `false` here to optimistically write the protocol name and first chunk
184
+ * of data in the first message.
185
+ *
186
+ * If multiple protocols are being negotiated, negotiation is always completed
187
+ * in full before the stream is returned so this option has no effect.
188
+ *
189
+ * @default true
190
+ */
191
+ negotiateFully?: boolean;
164
192
  }
165
193
  export type ConnectionStatus = 'open' | 'closing' | 'closed';
166
194
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MA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AC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IAC9F;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAA;IAErB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAA;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AA0RA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEhE,MAAM,UAAU,YAAY,CAAE,KAAU;IACtC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC1D,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAuTA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEhE,MAAM,UAAU,YAAY,CAAE,KAAU;IACtC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC1D,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { AbortOptions } from '../index.js';
1
+ import type { RoutingOptions } from '../index.js';
2
2
  import type { PeerInfo } from '../peer-info/index.js';
3
3
  import type { CID } from 'multiformats/cid';
4
4
  /**
@@ -21,6 +21,13 @@ import type { CID } from 'multiformats/cid';
21
21
  * ```
22
22
  */
23
23
  export declare const contentRoutingSymbol: unique symbol;
24
+ /**
25
+ * Implementers of this interface can provide a ContentRouting implementation to
26
+ * interested callers.
27
+ */
28
+ export interface ContentRoutingProvider {
29
+ [contentRoutingSymbol]: ContentRouting;
30
+ }
24
31
  export interface ContentRouting {
25
32
  /**
26
33
  * The implementation of this method should ensure that network peers know the
@@ -33,7 +40,7 @@ export interface ContentRouting {
33
40
  * await contentRouting.provide(cid)
34
41
  * ```
35
42
  */
36
- provide(cid: CID, options?: AbortOptions): Promise<void>;
43
+ provide(cid: CID, options?: RoutingOptions): Promise<void>;
37
44
  /**
38
45
  * Find the providers of the passed CID.
39
46
  *
@@ -46,7 +53,7 @@ export interface ContentRouting {
46
53
  * }
47
54
  * ```
48
55
  */
49
- findProviders(cid: CID, options?: AbortOptions): AsyncIterable<PeerInfo>;
56
+ findProviders(cid: CID, options?: RoutingOptions): AsyncIterable<PeerInfo>;
50
57
  /**
51
58
  * Puts a value corresponding to the passed key in a way that can later be
52
59
  * retrieved by another network peer using the get method.
@@ -61,7 +68,7 @@ export interface ContentRouting {
61
68
  * await contentRouting.put(key, value)
62
69
  * ```
63
70
  */
64
- put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise<void>;
71
+ put(key: Uint8Array, value: Uint8Array, options?: RoutingOptions): Promise<void>;
65
72
  /**
66
73
  * Retrieves a value from the network corresponding to the passed key.
67
74
  *
@@ -74,6 +81,6 @@ export interface ContentRouting {
74
81
  * const value = await contentRouting.get(key)
75
82
  * ```
76
83
  */
77
- get(key: Uint8Array, options?: AbortOptions): Promise<Uint8Array>;
84
+ get(key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array>;
78
85
  }
79
86
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,eAAwC,CAAA;AAEzE,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExD;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IAExE;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE9E;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAClE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,eAAwC,CAAA;AAEzE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,CAAC,oBAAoB,CAAC,EAAE,cAAc,CAAA;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1D;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IAE1E;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhF;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACpE"}
@@ -26,6 +26,7 @@ import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index
26
26
  import type { Topology } from './topology/index.js';
27
27
  import type { Listener } from './transport/index.js';
28
28
  import type { Multiaddr } from '@multiformats/multiaddr';
29
+ import type { ProgressOptions } from 'progress-events';
29
30
  /**
30
31
  * Used by the connection manager to sort addresses into order before dialling
31
32
  */
@@ -609,6 +610,26 @@ export interface LoggerOptions {
609
610
  export type RecursivePartial<T> = {
610
611
  [P in keyof T]?: T[P] extends Array<infer I> ? Array<RecursivePartial<I>> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial<T[P]>;
611
612
  };
613
+ /**
614
+ * When a routing operation involves reading values, these options allow
615
+ * controlling where the values are read from. By default libp2p will check
616
+ * local caches but may not use the network if a valid local value is found,
617
+ * these options allow tuning that behaviour.
618
+ */
619
+ export interface RoutingOptions extends AbortOptions, ProgressOptions {
620
+ /**
621
+ * Pass `false` to not use the network
622
+ *
623
+ * @default true
624
+ */
625
+ useNetwork?: boolean;
626
+ /**
627
+ * Pass `false` to not use cached values
628
+ *
629
+ * @default true
630
+ */
631
+ useCache?: boolean;
632
+ }
612
633
  export * from './connection/index.js';
613
634
  export * from './connection-encrypter/index.js';
614
635
  export * from './connection-gater/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IA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BAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA0qBH,cAAc,uBAAuB,CAAA;AACrC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
@@ -20,6 +20,13 @@ import type { PeerInfo } from '../peer-info/index.js';
20
20
  * ```
21
21
  */
22
22
  export declare const peerDiscoverySymbol: unique symbol;
23
+ /**
24
+ * Implementers of this interface can provide a PeerDiscovery implementation to
25
+ * interested callers.
26
+ */
27
+ export interface PeerDiscoveryProvider {
28
+ [peerDiscoverySymbol]: PeerDiscovery;
29
+ }
23
30
  export interface PeerDiscoveryEvents {
24
31
  'peer': CustomEvent<PeerInfo>;
25
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,eAAuC,CAAA;AAEvE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;CAAG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,eAAuC,CAAA;AAEvE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;CAAG"}
@@ -9,7 +9,7 @@ interface BasePeerId {
9
9
  toString(): string;
10
10
  toCID(): CID;
11
11
  toBytes(): Uint8Array;
12
- equals(other: PeerId | Uint8Array | string): boolean;
12
+ equals(other?: PeerId | Uint8Array | string): boolean;
13
13
  }
14
14
  export interface RSAPeerId extends BasePeerId {
15
15
  readonly type: 'RSA';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.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1
+ import type { RoutingOptions } from '../index.js';
2
2
  import type { PeerId } from '../peer-id/index.js';
3
3
  import type { PeerInfo } from '../peer-info/index.js';
4
4
  /**
@@ -21,6 +21,13 @@ import type { PeerInfo } from '../peer-info/index.js';
21
21
  * ```
22
22
  */
23
23
  export declare const peerRoutingSymbol: unique symbol;
24
+ /**
25
+ * Implementers of this interface can provide a PeerRouting implementation to
26
+ * interested callers.
27
+ */
28
+ export interface PeerRoutingProvider {
29
+ [peerRoutingSymbol]: PeerRouting;
30
+ }
24
31
  export interface PeerRouting {
25
32
  /**
26
33
  * Searches the network for peer info corresponding to the passed peer id.
@@ -32,7 +39,7 @@ export interface PeerRouting {
32
39
  * const peer = await peerRouting.findPeer(peerId, options)
33
40
  * ```
34
41
  */
35
- findPeer(peerId: PeerId, options?: AbortOptions): Promise<PeerInfo>;
42
+ findPeer(peerId: PeerId, options?: RoutingOptions): Promise<PeerInfo>;
36
43
  /**
37
44
  * Search the network for peers that are closer to the passed key. Peer
38
45
  * info should be yielded in ever-increasing closeness to the key.
@@ -46,6 +53,6 @@ export interface PeerRouting {
46
53
  * }
47
54
  * ```
48
55
  */
49
- getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable<PeerInfo>;
56
+ getClosestPeers(key: Uint8Array, options?: RoutingOptions): AsyncIterable<PeerInfo>;
50
57
  }
51
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,eAAqC,CAAA;AAEnE,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEnE;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;CAClF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,eAAqC,CAAA;AAEnE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAA;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAErE;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;CACpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface",
3
- "version": "1.0.2",
3
+ "version": "1.1.0-388d02b33",
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",
@@ -66,7 +66,8 @@
66
66
  "@multiformats/multiaddr": "^12.1.10",
67
67
  "it-pushable": "^3.2.1",
68
68
  "it-stream-types": "^2.0.1",
69
- "multiformats": "^12.1.3",
69
+ "multiformats": "^13.0.0",
70
+ "progress-events": "^1.0.0",
70
71
  "uint8arraylist": "^2.4.3"
71
72
  },
72
73
  "devDependencies": {
@@ -187,8 +187,37 @@ export interface NewStreamOptions extends AbortOptions {
187
187
  /**
188
188
  * Opt-in to running over a transient connection - one that has time/data limits
189
189
  * placed on it.
190
+ *
191
+ * @default false
190
192
  */
191
193
  runOnTransientConnection?: boolean
194
+
195
+ /**
196
+ * By default when negotiating a protocol the dialer writes then protocol name
197
+ * then reads the response.
198
+ *
199
+ * When a only a single protocol is being negotiated on an outbound stream,
200
+ * and the stream is written to before being read from, we can optimistically
201
+ * write the protocol name and the first chunk of data together in the first
202
+ * message.
203
+ *
204
+ * Reading and handling the protocol response is done asynchronously, which
205
+ * means we can skip a round trip on writing to newly opened streams which
206
+ * significantly reduces the time-to-first-byte on a stream.
207
+ *
208
+ * The side-effect of this is that the underlying stream won't negotiate the
209
+ * protocol until either data is written to or read from the stream so it will
210
+ * not be opened on the remote until this is done.
211
+ *
212
+ * Pass `false` here to optimistically write the protocol name and first chunk
213
+ * of data in the first message.
214
+ *
215
+ * If multiple protocols are being negotiated, negotiation is always completed
216
+ * in full before the stream is returned so this option has no effect.
217
+ *
218
+ * @default true
219
+ */
220
+ negotiateFully?: boolean
192
221
  }
193
222
 
194
223
  export type ConnectionStatus = 'open' | 'closing' | 'closed'
@@ -1,4 +1,4 @@
1
- import type { AbortOptions } from '../index.js'
1
+ import type { RoutingOptions } from '../index.js'
2
2
  import type { PeerInfo } from '../peer-info/index.js'
3
3
  import type { CID } from 'multiformats/cid'
4
4
 
@@ -23,6 +23,14 @@ import type { CID } from 'multiformats/cid'
23
23
  */
24
24
  export const contentRoutingSymbol = Symbol.for('@libp2p/content-routing')
25
25
 
26
+ /**
27
+ * Implementers of this interface can provide a ContentRouting implementation to
28
+ * interested callers.
29
+ */
30
+ export interface ContentRoutingProvider {
31
+ [contentRoutingSymbol]: ContentRouting
32
+ }
33
+
26
34
  export interface ContentRouting {
27
35
  /**
28
36
  * The implementation of this method should ensure that network peers know the
@@ -35,7 +43,7 @@ export interface ContentRouting {
35
43
  * await contentRouting.provide(cid)
36
44
  * ```
37
45
  */
38
- provide(cid: CID, options?: AbortOptions): Promise<void>
46
+ provide(cid: CID, options?: RoutingOptions): Promise<void>
39
47
 
40
48
  /**
41
49
  * Find the providers of the passed CID.
@@ -49,7 +57,7 @@ export interface ContentRouting {
49
57
  * }
50
58
  * ```
51
59
  */
52
- findProviders(cid: CID, options?: AbortOptions): AsyncIterable<PeerInfo>
60
+ findProviders(cid: CID, options?: RoutingOptions): AsyncIterable<PeerInfo>
53
61
 
54
62
  /**
55
63
  * Puts a value corresponding to the passed key in a way that can later be
@@ -65,7 +73,7 @@ export interface ContentRouting {
65
73
  * await contentRouting.put(key, value)
66
74
  * ```
67
75
  */
68
- put(key: Uint8Array, value: Uint8Array, options?: AbortOptions): Promise<void>
76
+ put(key: Uint8Array, value: Uint8Array, options?: RoutingOptions): Promise<void>
69
77
 
70
78
  /**
71
79
  * Retrieves a value from the network corresponding to the passed key.
@@ -79,5 +87,5 @@ export interface ContentRouting {
79
87
  * const value = await contentRouting.get(key)
80
88
  * ```
81
89
  */
82
- get(key: Uint8Array, options?: AbortOptions): Promise<Uint8Array>
90
+ get(key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array>
83
91
  }
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index
27
27
  import type { Topology } from './topology/index.js'
28
28
  import type { Listener } from './transport/index.js'
29
29
  import type { Multiaddr } from '@multiformats/multiaddr'
30
+ import type { ProgressOptions } from 'progress-events'
30
31
 
31
32
  /**
32
33
  * Used by the connection manager to sort addresses into order before dialling
@@ -671,6 +672,28 @@ export type RecursivePartial<T> = {
671
672
  [P in keyof T]?: T[P] extends Array<infer I> ? Array<RecursivePartial<I>> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial<T[P]>
672
673
  }
673
674
 
675
+ /**
676
+ * When a routing operation involves reading values, these options allow
677
+ * controlling where the values are read from. By default libp2p will check
678
+ * local caches but may not use the network if a valid local value is found,
679
+ * these options allow tuning that behaviour.
680
+ */
681
+ export interface RoutingOptions extends AbortOptions, ProgressOptions {
682
+ /**
683
+ * Pass `false` to not use the network
684
+ *
685
+ * @default true
686
+ */
687
+ useNetwork?: boolean
688
+
689
+ /**
690
+ * Pass `false` to not use cached values
691
+ *
692
+ * @default true
693
+ */
694
+ useCache?: boolean
695
+ }
696
+
674
697
  export * from './connection/index.js'
675
698
  export * from './connection-encrypter/index.js'
676
699
  export * from './connection-gater/index.js'
@@ -22,6 +22,14 @@ import type { PeerInfo } from '../peer-info/index.js'
22
22
  */
23
23
  export const peerDiscoverySymbol = Symbol.for('@libp2p/peer-discovery')
24
24
 
25
+ /**
26
+ * Implementers of this interface can provide a PeerDiscovery implementation to
27
+ * interested callers.
28
+ */
29
+ export interface PeerDiscoveryProvider {
30
+ [peerDiscoverySymbol]: PeerDiscovery
31
+ }
32
+
25
33
  export interface PeerDiscoveryEvents {
26
34
  'peer': CustomEvent<PeerInfo>
27
35
  }
@@ -12,7 +12,7 @@ interface BasePeerId {
12
12
  toString(): string
13
13
  toCID(): CID
14
14
  toBytes(): Uint8Array
15
- equals(other: PeerId | Uint8Array | string): boolean
15
+ equals(other?: PeerId | Uint8Array | string): boolean
16
16
  }
17
17
 
18
18
  export interface RSAPeerId extends BasePeerId {
@@ -1,4 +1,4 @@
1
- import type { AbortOptions } from '../index.js'
1
+ import type { RoutingOptions } from '../index.js'
2
2
  import type { PeerId } from '../peer-id/index.js'
3
3
  import type { PeerInfo } from '../peer-info/index.js'
4
4
 
@@ -23,6 +23,14 @@ import type { PeerInfo } from '../peer-info/index.js'
23
23
  */
24
24
  export const peerRoutingSymbol = Symbol.for('@libp2p/peer-routing')
25
25
 
26
+ /**
27
+ * Implementers of this interface can provide a PeerRouting implementation to
28
+ * interested callers.
29
+ */
30
+ export interface PeerRoutingProvider {
31
+ [peerRoutingSymbol]: PeerRouting
32
+ }
33
+
26
34
  export interface PeerRouting {
27
35
  /**
28
36
  * Searches the network for peer info corresponding to the passed peer id.
@@ -34,7 +42,7 @@ export interface PeerRouting {
34
42
  * const peer = await peerRouting.findPeer(peerId, options)
35
43
  * ```
36
44
  */
37
- findPeer(peerId: PeerId, options?: AbortOptions): Promise<PeerInfo>
45
+ findPeer(peerId: PeerId, options?: RoutingOptions): Promise<PeerInfo>
38
46
 
39
47
  /**
40
48
  * Search the network for peers that are closer to the passed key. Peer
@@ -49,5 +57,5 @@ export interface PeerRouting {
49
57
  * }
50
58
  * ```
51
59
  */
52
- getClosestPeers(key: Uint8Array, options?: AbortOptions): AsyncIterable<PeerInfo>
60
+ getClosestPeers(key: Uint8Array, options?: RoutingOptions): AsyncIterable<PeerInfo>
53
61
  }
@@ -1,152 +0,0 @@
1
- {
2
- "Connection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Connection.html",
3
- "ConnectionProtector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionProtector.html",
4
- "ConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionTimeline.html",
5
- "MultiaddrConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnection.html",
6
- "MultiaddrConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnectionTimeline.html",
7
- "NewStreamOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.NewStreamOptions.html",
8
- "Stream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Stream.html",
9
- "StreamTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.StreamTimeline.html",
10
- "ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ConnectionStatus.html",
11
- "Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.Direction.html",
12
- "ReadStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ReadStatus.html",
13
- "StreamStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.StreamStatus.html",
14
- "WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.WriteStatus.html",
15
- "connectionSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.connection.connectionSymbol.html",
16
- "isConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.connection.isConnection.html",
17
- "ConnectionEncrypter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.ConnectionEncrypter.html",
18
- "SecuredConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.SecuredConnection.html",
19
- "ConnectionGater": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_gater.ConnectionGater.html",
20
- "ContentRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.content_routing.ContentRouting.html",
21
- "contentRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.content_routing.contentRoutingSymbol.html",
22
- "AbortError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.AbortError.html",
23
- "CodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.CodeError.html",
24
- "InvalidCryptoExchangeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoExchangeError.html",
25
- "InvalidCryptoTransmissionError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoTransmissionError.html",
26
- "UnexpectedPeerError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.UnexpectedPeerError.html",
27
- "ERR_INVALID_MESSAGE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_INVALID_MESSAGE.html",
28
- "ERR_INVALID_PARAMETERS": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_INVALID_PARAMETERS.html",
29
- "ERR_NOT_FOUND": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_NOT_FOUND.html",
30
- "ERR_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_TIMEOUT.html",
31
- "setMaxListeners": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.events.setMaxListeners.html",
32
- "TypedEventEmitter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.index.TypedEventEmitter.html",
33
- "AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
34
- ".:AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
35
- "AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
36
- ".:AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
37
- "ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.ComponentLogger.html",
38
- ".:ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.ComponentLogger.html",
39
- "EventCallback": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.EventCallback.html",
40
- "EventObject": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.EventObject.html",
41
- "IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
42
- ".:IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
43
- "Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2p.html",
44
- ".:Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.Libp2p.html",
45
- "Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
46
- ".:Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
47
- "Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Logger.html",
48
- ".:Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Logger.html",
49
- "LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.LoggerOptions.html",
50
- ".:LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.LoggerOptions.html",
51
- "NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.NodeInfo.html",
52
- ".:NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.NodeInfo.html",
53
- "PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
54
- ".:PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
55
- "PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
56
- ".:PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
57
- "SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
58
- ".:SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
59
- "Topology": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Topology.html",
60
- "TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.TypedEventTarget.html",
61
- "EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.EventHandler.html",
62
- "Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.Libp2pStatus.html",
63
- ".:Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.Libp2pStatus.html",
64
- "PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
65
- ".:PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
66
- "RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
67
- ".:RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
68
- "ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
69
- ".:ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
70
- "CustomEvent": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.index.CustomEvent.html",
71
- "PrivateKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PrivateKey.html",
72
- "PublicKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PublicKey.html",
73
- "KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.keys.KeyType.html",
74
- "Ed25519": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.Ed25519.html",
75
- "RSA": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.RSA.html",
76
- "secp256k1": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.secp256k1.html",
77
- "CalculatedMetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CalculatedMetricOptions.html",
78
- "Counter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Counter.html",
79
- "CounterGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CounterGroup.html",
80
- "Metric": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metric.html",
81
- "MetricGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricGroup.html",
82
- "MetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricOptions.html",
83
- "Metrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metrics.html",
84
- "StopTimer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.StopTimer.html",
85
- "CalculateMetric": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.metrics.CalculateMetric.html",
86
- "PeerDiscovery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscovery.html",
87
- "PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscoveryEvents.html",
88
- "peerDiscoverySymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_discovery.peerDiscoverySymbol.html",
89
- "Ed25519PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Ed25519PeerId.html",
90
- "RSAPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.RSAPeerId.html",
91
- "Secp256k1PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Secp256k1PeerId.html",
92
- "PeerId": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerId.html",
93
- "PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerIdType.html",
94
- "peerIdSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_id.peerIdSymbol.html",
95
- "isPeerId": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.peer_id.isPeerId.html",
96
- "PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_info.PeerInfo.html",
97
- "PeerRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_routing.PeerRouting.html",
98
- "peerRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_routing.peerRoutingSymbol.html",
99
- "Address": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Address.html",
100
- "Peer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Peer.html",
101
- "PeerData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerData.html",
102
- "PeerQuery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQuery.html",
103
- "PeerQueryFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryFilter.html",
104
- "PeerQueryOrder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryOrder.html",
105
- "PeerStore": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerStore.html",
106
- "Tag": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Tag.html",
107
- "TagOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.TagOptions.html",
108
- "KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_store_tags.KEEP_ALIVE.html",
109
- "TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.pubsub.TopicValidatorResult.html",
110
- "PeerStreamEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreamEvents.html",
111
- "PeerStreams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreams.html",
112
- "PubSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSub.html",
113
- "PubSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubEvents.html",
114
- "PubSubInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubInit.html",
115
- "PubSubRPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPC.html",
116
- "PubSubRPCMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCMessage.html",
117
- "PubSubRPCSubscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCSubscription.html",
118
- "PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PublishResult.html",
119
- "SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SignedMessage.html",
120
- "SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SubscriptionChangeData.html",
121
- "TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.TopicValidatorFn.html",
122
- "UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.UnsignedMessage.html",
123
- "Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.Message.html",
124
- "SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.SignaturePolicy.html",
125
- "StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictNoSign.html",
126
- "StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictSign.html",
127
- "Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Envelope.html",
128
- "Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Record.html",
129
- "Startable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.startable.Startable.html",
130
- "isStartable": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.isStartable.html",
131
- "start": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.start.html",
132
- "stop": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.stop.html",
133
- "IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.IncomingStreamData.html",
134
- "StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandler.html",
135
- "StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerOptions.html",
136
- "StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerRecord.html",
137
- "StreamMuxer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxer.html",
138
- "StreamMuxerFactory": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerFactory.html",
139
- "StreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerInit.html",
140
- "FaultTolerance": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.transport.FaultTolerance.html",
141
- "ConnectionHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ConnectionHandler.html",
142
- "CreateListenerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.CreateListenerOptions.html",
143
- "DialOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.DialOptions.html",
144
- "Listener": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Listener.html",
145
- "ListenerEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ListenerEvents.html",
146
- "MultiaddrFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.MultiaddrFilter.html",
147
- "Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Transport.html",
148
- "Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Upgrader.html",
149
- "UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.UpgraderOptions.html",
150
- "transportSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.transport.transportSymbol.html",
151
- "isTransport": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.transport.isTransport.html"
152
- }