@libp2p/interface 1.0.2 → 1.1.0-528d73781
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/dist/index.min.js +1 -1
- package/dist/src/connection/index.d.ts +28 -0
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/content-routing/index.d.ts +12 -5
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/errors.d.ts +5 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +10 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-target.d.ts +1 -1
- package/dist/src/event-target.d.ts.map +1 -1
- package/dist/src/event-target.js +1 -1
- package/dist/src/event-target.js.map +1 -1
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/peer-discovery/index.d.ts +7 -0
- package/dist/src/peer-discovery/index.d.ts.map +1 -1
- package/dist/src/peer-id/index.d.ts +1 -1
- package/dist/src/peer-id/index.d.ts.map +1 -1
- package/dist/src/peer-routing/index.d.ts +10 -3
- package/dist/src/peer-routing/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/connection/index.ts +29 -0
- package/src/content-routing/index.ts +13 -5
- package/src/errors.ts +16 -0
- package/src/event-target.ts +1 -1
- package/src/index.ts +23 -0
- package/src/peer-discovery/index.ts +8 -0
- package/src/peer-id/index.ts +1 -1
- package/src/peer-routing/index.ts +11 -3
- package/dist/typedoc-urls.json +0 -152
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 y=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},I=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of L(t))!_.call(e,r)&&r!==o&&n(e,r,{get:()=>t[r],enumerable:!(s=y(t,r))||s.enumerable});return e};var N=e=>I(n({},"__esModule",{value:!0}),e);var q={};g(q,{AbortError:()=>i,AggregateCodeError:()=>l,CodeError:()=>a,CustomEvent:()=>b,ERR_INVALID_MESSAGE:()=>X,ERR_INVALID_PARAMETERS:()=>G,ERR_NOT_FOUND:()=>j,ERR_TIMEOUT:()=>F,Ed25519:()=>w,FaultTolerance:()=>c,InvalidCryptoExchangeError:()=>f,InvalidCryptoTransmissionError:()=>u,KEEP_ALIVE:()=>C,RSA:()=>P,StrictNoSign:()=>k,StrictSign:()=>U,TopicValidatorResult:()=>p,TypedEventEmitter:()=>m,UnexpectedPeerError:()=>x,connectionSymbol:()=>S,contentRoutingSymbol:()=>v,isConnection:()=>T,isPeerId:()=>D,isStartable:()=>E,isTransport:()=>B,peerDiscoverySymbol:()=>O,peerIdSymbol:()=>R,peerRoutingSymbol:()=>V,secp256k1:()=>M,setMaxListeners:()=>Y,start:()=>H,stop:()=>K,transportSymbol:()=>A});var S=Symbol.for("@libp2p/connection");function T(e){return e!=null&&!!e[S]}var v=Symbol.for("@libp2p/content-routing");var w="Ed25519",P="RSA",M="secp256k1";var O=Symbol.for("@libp2p/peer-discovery");var R=Symbol.for("@libp2p/peer-id");function D(e){return e!=null&&!!e[R]}var V=Symbol.for("@libp2p/peer-routing");var C="keep-alive";var U="StrictSign",k="StrictNoSign",p;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(p||(p={}));var A=Symbol.for("@libp2p/transport");function B(e){return e!=null&&!!e[A]}var c;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(c||(c={}));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??{}}},x=class e extends Error{code;constructor(t="Unexpected Peer"){super(t),this.code=e.code}static code="ERR_UNEXPECTED_PEER"},f=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"},F="ERR_TIMEOUT",G="ERR_INVALID_PARAMETERS",j="ERR_NOT_FOUND",X="ERR_INVALID_MESSAGE";var m=class extends EventTarget{#t=new Map;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:h})=>h!==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))}},d=class extends Event{detail;constructor(t,o){super(t,o),this.detail=o?.detail}},b=globalThis.CustomEvent??d;var Y=(e,...t)=>{try{[...t]}catch{}};function E(e){return e!=null&&typeof e.start=="function"&&typeof e.stop=="function"}async function H(...e){let t=[];for(let o of e)E(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)E(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 N(q);})();
|
|
3
3
|
return Libp2PInterface}));
|
|
@@ -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
|
/**
|
|
@@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C,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":"
|
|
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 {
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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,
|
|
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"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export declare class CodeError<T extends Record<string, any> = Record<string, ne
|
|
|
15
15
|
readonly props: T;
|
|
16
16
|
constructor(message: string, code: string, props?: T);
|
|
17
17
|
}
|
|
18
|
+
export declare class AggregateCodeError<T extends Record<string, any> = Record<string, never>> extends AggregateError {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly props: T;
|
|
21
|
+
constructor(errors: Error[], message: string, code: string, props?: T);
|
|
22
|
+
}
|
|
18
23
|
export declare class UnexpectedPeerError extends Error {
|
|
19
24
|
code: string;
|
|
20
25
|
constructor(message?: string);
|
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAA;gBAEf,OAAO,GAAE,MAAoC;IAM1D,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAc;IAElC,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAY;CACjC;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,KAAK;aAKvE,IAAI,EAAE,MAAM;IAJ9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAoB;IAKxC,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAwB;CAC7C;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAA4B;IAKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD;AAID,eAAO,MAAM,WAAW,gBAAgB,CAAA;AACxC,eAAO,MAAM,sBAAsB,2BAA2B,CAAA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AKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD;AAID,eAAO,MAAM,WAAW,gBAAgB,CAAA;AACxC,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAC5C,eAAO,MAAM,mBAAmB,wBAAwB,CAAA"}
|
package/dist/src/errors.js
CHANGED
|
@@ -24,6 +24,16 @@ export class CodeError extends Error {
|
|
|
24
24
|
this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
export class AggregateCodeError extends AggregateError {
|
|
28
|
+
code;
|
|
29
|
+
props;
|
|
30
|
+
constructor(errors, message, code, props) {
|
|
31
|
+
super(errors, message);
|
|
32
|
+
this.code = code;
|
|
33
|
+
this.name = props?.name ?? 'AggregateCodeError';
|
|
34
|
+
this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions
|
|
35
|
+
}
|
|
36
|
+
}
|
|
27
37
|
export class UnexpectedPeerError extends Error {
|
|
28
38
|
code;
|
|
29
39
|
constructor(message = 'Unexpected Peer') {
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnB,IAAI,CAAQ;IACZ,IAAI,CAAQ;IAE5B,YAAa,UAAkB,2BAA2B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA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IACpG,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,qBAAqB,CAAA;;AAG9C,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,yBAAyB;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAC7C,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,6BAA6B,CAAA;;AAGtD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAChD,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,6BAA6B;QAClD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC,IAAI,CAAA;IACjD,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,iCAAiC,CAAA;;AAG1D,cAAc;AAEd,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA"}
|
|
@@ -30,7 +30,7 @@ export declare class TypedEventEmitter<EventMap extends Record<string, any>> ext
|
|
|
30
30
|
addEventListener<K extends keyof EventMap>(type: K, listener: EventHandler<EventMap[K]> | null, options?: boolean | AddEventListenerOptions): void;
|
|
31
31
|
removeEventListener<K extends keyof EventMap>(type: K, listener?: EventHandler<EventMap[K]> | null, options?: boolean | EventListenerOptions): void;
|
|
32
32
|
dispatchEvent(event: Event): boolean;
|
|
33
|
-
safeDispatchEvent<Detail>(type: keyof EventMap, detail
|
|
33
|
+
safeDispatchEvent<Detail>(type: keyof EventMap, detail?: CustomEventInit<Detail>): boolean;
|
|
34
34
|
}
|
|
35
35
|
export declare const CustomEvent: {
|
|
36
36
|
new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): CustomEvent<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-target.d.ts","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"AAAA,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,IAA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I,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
|
@@ -42,7 +42,7 @@ export class TypedEventEmitter extends EventTarget {
|
|
|
42
42
|
this.#listeners.set(event.type, list);
|
|
43
43
|
return result;
|
|
44
44
|
}
|
|
45
|
-
safeDispatchEvent(type, detail) {
|
|
45
|
+
safeDispatchEvent(type, detail = {}) {
|
|
46
46
|
return this.dispatchEvent(new CustomEvent(type, detail));
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-target.js","sourceRoot":"","sources":["../../src/event-target.ts"],"names":[],"mappings":"AA6BA;;;GAGG;AACH,MAAM,OAAO,iBAAwD,SAAQ,WAAW;IACtF,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAA;IAEvC,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,S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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
|
@@ -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';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAA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AK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjJ,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,YAAY,EAAE,eAAe;IACnE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,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"}
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
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
|
|
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.ts","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAA;AA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CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,CAAA;AAEhE,eAAO,MAAM,YAAY,eAAgC,CAAA;AAEzD,wBAAgB,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAErD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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?:
|
|
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?:
|
|
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,
|
|
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
|
|
3
|
+
"version": "1.1.0-528d73781",
|
|
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": "^
|
|
69
|
+
"multiformats": "^13.0.0",
|
|
70
|
+
"progress-events": "^1.0.0",
|
|
70
71
|
"uint8arraylist": "^2.4.3"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
package/src/connection/index.ts
CHANGED
|
@@ -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 {
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
90
|
+
get(key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array>
|
|
83
91
|
}
|
package/src/errors.ts
CHANGED
|
@@ -33,6 +33,22 @@ export class CodeError<T extends Record<string, any> = Record<string, never>> ex
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export class AggregateCodeError<T extends Record<string, any> = Record<string, never>> extends AggregateError {
|
|
37
|
+
public readonly props: T
|
|
38
|
+
|
|
39
|
+
constructor (
|
|
40
|
+
errors: Error[],
|
|
41
|
+
message: string,
|
|
42
|
+
public readonly code: string,
|
|
43
|
+
props?: T
|
|
44
|
+
) {
|
|
45
|
+
super(errors, message)
|
|
46
|
+
|
|
47
|
+
this.name = props?.name ?? 'AggregateCodeError'
|
|
48
|
+
this.props = props ?? {} as T // eslint-disable-line @typescript-eslint/consistent-type-assertions
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
export class UnexpectedPeerError extends Error {
|
|
37
53
|
public code: string
|
|
38
54
|
|
package/src/event-target.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class TypedEventEmitter<EventMap extends Record<string, any>> extends Eve
|
|
|
90
90
|
return result
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
safeDispatchEvent<Detail>(type: keyof EventMap, detail: CustomEventInit<Detail>): boolean {
|
|
93
|
+
safeDispatchEvent<Detail>(type: keyof EventMap, detail: CustomEventInit<Detail> = {}): boolean {
|
|
94
94
|
return this.dispatchEvent(new CustomEvent<Detail>(type as string, detail))
|
|
95
95
|
}
|
|
96
96
|
}
|
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
|
}
|
package/src/peer-id/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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?:
|
|
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?:
|
|
60
|
+
getClosestPeers(key: Uint8Array, options?: RoutingOptions): AsyncIterable<PeerInfo>
|
|
53
61
|
}
|
package/dist/typedoc-urls.json
DELETED
|
@@ -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
|
-
}
|