libp2p 0.34.0 → 0.35.3
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/src/config.d.ts +0 -6
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts +56 -0
- package/dist/src/connection-manager/auto-dialler.d.ts.map +1 -0
- package/dist/src/connection-manager/index.d.ts +0 -10
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/dht/dht-peer-routing.d.ts.map +1 -1
- package/dist/src/dialer/dial-request.d.ts.map +1 -1
- package/dist/src/dialer/index.d.ts +1 -1
- package/dist/src/dialer/index.d.ts.map +1 -1
- package/dist/src/errors.d.ts +24 -0
- package/dist/src/index.d.ts +3 -27
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/keychain/cms.d.ts.map +1 -1
- package/dist/src/keychain/index.d.ts.map +1 -1
- package/dist/src/peer-routing.d.ts +8 -1
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-store/book.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/circuit/index.js +2 -2
- package/src/config.js +1 -7
- package/src/connection-manager/auto-dialler.js +118 -0
- package/src/connection-manager/index.js +0 -52
- package/src/content-routing/index.js +2 -2
- package/src/dht/dht-peer-routing.js +6 -2
- package/src/dialer/dial-request.js +10 -3
- package/src/dialer/index.js +10 -9
- package/src/errors.js +25 -1
- package/src/index.js +9 -9
- package/src/keychain/cms.js +7 -6
- package/src/keychain/index.js +25 -24
- package/src/nat-manager.js +1 -1
- package/src/peer-routing.js +21 -8
- package/src/peer-store/book.js +4 -7
- package/src/ping/index.js +2 -2
- package/src/upgrader.js +1 -1
package/dist/src/config.d.ts
CHANGED
|
@@ -42,12 +42,6 @@ export function validate(opts: Libp2pOptions): {
|
|
|
42
42
|
dht: {
|
|
43
43
|
enabled: boolean;
|
|
44
44
|
kBucketSize: number;
|
|
45
|
-
randomWalk: {
|
|
46
|
-
enabled: boolean;
|
|
47
|
-
queriesPerPeriod: number;
|
|
48
|
-
interval: number;
|
|
49
|
-
timeout: number;
|
|
50
|
-
};
|
|
51
45
|
};
|
|
52
46
|
nat: {
|
|
53
47
|
enabled: boolean;
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.js"],"names":[],"mappings":"AAwG0B,+BAHf,aAAa,GACX;;;;;qCA9EmB,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8Ed,aAAa,GAAG,kBAAkB,CAS9D;wBAjGY,OAAO,WAAW,EAAE,SAAS;4BAC7B,OAAO,GAAG,EAAE,aAAa;iCACzB,OAAO,GAAG,EAAE,kBAAkB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export = AutoDialler;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import('../index')} Libp2p
|
|
4
|
+
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} AutoDiallerOptions
|
|
8
|
+
* @property {boolean} [enabled = true] - Should preemptively guarantee connections are above the low watermark
|
|
9
|
+
* @property {number} [minConnections = 0] - The minimum number of connections to avoid pruning
|
|
10
|
+
* @property {number} [autoDialInterval = 10000] - How often, in milliseconds, it should preemptively guarantee connections are above the low watermark
|
|
11
|
+
*/
|
|
12
|
+
declare class AutoDialler {
|
|
13
|
+
/**
|
|
14
|
+
* Proactively tries to connect to known peers stored in the PeerStore.
|
|
15
|
+
* It will keep the number of connections below the upper limit and sort
|
|
16
|
+
* the peers to connect based on wether we know their keys and protocols.
|
|
17
|
+
*
|
|
18
|
+
* @class
|
|
19
|
+
* @param {Libp2p} libp2p
|
|
20
|
+
* @param {AutoDiallerOptions} options
|
|
21
|
+
*/
|
|
22
|
+
constructor(libp2p: Libp2p, options?: AutoDiallerOptions);
|
|
23
|
+
_options: any;
|
|
24
|
+
_libp2p: import("../index");
|
|
25
|
+
_running: boolean;
|
|
26
|
+
_autoDialTimeout: any;
|
|
27
|
+
_autoDial(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Starts the auto dialer
|
|
30
|
+
*/
|
|
31
|
+
start(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Stops the auto dialler
|
|
34
|
+
*/
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
declare namespace AutoDialler {
|
|
38
|
+
export { Libp2p, Connection, AutoDiallerOptions };
|
|
39
|
+
}
|
|
40
|
+
type Libp2p = import('../index');
|
|
41
|
+
type AutoDiallerOptions = {
|
|
42
|
+
/**
|
|
43
|
+
* - Should preemptively guarantee connections are above the low watermark
|
|
44
|
+
*/
|
|
45
|
+
enabled?: boolean | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* - The minimum number of connections to avoid pruning
|
|
48
|
+
*/
|
|
49
|
+
minConnections?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* - How often, in milliseconds, it should preemptively guarantee connections are above the low watermark
|
|
52
|
+
*/
|
|
53
|
+
autoDialInterval?: number | undefined;
|
|
54
|
+
};
|
|
55
|
+
type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
56
|
+
//# sourceMappingURL=auto-dialler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-dialler.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/auto-dialler.js"],"names":[],"mappings":";AAiBA;;;GAGG;AAEH;;;;;GAKG;AAEH;IACE;;;;;;;;OAQG;IACH,oBAHW,MAAM,YACN,kBAAkB,EAU5B;IAPC,cAAqF;IACrF,4BAAqB;IACrB,kBAAqB;IACrB,sBAA4B;IAkC9B,2BAqCC;IAjED;;OAEG;IACH,cASC;IAED;;OAEG;IACH,sBASC;CAwCF;;;;cAjGY,OAAO,UAAU,CAAC"}
|
|
@@ -48,7 +48,6 @@ declare class ConnectionManager extends EventEmitter {
|
|
|
48
48
|
connections: Map<string, Connection[]>;
|
|
49
49
|
_started: boolean;
|
|
50
50
|
_timer: any;
|
|
51
|
-
_autoDialTimeout: any;
|
|
52
51
|
/**
|
|
53
52
|
* Checks the libp2p metrics to determine if any values have exceeded
|
|
54
53
|
* the configured maximums.
|
|
@@ -56,15 +55,6 @@ declare class ConnectionManager extends EventEmitter {
|
|
|
56
55
|
* @private
|
|
57
56
|
*/
|
|
58
57
|
private _checkMetrics;
|
|
59
|
-
/**
|
|
60
|
-
* Proactively tries to connect to known peers stored in the PeerStore.
|
|
61
|
-
* It will keep the number of connections below the upper limit and sort
|
|
62
|
-
* the peers to connect based on wether we know their keys and protocols.
|
|
63
|
-
*
|
|
64
|
-
* @async
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
private _autoDial;
|
|
68
58
|
_latencyMonitor: LatencyMonitor;
|
|
69
59
|
/**
|
|
70
60
|
* Get current number of open connections.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.js"],"names":[],"mappings":";AAkCA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;;;;;OAMG;IACH,oBAHW,MAAM,YACN,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.js"],"names":[],"mappings":";AAkCA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;;;;;OAMG;IACH,oBAHW,MAAM,YACN,wBAAwB,EAqClC;IAhCC,uBAAqB;IACrB,gBAA0C;IAE1C,cAAqF;IAOrF;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,MAAM,CAAC,CAED;IAE5B;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC,CAEP;IAE5B,kBAAqB;IACrB,YAAkB;IAoFpB;;;;;OAKG;IACH,sBAcC;IArGC,gCAGE;IAGJ;;OAEG;IACH,mBAGC;IAED;;;OAGG;IACH,cAYC;IA2JD;;;;;OAKG;IACH,0BAEC;IAjKD;;;;OAIG;IACH,sBASC;IAED;;;;OAIG;IACH,wBAWC;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,SACN,MAAM,GACJ,IAAI,CAOhB;IAwBD;;;;;OAKG;IACH,sBAHW,UAAU,GACR,IAAI,CAqBhB;IAED;;;;;OAKG;IACH,yBAHW,UAAU,GACR,IAAI,CAchB;IAED;;;;;OAKG;IACH,YAHW,MAAM,GACJ,UAAU,GAAC,IAAI,CAQ3B;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,UAAU,EAAE,CAexB;IAYD;;;;;;OAMG;IACH,uBAOC;IAED;;;;;OAKG;IACH,4BAiBC;CACF;;;;;;;;cA1SY,OAAO,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dht-peer-routing.d.ts","sourceRoot":"","sources":["../../../src/dht/dht-peer-routing.js"],"names":[],"mappings":"qBAMa,OAAO,SAAS,CAAC;gCACjB,OAAO,0CAA0C,EAAE,WAAW;AAF3E;;;GAGG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,iBAFW,OAAO,gBAAgB,EAAE,GAAG,EAItC;IADC,kDAAe;IAGjB;;;OAGG;IACH,iBAHW,MAAM,YACN,GAAG,
|
|
1
|
+
{"version":3,"file":"dht-peer-routing.d.ts","sourceRoot":"","sources":["../../../src/dht/dht-peer-routing.js"],"names":[],"mappings":"qBAMa,OAAO,SAAS,CAAC;gCACjB,OAAO,0CAA0C,EAAE,WAAW;AAF3E;;;GAGG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,iBAFW,OAAO,gBAAgB,EAAE,GAAG,EAItC;IADC,kDAAe;IAGjB;;;OAGG;IACH,iBAHW,MAAM,YACN,GAAG,6DAcb;IAED;;;OAGG;IACH,qBAHW,UAAU,YACV,GAAG,qFAQb;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-request.d.ts","sourceRoot":"","sources":["../../../src/dialer/dial-request.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"dial-request.d.ts","sourceRoot":"","sources":["../../../src/dialer/dial-request.js"],"names":[],"mappings":";AAWA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;IACE;;;;;;;;;OASG;IACH,2CAFW,kBAAkB,EAU5B;IAHC,uCAAkB;IAClB,qBAAoB;IACpB,gBAtBc,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC,CAsBzC;IAG9B;;;;;OAKG;IACH;;oBAFa,QAAQ,UAAU,CAAC,CA4C/B;CACF;;;;;;WA3Ea,SAAS,EAAE;oBACP,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC;YAC3D,MAAM;;cAXP,OAAO,IAAI,CAAC;iBACZ,OAAO,WAAW,EAAE,SAAS;;YAK5B,WAAW"}
|
|
@@ -163,7 +163,7 @@ type TransportManager = import('../transport-manager');
|
|
|
163
163
|
type Resolver = (addr: Multiaddr) => Promise<string[]>;
|
|
164
164
|
type PendingDial = {
|
|
165
165
|
dialRequest: DialRequest;
|
|
166
|
-
controller:
|
|
166
|
+
controller: TimeoutController;
|
|
167
167
|
promise: Promise<Connection>;
|
|
168
168
|
destroy: () => void;
|
|
169
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dialer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dialer/index.js"],"names":[],"mappings":";AAwBA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;IACE;;;OAGG;IACH,uIAFW,gBAAgB,GAAG,aAAa,EA0B1C;IAdC,iDAAwC;IACxC,mCAA0B;IAC1B,2BAnCsB,OAAO,EAAE,KAAK,OAAO,EAAE,CAmCX;IAClC,yBAAwC;IACxC,uBAAoC;IACpC,gBAA0B;IAC1B,wBAAsC;IACtC,iBAAuE;IACvE,6BAA8B;IAC9B,mCAAoC;IAOtC;;OAEG;IACH,gBAcC;IAED;;;;;;;;;OASG;IACH,oBALW,MAAM,GAAC,SAAS,GAAC,MAAM;;oBAGrB,QAAQ,UAAU,CAAC,CAwB/B;IAED;;;;;;;OAOG;IACH,mCAHW,MAAM,GAAC,SAAS,GAAC,MAAM,GACrB,QAAQ,UAAU,CAAC,CAmB/B;IAED;;;;;;;;;OASG;IACH,0BAmCC;IAED;;;;;;;;OAQG;IACH,2BAiCC;IAED;;OAEG;IACH,eAFW,MAAM,YAOhB;IAED;;OAEG;IACH,oBAFW,MAAM,QAOhB;IAED;;;;;OAKG;IACH,aAHW,SAAS,GACP,QAAQ,SAAS,EAAE,CAAC,CAwBhC;IAED;;;;;OAKG;IACH,mBAHW,SAAS,GACP,QAAQ,SAAS,EAAE,CAAC,CAWhC;CACF;;;;cA5SY,OAAO,SAAS,CAAC;;;;QAsBhB,MAAM;WACN,SAAS,EAAE;;;eAfX,SAAS;sBACT,gBAAgB;;;;;;iCAKJ,OAAO,EAAE,KAAK,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;iBAbpC,OAAO,eAAe,CAAC;eACvB,OAAO,4BAA4B,EAAE,OAAO;wBAC5C,OAAO,sBAAsB,CAAC;uBAQxB,SAAS,KAAK,QAAQ,MAAM,EAAE,CAAC;;iBAepC,WAAW;gBACX,iBAAiB;aACjB,QAAQ,UAAU,CAAC;mBACR,IAAI"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -36,5 +36,29 @@ export namespace codes {
|
|
|
36
36
|
export const ERR_UNSUPPORTED_PROTOCOL: string;
|
|
37
37
|
export const ERR_INVALID_MULTIADDR: string;
|
|
38
38
|
export const ERR_SIGNATURE_NOT_VALID: string;
|
|
39
|
+
export const ERR_FIND_SELF: string;
|
|
40
|
+
export const ERR_NO_ROUTERS_AVAILABLE: string;
|
|
41
|
+
export const ERR_CONNECTION_NOT_MULTIPLEXED: string;
|
|
42
|
+
export const ERR_NO_DIAL_TOKENS: string;
|
|
43
|
+
export const ERR_KEYCHAIN_REQUIRED: string;
|
|
44
|
+
export const ERR_INVALID_CMS: string;
|
|
45
|
+
export const ERR_MISSING_KEYS: string;
|
|
46
|
+
export const ERR_NO_KEY: string;
|
|
47
|
+
export const ERR_INVALID_KEY_NAME: string;
|
|
48
|
+
export const ERR_INVALID_KEY_TYPE: string;
|
|
49
|
+
export const ERR_KEY_ALREADY_EXISTS: string;
|
|
50
|
+
export const ERR_INVALID_KEY_SIZE: string;
|
|
51
|
+
export const ERR_KEY_NOT_FOUND: string;
|
|
52
|
+
export const ERR_OLD_KEY_NAME_INVALID: string;
|
|
53
|
+
export const ERR_NEW_KEY_NAME_INVALID: string;
|
|
54
|
+
export const ERR_PASSWORD_REQUIRED: string;
|
|
55
|
+
export const ERR_PEM_REQUIRED: string;
|
|
56
|
+
export const ERR_CANNOT_READ_KEY: string;
|
|
57
|
+
export const ERR_MISSING_PRIVATE_KEY: string;
|
|
58
|
+
export const ERR_INVALID_OLD_PASS_TYPE: string;
|
|
59
|
+
export const ERR_INVALID_NEW_PASS_TYPE: string;
|
|
60
|
+
export const ERR_INVALID_PASS_LENGTH: string;
|
|
61
|
+
export const ERR_NOT_IMPLEMENTED: string;
|
|
62
|
+
export const ERR_WRONG_PING_ACK: string;
|
|
39
63
|
}
|
|
40
64
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -19,16 +19,9 @@ export = Libp2p;
|
|
|
19
19
|
* @property {MuxedStream} stream
|
|
20
20
|
* @property {string} protocol
|
|
21
21
|
*
|
|
22
|
-
* @typedef {Object} RandomWalkOptions
|
|
23
|
-
* @property {boolean} [enabled = false]
|
|
24
|
-
* @property {number} [queriesPerPeriod = 1]
|
|
25
|
-
* @property {number} [interval = 300e3]
|
|
26
|
-
* @property {number} [timeout = 10e3]
|
|
27
|
-
*
|
|
28
22
|
* @typedef {Object} DhtOptions
|
|
29
23
|
* @property {boolean} [enabled = false]
|
|
30
24
|
* @property {number} [kBucketSize = 20]
|
|
31
|
-
* @property {RandomWalkOptions} [randomWalk]
|
|
32
25
|
* @property {boolean} [clientMode]
|
|
33
26
|
* @property {import('libp2p-interfaces/src/types').DhtSelectors} [selectors]
|
|
34
27
|
* @property {import('libp2p-interfaces/src/types').DhtValidators} [validators]
|
|
@@ -154,12 +147,6 @@ declare class Libp2p extends EventEmitter {
|
|
|
154
147
|
dht: {
|
|
155
148
|
enabled: boolean;
|
|
156
149
|
kBucketSize: number;
|
|
157
|
-
randomWalk: {
|
|
158
|
-
enabled: boolean;
|
|
159
|
-
queriesPerPeriod: number;
|
|
160
|
-
interval: number;
|
|
161
|
-
timeout: number;
|
|
162
|
-
};
|
|
163
150
|
};
|
|
164
151
|
nat: {
|
|
165
152
|
enabled: boolean;
|
|
@@ -213,12 +200,6 @@ declare class Libp2p extends EventEmitter {
|
|
|
213
200
|
dht: {
|
|
214
201
|
enabled: boolean;
|
|
215
202
|
kBucketSize: number;
|
|
216
|
-
randomWalk: {
|
|
217
|
-
enabled: boolean;
|
|
218
|
-
queriesPerPeriod: number;
|
|
219
|
-
interval: number;
|
|
220
|
-
timeout: number;
|
|
221
|
-
};
|
|
222
203
|
};
|
|
223
204
|
nat: {
|
|
224
205
|
enabled: boolean;
|
|
@@ -257,6 +238,7 @@ declare class Libp2p extends EventEmitter {
|
|
|
257
238
|
_transport: any[];
|
|
258
239
|
_discovery: Map<any, any>;
|
|
259
240
|
connectionManager: ConnectionManager;
|
|
241
|
+
_autodialler: AutoDialler;
|
|
260
242
|
metrics: Metrics | undefined;
|
|
261
243
|
keychain: Keychain | undefined;
|
|
262
244
|
upgrader: Upgrader;
|
|
@@ -409,7 +391,7 @@ declare class Libp2p extends EventEmitter {
|
|
|
409
391
|
private _setupPeerDiscovery;
|
|
410
392
|
}
|
|
411
393
|
declare namespace Libp2p {
|
|
412
|
-
export { Connection, MuxedStream, TransportFactory, MuxerFactory, ContentRoutingModule, PeerDiscoveryFactory, PeerRoutingModule, Crypto, Pubsub, PubsubOptions, Datastore, Protector, HandlerProps,
|
|
394
|
+
export { Connection, MuxedStream, TransportFactory, MuxerFactory, ContentRoutingModule, PeerDiscoveryFactory, PeerRoutingModule, Crypto, Pubsub, PubsubOptions, Datastore, Protector, HandlerProps, DhtOptions, KeychainOptions, PeerStoreOptions, PubsubLocalOptions, MetricsOptions, RelayOptions, Libp2pConfig, Libp2pModules, Libp2pOptions, constructorOptions, CreateOptions };
|
|
413
395
|
}
|
|
414
396
|
import { EventEmitter } from "events";
|
|
415
397
|
type Libp2pOptions = {
|
|
@@ -467,6 +449,7 @@ type Libp2pConfig = {
|
|
|
467
449
|
transport?: Record<string, Object> | undefined;
|
|
468
450
|
};
|
|
469
451
|
import ConnectionManager = require("./connection-manager");
|
|
452
|
+
import AutoDialler = require("./connection-manager/auto-dialler");
|
|
470
453
|
import Metrics = require("./metrics");
|
|
471
454
|
import Keychain = require("./keychain");
|
|
472
455
|
import Upgrader = require("./upgrader");
|
|
@@ -499,16 +482,9 @@ type Pubsub = import('libp2p-interfaces/src/pubsub');
|
|
|
499
482
|
type PubsubOptions = import('libp2p-interfaces/src/pubsub').PubsubOptions;
|
|
500
483
|
type Datastore = import('interface-datastore').Datastore;
|
|
501
484
|
type Protector = import('./pnet');
|
|
502
|
-
type RandomWalkOptions = {
|
|
503
|
-
enabled?: boolean | undefined;
|
|
504
|
-
queriesPerPeriod?: number | undefined;
|
|
505
|
-
interval?: number | undefined;
|
|
506
|
-
timeout?: number | undefined;
|
|
507
|
-
};
|
|
508
485
|
type DhtOptions = {
|
|
509
486
|
enabled?: boolean | undefined;
|
|
510
487
|
kBucketSize?: number | undefined;
|
|
511
|
-
randomWalk?: RandomWalkOptions | undefined;
|
|
512
488
|
clientMode?: boolean | undefined;
|
|
513
489
|
selectors?: import("libp2p-interfaces/src/types").DhtSelectors | undefined;
|
|
514
490
|
validators?: import("libp2p-interfaces/src/types").DhtValidators | undefined;
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms.d.ts","sourceRoot":"","sources":["../../../src/keychain/cms.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cms.d.ts","sourceRoot":"","sources":["../../../src/keychain/cms.js"],"names":[],"mappings":";AAgBA;;;;;;;;GAQG;AACH;IACE;;;;;OAKG;IACH,sBAHW,OAAO,SAAS,CAAC,OACjB,MAAM,EAShB;IAFC,4BAAwB;IAI1B;;;;;;;;OAQG;IACH,cAJW,MAAM,SACN,UAAU,GACR,QAAQ,UAAU,CAAC,CAuB/B;IAED;;;;;;;;OAQG;IACH,iBAHW,UAAU,GACR,QAAQ,UAAU,CAAC,CA8D/B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/keychain/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/keychain/index.js"],"names":[],"mappings":";AAmHA;;;;;;;GAOG;AACH;IAwDE;;;;OAIG;IACH,0BAFa,MAAM,CAOlB;IAED;;;;;OAKG;IACH,6BAEC;IA3ED;;;;;;OAMG;IACH,mBAJW,SAAS,WACT,eAAe,EAmCzB;IA5BC,+CAAkB;IAElB,UAAiD;IA4BnD;;;;;;;;;OASG;IACH,eAEC;IAwBD;;;;;;;OAOG;IACH,gBALW,MAAM,QACN,MAAM,8BAEJ,QAAQ,OAAO,CAAC,CAiD5B;IAED;;;;OAIG;IACH,YAFa,QAAQ,OAAO,EAAE,CAAC,CAc9B;IAED;;;;;OAKG;IACH,gBAHW,MAAM,GACJ,QAAQ,OAAO,GAAC,SAAS,CAAC,CAStC;IAED;;;;;OAKG;IACH,oBAHW,MAAM,GACJ,QAAQ,OAAO,CAAC,CAc5B;IAED;;;;;OAKG;IACH,gBAHW,MAAM,GACJ,QAAQ,OAAO,CAAC,CAc5B;IAED;;;;;;OAMG;IACH,mBAJW,MAAM,WACN,MAAM,GACJ,QAAQ,OAAO,CAAC,CAkC5B;IAED;;;;;;OAMG;IACH,gBAJW,MAAM,YACN,MAAM,GACJ,QAAQ,MAAM,CAAC,CAqB3B;IAED;;;;;;;OAOG;IACH,gBALW,MAAM,OACN,MAAM,YACN,MAAM,GACJ,QAAQ,OAAO,CAAC,CAyC5B;IAED;;;;;;OAMG;IACH,iBAJW,MAAM,QACN,MAAM,GACJ,QAAQ,OAAO,CAAC,CAiC5B;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,QAAQ,MAAM,CAAC,CAc3B;IAED;;;;;OAKG;IACH,4BAHW,MAAM,WACN,MAAM,sBA2ChB;CACF;;;;;;;;;;;;QAtgBa,MAAM;;;;UACN,MAAM;;cArBP,OAAO,SAAS,CAAC;iBACjB,OAAO,qBAAqB,EAAE,SAAS;;;;;;UAKtC,MAAM;UACN,MAAM;oBACN,MAAM;eACN,MAAM"}
|
|
@@ -9,6 +9,7 @@ export = PeerRouting;
|
|
|
9
9
|
* @property {boolean} [enabled = true] - Whether to enable the Refresh manager
|
|
10
10
|
* @property {number} [bootDelay = 6e5] - Boot delay to start the Refresh Manager (in ms)
|
|
11
11
|
* @property {number} [interval = 10e3] - Interval between each Refresh Manager run (in ms)
|
|
12
|
+
* @property {number} [timeout = 10e3] - How long to let each refresh run (in ms)
|
|
12
13
|
*
|
|
13
14
|
* @typedef {Object} PeerRoutingOptions
|
|
14
15
|
* @property {RefreshManagerOptions} [refreshManager]
|
|
@@ -60,11 +61,13 @@ declare class PeerRouting {
|
|
|
60
61
|
*
|
|
61
62
|
* @param {Uint8Array} key - A CID like key
|
|
62
63
|
* @param {Object} [options]
|
|
63
|
-
* @param {number} [options.timeout=30e3] - How long the query can take
|
|
64
|
+
* @param {number} [options.timeout=30e3] - How long the query can take
|
|
65
|
+
* @param {AbortSignal} [options.signal] - An AbortSignal to abort the request
|
|
64
66
|
* @returns {AsyncIterable<{ id: PeerId, multiaddrs: Multiaddr[] }>}
|
|
65
67
|
*/
|
|
66
68
|
getClosestPeers(key: Uint8Array, options?: {
|
|
67
69
|
timeout?: number | undefined;
|
|
70
|
+
signal?: AbortSignal | undefined;
|
|
68
71
|
} | undefined): AsyncIterable<{
|
|
69
72
|
id: PeerId;
|
|
70
73
|
multiaddrs: Multiaddr[];
|
|
@@ -87,6 +90,10 @@ type RefreshManagerOptions = {
|
|
|
87
90
|
* - Interval between each Refresh Manager run (in ms)
|
|
88
91
|
*/
|
|
89
92
|
interval?: number | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* - How long to let each refresh run (in ms)
|
|
95
|
+
*/
|
|
96
|
+
timeout?: number | undefined;
|
|
90
97
|
};
|
|
91
98
|
type PeerId = import('peer-id');
|
|
92
99
|
type Multiaddr = import('multiaddr').Multiaddr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-routing.d.ts","sourceRoot":"","sources":["../../src/peer-routing.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"peer-routing.d.ts","sourceRoot":"","sources":["../../src/peer-routing.js"],"names":[],"mappings":";AA2BA;;;;GAIG;AAEH;;;;;;;;;GASG;AAEH;IACE;;;OAGG;IACH,oBAFW,OAAO,IAAI,CAAC,EAgBtB;IAbC,2BAA4B;IAC5B,mCAAkC;IAClC,kCAAkC;IAClC,UADW,iBAAiB,EAAE,CACmB;IAOjD;;;;8BAAwE;IAkB1E;;OAEG;IACH,uCAOC;IAvBD;;OAEG;IACH,cAQC;IAHC,gBAEC;IAeH;;OAEG;IACH,aAEC;IAED;;;;;;;OAOG;IACH,aALW,MAAM;;oBAGJ,QAAQ;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC,CA+B5D;IAED;;;;;;;;OAQG;IACH,qBANW,UAAU;;;oBAIR,cAAc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC,CAmBlE;CACF;;;;yBArIY,OAAO,0CAA0C,EAAE,WAAW;;;;;;;;;;;;;;;;;;;cAF9D,OAAO,SAAS,CAAC;iBACjB,OAAO,WAAW,EAAE,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../../src/peer-store/book.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../../src/peer-store/book.js"],"names":[],"mappings":";AAWA;;GAEG;AAEH;IACE;;;;;;;;;OASG;IACH;QALiC,SAAS,EAA/B,SAAS;QACU,SAAS,EAA5B,MAAM;QACa,aAAa,EAAhC,MAAM;QAC4B,gBAAgB,WAA3C,GAAG,KAAK,GAAG,EAAE;OAc9B;IAXC,kBAAoB;IACpB,kBAA0B;IAC1B,sBAAkC;IAClC,yBANgB,GAAG,KAAK,GAAG,EAAE,CAMW;IAExC;;;;OAIG;IACH,MAFU,IAAI,MAAM,EAAE,GAAG,EAAE,GAAC,GAAG,CAAC,CAEX;IAGvB;;;;;OAKG;IACH,YAHW,MAAM,QACN,GAAG,EAAE,GAAC,GAAG,QAInB;IAED;;;;;;;;;OASG;IACH,2BANW,MAAM,QACN,GAAG;;oBAGD,IAAI,CAUhB;IAED;;;;;;OAMG;IACH,wBAHW,MAAM,SACN,GAAG,QAOb;IAED;;;;;;OAMG;IACH,YAHW,MAAM,GACJ,GAAG,EAAE,GAAC,GAAG,GAAC,SAAS,CAW/B;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,OAAO,CAcnB;CACF;;;;;iBA7GY,OAAO,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libp2p",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.3",
|
|
4
4
|
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
|
5
5
|
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"homepage": "https://libp2p.io",
|
|
67
67
|
"license": "MIT",
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
69
|
+
"node": ">=15.0.0"
|
|
70
70
|
},
|
|
71
71
|
"browser": {
|
|
72
|
-
"
|
|
72
|
+
"nat-api": false
|
|
73
73
|
},
|
|
74
74
|
"eslintConfig": {
|
|
75
75
|
"extends": "ipfs",
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"abortable-iterator": "^3.0.0",
|
|
84
|
-
"@motrix/nat-api": "^0.3.1",
|
|
85
83
|
"@vascosantos/moving-average": "^1.1.0",
|
|
86
84
|
"abort-controller": "^3.0.0",
|
|
85
|
+
"abortable-iterator": "^3.0.0",
|
|
87
86
|
"aggregate-error": "^3.1.0",
|
|
88
87
|
"any-signal": "^2.1.1",
|
|
89
88
|
"bignumber.js": "^9.0.1",
|
|
@@ -105,8 +104,8 @@
|
|
|
105
104
|
"it-merge": "^1.0.0",
|
|
106
105
|
"it-pipe": "^1.1.0",
|
|
107
106
|
"it-take": "^1.0.0",
|
|
108
|
-
"libp2p-crypto": "^0.
|
|
109
|
-
"libp2p-interfaces": "^
|
|
107
|
+
"libp2p-crypto": "^0.21.0",
|
|
108
|
+
"libp2p-interfaces": "^2.0.1",
|
|
110
109
|
"libp2p-utils": "^0.4.0",
|
|
111
110
|
"mafmt": "^10.0.0",
|
|
112
111
|
"merge-options": "^3.0.4",
|
|
@@ -114,26 +113,27 @@
|
|
|
114
113
|
"multiformats": "^9.0.0",
|
|
115
114
|
"multistream-select": "^2.0.0",
|
|
116
115
|
"mutable-proxy": "^1.0.0",
|
|
116
|
+
"nat-api": "^0.3.1",
|
|
117
117
|
"node-forge": "^0.10.0",
|
|
118
118
|
"p-any": "^3.0.0",
|
|
119
119
|
"p-fifo": "^1.0.0",
|
|
120
120
|
"p-retry": "^4.4.0",
|
|
121
121
|
"p-settle": "^4.1.1",
|
|
122
|
-
"peer-id": "^0.
|
|
122
|
+
"peer-id": "^0.16.0",
|
|
123
123
|
"private-ip": "^2.1.0",
|
|
124
124
|
"protobufjs": "^6.10.2",
|
|
125
125
|
"retimer": "^3.0.0",
|
|
126
126
|
"sanitize-filename": "^1.6.3",
|
|
127
127
|
"set-delayed-interval": "^1.0.0",
|
|
128
128
|
"streaming-iterables": "^6.0.0",
|
|
129
|
-
"timeout-abort-controller": "^
|
|
129
|
+
"timeout-abort-controller": "^2.0.0",
|
|
130
130
|
"uint8arrays": "^3.0.0",
|
|
131
131
|
"varint": "^6.0.0",
|
|
132
132
|
"wherearewe": "^1.0.0",
|
|
133
133
|
"xsalsa20": "^1.1.0"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@chainsafe/libp2p-noise": "^
|
|
136
|
+
"@chainsafe/libp2p-noise": "^5.0.0",
|
|
137
137
|
"@nodeutils/defaults-deep": "^1.1.0",
|
|
138
138
|
"@types/es6-promisify": "^6.0.0",
|
|
139
139
|
"@types/node": "^16.0.1",
|
|
@@ -143,31 +143,31 @@
|
|
|
143
143
|
"buffer": "^6.0.3",
|
|
144
144
|
"datastore-core": "^6.0.7",
|
|
145
145
|
"delay": "^5.0.0",
|
|
146
|
-
"into-stream": "^
|
|
147
|
-
"ipfs-http-client": "^
|
|
146
|
+
"into-stream": "^6.0.0",
|
|
147
|
+
"ipfs-http-client": "^54.0.2",
|
|
148
148
|
"it-concat": "^2.0.0",
|
|
149
149
|
"it-pair": "^1.0.0",
|
|
150
150
|
"it-pushable": "^1.4.0",
|
|
151
151
|
"libp2p": ".",
|
|
152
|
-
"libp2p-bootstrap": "^0.
|
|
152
|
+
"libp2p-bootstrap": "^0.14.0",
|
|
153
153
|
"libp2p-delegated-content-routing": "^0.11.0",
|
|
154
|
-
"libp2p-delegated-peer-routing": "^0.
|
|
154
|
+
"libp2p-delegated-peer-routing": "^0.11.1",
|
|
155
155
|
"libp2p-floodsub": "^0.27.0",
|
|
156
|
-
"libp2p-gossipsub": "^0.
|
|
157
|
-
"libp2p-interfaces-compliance-tests": "^
|
|
156
|
+
"libp2p-gossipsub": "^0.12.1",
|
|
157
|
+
"libp2p-interfaces-compliance-tests": "^2.0.1",
|
|
158
158
|
"libp2p-interop": "^0.5.0",
|
|
159
|
-
"libp2p-kad-dht": "^0.
|
|
160
|
-
"libp2p-mdns": "^0.
|
|
159
|
+
"libp2p-kad-dht": "^0.27.1",
|
|
160
|
+
"libp2p-mdns": "^0.18.0",
|
|
161
161
|
"libp2p-mplex": "^0.10.1",
|
|
162
162
|
"libp2p-tcp": "^0.17.0",
|
|
163
|
-
"libp2p-webrtc-star": "^0.
|
|
163
|
+
"libp2p-webrtc-star": "^0.25.0",
|
|
164
164
|
"libp2p-websockets": "^0.16.0",
|
|
165
165
|
"nock": "^13.0.3",
|
|
166
166
|
"p-defer": "^3.0.0",
|
|
167
167
|
"p-times": "^3.0.0",
|
|
168
168
|
"p-wait-for": "^3.2.0",
|
|
169
169
|
"rimraf": "^3.0.2",
|
|
170
|
-
"sinon": "^
|
|
170
|
+
"sinon": "^12.0.1",
|
|
171
171
|
"util": "^0.12.3"
|
|
172
172
|
},
|
|
173
173
|
"contributors": [
|
|
@@ -181,25 +181,24 @@
|
|
|
181
181
|
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
|
|
182
182
|
"Maciej Krüger <mkg20001@gmail.com>",
|
|
183
183
|
"Hugo Dias <mail@hugodias.me>",
|
|
184
|
-
"Chris Dostert <chrisdostert@users.noreply.github.com>",
|
|
185
184
|
"dirkmc <dirkmdev@gmail.com>",
|
|
185
|
+
"Chris Dostert <chrisdostert@users.noreply.github.com>",
|
|
186
186
|
"Volker Mische <volker.mische@gmail.com>",
|
|
187
|
-
"
|
|
187
|
+
"Robert Kiel <robert.kiel@hoprnet.org>",
|
|
188
188
|
"Richard Littauer <richard.littauer@gmail.com>",
|
|
189
|
+
"zeim839 <50573884+zeim839@users.noreply.github.com>",
|
|
189
190
|
"a1300 <matthias-knopp@gmx.net>",
|
|
190
191
|
"Ryan Bell <ryan@piing.net>",
|
|
191
|
-
"Elven <mon.samuel@qq.com>",
|
|
192
192
|
"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>",
|
|
193
|
-
"Thomas Eizinger <thomas@eizinger.io>",
|
|
194
|
-
"Robert Kiel <robert.kiel@hoprnet.org>",
|
|
195
193
|
"Andrew Nesbitt <andrewnez@gmail.com>",
|
|
196
|
-
"Samlior <samlior@foxmail.com>",
|
|
197
|
-
"acolytec3 <17355484+acolytec3@users.noreply.github.com>",
|
|
198
194
|
"Franck Royer <franck@royer.one>",
|
|
195
|
+
"Thomas Eizinger <thomas@eizinger.io>",
|
|
199
196
|
"Giovanni T. Parra <fiatjaf@gmail.com>",
|
|
197
|
+
"acolytec3 <17355484+acolytec3@users.noreply.github.com>",
|
|
198
|
+
"Alan Smithee <ggnore.alan.smithee@gmail.com>",
|
|
199
|
+
"Elven <mon.samuel@qq.com>",
|
|
200
|
+
"Samlior <samlior@foxmail.com>",
|
|
200
201
|
"Didrik Nordström <didrik.nordstrom@gmail.com>",
|
|
201
|
-
"RasmusErik Voel Jensen <github@solsort.com>",
|
|
202
|
-
"Smite Chow <xiaopengyou@live.com>",
|
|
203
202
|
"Soeren <nikorpoulsen@gmail.com>",
|
|
204
203
|
"Sönke Hahn <soenkehahn@gmail.com>",
|
|
205
204
|
"TJKoury <TJKoury@gmail.com>",
|
|
@@ -219,7 +218,6 @@
|
|
|
219
218
|
"shresthagrawal <34920931+shresthagrawal@users.noreply.github.com>",
|
|
220
219
|
"swedneck <40505480+swedneck@users.noreply.github.com>",
|
|
221
220
|
"greenSnot <greenSnot@users.noreply.github.com>",
|
|
222
|
-
"Alan Smithee <ggnore.alan.smithee@gmail.com>",
|
|
223
221
|
"Aleksei <vozhdb@gmail.com>",
|
|
224
222
|
"Bernd Strehl <bernd.strehl@gmail.com>",
|
|
225
223
|
"Chris Bratlien <chrisbratlien@gmail.com>",
|
|
@@ -244,9 +242,12 @@
|
|
|
244
242
|
"Lars Gierth <lgierth@users.noreply.github.com>",
|
|
245
243
|
"Leask Wong <i@leaskh.com>",
|
|
246
244
|
"Marcin Tojek <mtojek@users.noreply.github.com>",
|
|
245
|
+
"Marston Connell <34043723+TheMarstonConnell@users.noreply.github.com>",
|
|
247
246
|
"Michael Burns <5170+mburns@users.noreply.github.com>",
|
|
248
247
|
"Miguel Mota <miguelmota2@gmail.com>",
|
|
249
248
|
"Nuno Nogueira <nunofmn@gmail.com>",
|
|
250
|
-
"Philipp Muens <raute1337@gmx.de>"
|
|
249
|
+
"Philipp Muens <raute1337@gmx.de>",
|
|
250
|
+
"RasmusErik Voel Jensen <github@solsort.com>",
|
|
251
|
+
"Smite Chow <xiaopengyou@live.com>"
|
|
251
252
|
]
|
|
252
253
|
}
|
package/src/circuit/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const debug = require('debug')
|
|
|
4
4
|
const log = Object.assign(debug('libp2p:relay'), {
|
|
5
5
|
error: debug('libp2p:relay:err')
|
|
6
6
|
})
|
|
7
|
-
|
|
7
|
+
const { codes } = require('./../errors')
|
|
8
8
|
const {
|
|
9
9
|
setDelayedInterval,
|
|
10
10
|
clearDelayedInterval
|
|
@@ -88,7 +88,7 @@ class Relay {
|
|
|
88
88
|
const cid = await namespaceToCid(RELAY_RENDEZVOUS_NS)
|
|
89
89
|
await this._libp2p.contentRouting.provide(cid)
|
|
90
90
|
} catch (/** @type {any} */ err) {
|
|
91
|
-
if (err.code ===
|
|
91
|
+
if (err.code === codes.ERR_NO_ROUTERS_AVAILABLE) {
|
|
92
92
|
log.error('a content router, such as a DHT, must be provided in order to advertise the relay service', err)
|
|
93
93
|
// Stop the advertise
|
|
94
94
|
this.stop()
|
package/src/config.js
CHANGED
|
@@ -60,13 +60,7 @@ const DefaultConfig = {
|
|
|
60
60
|
protocolPrefix: 'ipfs',
|
|
61
61
|
dht: {
|
|
62
62
|
enabled: false,
|
|
63
|
-
kBucketSize: 20
|
|
64
|
-
randomWalk: {
|
|
65
|
-
enabled: false, // disabled waiting for https://github.com/libp2p/js-libp2p-kad-dht/issues/86
|
|
66
|
-
queriesPerPeriod: 1,
|
|
67
|
-
interval: 300e3,
|
|
68
|
-
timeout: 10e3
|
|
69
|
-
}
|
|
63
|
+
kBucketSize: 20
|
|
70
64
|
},
|
|
71
65
|
nat: {
|
|
72
66
|
enabled: true,
|