libp2p 1.9.4 → 2.0.0-7cd984569
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 +17 -18
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/components.js +4 -3
- package/dist/src/components.js.map +1 -1
- package/dist/src/config.d.ts +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +2 -7
- package/dist/src/config.js.map +1 -1
- package/dist/src/connection/index.d.ts +3 -3
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/index.js +7 -7
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/connection-manager/connection-pruner.js +1 -1
- package/dist/src/connection-manager/constants.browser.d.ts +0 -8
- package/dist/src/connection-manager/constants.browser.d.ts.map +1 -1
- package/dist/src/connection-manager/constants.browser.js +0 -8
- package/dist/src/connection-manager/constants.browser.js.map +1 -1
- package/dist/src/connection-manager/constants.d.ts +0 -8
- package/dist/src/connection-manager/constants.d.ts.map +1 -1
- package/dist/src/connection-manager/constants.defaults.d.ts +12 -22
- package/dist/src/connection-manager/constants.defaults.d.ts.map +1 -1
- package/dist/src/connection-manager/constants.defaults.js +12 -22
- package/dist/src/connection-manager/constants.defaults.js.map +1 -1
- package/dist/src/connection-manager/constants.js +0 -8
- package/dist/src/connection-manager/constants.js.map +1 -1
- package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
- package/dist/src/connection-manager/dial-queue.js +29 -15
- package/dist/src/connection-manager/dial-queue.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +47 -50
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js +23 -57
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/connection-manager/reconnect-queue.d.ts +35 -0
- package/dist/src/connection-manager/reconnect-queue.d.ts.map +1 -0
- package/dist/src/connection-manager/reconnect-queue.js +104 -0
- package/dist/src/connection-manager/reconnect-queue.js.map +1 -0
- package/dist/src/connection-monitor.d.ts +1 -0
- package/dist/src/connection-monitor.d.ts.map +1 -1
- package/dist/src/connection-monitor.js +15 -5
- package/dist/src/connection-monitor.js.map +1 -1
- package/dist/src/content-routing.js +6 -6
- package/dist/src/content-routing.js.map +1 -1
- package/dist/src/errors.d.ts +41 -61
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +84 -63
- package/dist/src/errors.js.map +1 -1
- package/dist/src/get-peer.d.ts.map +1 -1
- package/dist/src/get-peer.js +4 -5
- package/dist/src/get-peer.js.map +1 -1
- package/dist/src/index.d.ts +27 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/libp2p.d.ts +11 -10
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +13 -31
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/peer-routing.js +8 -8
- package/dist/src/peer-routing.js.map +1 -1
- package/dist/src/registrar.js +7 -7
- package/dist/src/registrar.js.map +1 -1
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/transport-manager.js +15 -23
- package/dist/src/transport-manager.js.map +1 -1
- package/dist/src/upgrader.d.ts +8 -8
- package/dist/src/upgrader.d.ts.map +1 -1
- package/dist/src/upgrader.js +51 -51
- package/dist/src/upgrader.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +21 -21
- package/src/components.ts +4 -3
- package/src/config.ts +4 -10
- package/src/connection/index.ts +9 -9
- package/src/connection-manager/connection-pruner.ts +1 -1
- package/src/connection-manager/constants.browser.ts +0 -10
- package/src/connection-manager/constants.defaults.ts +14 -27
- package/src/connection-manager/constants.ts +0 -10
- package/src/connection-manager/dial-queue.ts +30 -15
- package/src/connection-manager/index.ts +80 -118
- package/src/connection-manager/reconnect-queue.ts +134 -0
- package/src/connection-monitor.ts +15 -6
- package/src/content-routing.ts +6 -6
- package/src/errors.ts +96 -61
- package/src/get-peer.ts +4 -5
- package/src/index.ts +42 -12
- package/src/libp2p.ts +22 -36
- package/src/peer-routing.ts +8 -8
- package/src/registrar.ts +7 -7
- package/src/transport-manager.ts +15 -23
- package/src/upgrader.ts +55 -56
- package/src/version.ts +1 -1
- package/dist/src/connection-manager/auto-dial.d.ts +0 -47
- package/dist/src/connection-manager/auto-dial.d.ts.map +0 -1
- package/dist/src/connection-manager/auto-dial.js +0 -223
- package/dist/src/connection-manager/auto-dial.js.map +0 -1
- package/dist/typedoc-urls.json +0 -14
- package/src/connection-manager/auto-dial.ts +0 -285
package/dist/src/upgrader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvalidMultiaddrError, InvalidPeerIdError, TooManyInboundProtocolStreamsError, TooManyOutboundProtocolStreamsError, LimitedConnectionError, TimeoutError, setMaxListeners } from '@libp2p/interface';
|
|
2
2
|
import * as mss from '@libp2p/multistream-select';
|
|
3
3
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
4
4
|
import { CustomProgressEvent } from 'progress-events';
|
|
5
5
|
import { createConnection } from './connection/index.js';
|
|
6
6
|
import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ConnectionDeniedError, ConnectionInterceptedError, EncryptionFailedError, MuxerUnavailableError } from './errors.js';
|
|
8
8
|
import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js';
|
|
9
9
|
const DEFAULT_PROTOCOL_SELECT_TIMEOUT = 30000;
|
|
10
10
|
function findIncomingStreamLimit(protocol, registrar) {
|
|
@@ -13,7 +13,7 @@ function findIncomingStreamLimit(protocol, registrar) {
|
|
|
13
13
|
return options.maxInboundStreams;
|
|
14
14
|
}
|
|
15
15
|
catch (err) {
|
|
16
|
-
if (err.
|
|
16
|
+
if (err.name !== 'UnhandledProtocolError') {
|
|
17
17
|
throw err;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ function findOutgoingStreamLimit(protocol, registrar, options = {}) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
catch (err) {
|
|
30
|
-
if (err.
|
|
30
|
+
if (err.name !== 'UnhandledProtocolError') {
|
|
31
31
|
throw err;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -44,19 +44,19 @@ function countStreams(protocol, direction, connection) {
|
|
|
44
44
|
}
|
|
45
45
|
export class DefaultUpgrader {
|
|
46
46
|
components;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
connectionEncrypters;
|
|
48
|
+
streamMuxers;
|
|
49
49
|
inboundUpgradeTimeout;
|
|
50
50
|
events;
|
|
51
51
|
constructor(components, init) {
|
|
52
52
|
this.components = components;
|
|
53
|
-
this.
|
|
54
|
-
init.
|
|
55
|
-
this.
|
|
53
|
+
this.connectionEncrypters = new Map();
|
|
54
|
+
init.connectionEncrypters.forEach(encrypter => {
|
|
55
|
+
this.connectionEncrypters.set(encrypter.protocol, encrypter);
|
|
56
56
|
});
|
|
57
|
-
this.
|
|
58
|
-
init.
|
|
59
|
-
this.
|
|
57
|
+
this.streamMuxers = new Map();
|
|
58
|
+
init.streamMuxers.forEach(muxer => {
|
|
59
|
+
this.streamMuxers.set(muxer.protocol, muxer);
|
|
60
60
|
});
|
|
61
61
|
this.inboundUpgradeTimeout = init.inboundUpgradeTimeout ?? INBOUND_UPGRADE_TIMEOUT;
|
|
62
62
|
this.events = components.events;
|
|
@@ -66,7 +66,7 @@ export class DefaultUpgrader {
|
|
|
66
66
|
const connectionGater = this.components.connectionGater[connectionType];
|
|
67
67
|
if (connectionGater !== undefined) {
|
|
68
68
|
if (await connectionGater(remotePeer, maConn)) {
|
|
69
|
-
throw new
|
|
69
|
+
throw new ConnectionInterceptedError(`The multiaddr connection is blocked by gater.${connectionType}`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -76,7 +76,7 @@ export class DefaultUpgrader {
|
|
|
76
76
|
async upgradeInbound(maConn, opts) {
|
|
77
77
|
const accept = await this.components.connectionManager.acceptIncomingConnection(maConn);
|
|
78
78
|
if (!accept) {
|
|
79
|
-
throw new
|
|
79
|
+
throw new ConnectionDeniedError('connection denied');
|
|
80
80
|
}
|
|
81
81
|
let encryptedConn;
|
|
82
82
|
let remotePeer;
|
|
@@ -85,13 +85,13 @@ export class DefaultUpgrader {
|
|
|
85
85
|
let cryptoProtocol;
|
|
86
86
|
const signal = AbortSignal.timeout(this.inboundUpgradeTimeout);
|
|
87
87
|
const onAbort = () => {
|
|
88
|
-
maConn.abort(new
|
|
88
|
+
maConn.abort(new TimeoutError('inbound upgrade timeout'));
|
|
89
89
|
};
|
|
90
90
|
signal.addEventListener('abort', onAbort, { once: true });
|
|
91
91
|
setMaxListeners(Infinity, signal);
|
|
92
92
|
try {
|
|
93
93
|
if ((await this.components.connectionGater.denyInboundConnection?.(maConn)) === true) {
|
|
94
|
-
throw new
|
|
94
|
+
throw new ConnectionInterceptedError('The multiaddr connection is blocked by gater.acceptConnection');
|
|
95
95
|
}
|
|
96
96
|
this.components.metrics?.trackMultiaddrConnection(maConn);
|
|
97
97
|
maConn.log('starting the inbound connection upgrade');
|
|
@@ -123,7 +123,7 @@ export class DefaultUpgrader {
|
|
|
123
123
|
else {
|
|
124
124
|
const idStr = maConn.remoteAddr.getPeerId();
|
|
125
125
|
if (idStr == null) {
|
|
126
|
-
throw new
|
|
126
|
+
throw new InvalidMultiaddrError('inbound connection that skipped encryption must have a peer id');
|
|
127
127
|
}
|
|
128
128
|
const remotePeerId = peerIdFromString(idStr);
|
|
129
129
|
cryptoProtocol = 'native';
|
|
@@ -133,13 +133,13 @@ export class DefaultUpgrader {
|
|
|
133
133
|
if (opts?.muxerFactory != null) {
|
|
134
134
|
muxerFactory = opts.muxerFactory;
|
|
135
135
|
}
|
|
136
|
-
else if (this.
|
|
136
|
+
else if (this.streamMuxers.size > 0) {
|
|
137
137
|
opts?.onProgress?.(new CustomProgressEvent('upgrader:multiplex-inbound-connection'));
|
|
138
138
|
// Multiplex the connection
|
|
139
139
|
const multiplexed = await this._multiplexInbound({
|
|
140
140
|
...protectedConn,
|
|
141
141
|
...encryptedConn
|
|
142
|
-
}, this.
|
|
142
|
+
}, this.streamMuxers);
|
|
143
143
|
muxerFactory = multiplexed.muxerFactory;
|
|
144
144
|
upgradedConn = multiplexed.stream;
|
|
145
145
|
}
|
|
@@ -157,7 +157,7 @@ export class DefaultUpgrader {
|
|
|
157
157
|
upgradedConn,
|
|
158
158
|
muxerFactory,
|
|
159
159
|
remotePeer,
|
|
160
|
-
|
|
160
|
+
limits: opts?.limits
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
finally {
|
|
@@ -200,7 +200,10 @@ export class DefaultUpgrader {
|
|
|
200
200
|
conn: encryptedConn,
|
|
201
201
|
remotePeer,
|
|
202
202
|
protocol: cryptoProtocol
|
|
203
|
-
} = await this._encryptOutbound(protectedConn,
|
|
203
|
+
} = await this._encryptOutbound(protectedConn, {
|
|
204
|
+
...opts,
|
|
205
|
+
remotePeer: remotePeerId
|
|
206
|
+
}));
|
|
204
207
|
const maConn = {
|
|
205
208
|
...protectedConn,
|
|
206
209
|
...encryptedConn
|
|
@@ -209,7 +212,7 @@ export class DefaultUpgrader {
|
|
|
209
212
|
}
|
|
210
213
|
else {
|
|
211
214
|
if (remotePeerId == null) {
|
|
212
|
-
throw new
|
|
215
|
+
throw new InvalidPeerIdError('Encryption was skipped but no peer id was passed');
|
|
213
216
|
}
|
|
214
217
|
cryptoProtocol = 'native';
|
|
215
218
|
remotePeer = remotePeerId;
|
|
@@ -218,12 +221,12 @@ export class DefaultUpgrader {
|
|
|
218
221
|
if (opts?.muxerFactory != null) {
|
|
219
222
|
muxerFactory = opts.muxerFactory;
|
|
220
223
|
}
|
|
221
|
-
else if (this.
|
|
224
|
+
else if (this.streamMuxers.size > 0) {
|
|
222
225
|
// Multiplex the connection
|
|
223
226
|
const multiplexed = await this._multiplexOutbound({
|
|
224
227
|
...protectedConn,
|
|
225
228
|
...encryptedConn
|
|
226
|
-
}, this.
|
|
229
|
+
}, this.streamMuxers);
|
|
227
230
|
muxerFactory = multiplexed.muxerFactory;
|
|
228
231
|
upgradedConn = multiplexed.stream;
|
|
229
232
|
}
|
|
@@ -242,14 +245,14 @@ export class DefaultUpgrader {
|
|
|
242
245
|
upgradedConn,
|
|
243
246
|
muxerFactory,
|
|
244
247
|
remotePeer,
|
|
245
|
-
|
|
248
|
+
limits: opts?.limits
|
|
246
249
|
});
|
|
247
250
|
}
|
|
248
251
|
/**
|
|
249
252
|
* A convenience method for generating a new `Connection`
|
|
250
253
|
*/
|
|
251
254
|
_createConnection(opts) {
|
|
252
|
-
const { cryptoProtocol, direction, maConn, upgradedConn, remotePeer, muxerFactory,
|
|
255
|
+
const { cryptoProtocol, direction, maConn, upgradedConn, remotePeer, muxerFactory, limits } = opts;
|
|
253
256
|
let muxer;
|
|
254
257
|
let newStream;
|
|
255
258
|
let connection; // eslint-disable-line prefer-const
|
|
@@ -276,7 +279,7 @@ export class DefaultUpgrader {
|
|
|
276
279
|
const incomingLimit = findIncomingStreamLimit(protocol, this.components.registrar);
|
|
277
280
|
const streamCount = countStreams(protocol, 'inbound', connection);
|
|
278
281
|
if (streamCount === incomingLimit) {
|
|
279
|
-
const err = new
|
|
282
|
+
const err = new TooManyInboundProtocolStreamsError(`Too many inbound protocol streams for protocol "${protocol}" - limit ${incomingLimit}`);
|
|
280
283
|
muxedStream.abort(err);
|
|
281
284
|
throw err;
|
|
282
285
|
}
|
|
@@ -315,7 +318,7 @@ export class DefaultUpgrader {
|
|
|
315
318
|
});
|
|
316
319
|
newStream = async (protocols, options = {}) => {
|
|
317
320
|
if (muxer == null) {
|
|
318
|
-
throw new
|
|
321
|
+
throw new MuxerUnavailableError('Connection is not multiplexed');
|
|
319
322
|
}
|
|
320
323
|
connection.log('starting new stream for protocols %s', protocols);
|
|
321
324
|
const muxedStream = await muxer.newStream();
|
|
@@ -340,7 +343,7 @@ export class DefaultUpgrader {
|
|
|
340
343
|
const outgoingLimit = findOutgoingStreamLimit(protocol, this.components.registrar, options);
|
|
341
344
|
const streamCount = countStreams(protocol, 'outbound', connection);
|
|
342
345
|
if (streamCount >= outgoingLimit) {
|
|
343
|
-
const err = new
|
|
346
|
+
const err = new TooManyOutboundProtocolStreamsError(`Too many outbound protocol streams for protocol "${protocol}" - ${streamCount}/${outgoingLimit}`);
|
|
344
347
|
muxedStream.abort(err);
|
|
345
348
|
throw err;
|
|
346
349
|
}
|
|
@@ -374,10 +377,7 @@ export class DefaultUpgrader {
|
|
|
374
377
|
if (muxedStream.timeline.close == null) {
|
|
375
378
|
muxedStream.abort(err);
|
|
376
379
|
}
|
|
377
|
-
|
|
378
|
-
throw err;
|
|
379
|
-
}
|
|
380
|
-
throw new CodeError(String(err), codes.ERR_UNSUPPORTED_PROTOCOL);
|
|
380
|
+
throw err;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
// Pipe all data through the muxer
|
|
@@ -416,7 +416,7 @@ export class DefaultUpgrader {
|
|
|
416
416
|
});
|
|
417
417
|
maConn.timeline.upgraded = Date.now();
|
|
418
418
|
const errConnectionNotMultiplexed = () => {
|
|
419
|
-
throw new
|
|
419
|
+
throw new MuxerUnavailableError('Connection is not multiplexed');
|
|
420
420
|
};
|
|
421
421
|
// Create the connection
|
|
422
422
|
connection = createConnection({
|
|
@@ -427,7 +427,7 @@ export class DefaultUpgrader {
|
|
|
427
427
|
timeline: maConn.timeline,
|
|
428
428
|
multiplexer: muxer?.protocol,
|
|
429
429
|
encryption: cryptoProtocol,
|
|
430
|
-
|
|
430
|
+
limits,
|
|
431
431
|
logger: this.components.logger,
|
|
432
432
|
newStream: newStream ?? errConnectionNotMultiplexed,
|
|
433
433
|
getStreams: () => { if (muxer != null) {
|
|
@@ -466,42 +466,42 @@ export class DefaultUpgrader {
|
|
|
466
466
|
_onStream(opts) {
|
|
467
467
|
const { connection, stream, protocol } = opts;
|
|
468
468
|
const { handler, options } = this.components.registrar.getHandler(protocol);
|
|
469
|
-
if (connection.
|
|
470
|
-
throw new
|
|
469
|
+
if (connection.limits != null && options.runOnLimitedConnection !== true) {
|
|
470
|
+
throw new LimitedConnectionError('Cannot open protocol stream on limited connection');
|
|
471
471
|
}
|
|
472
472
|
handler({ connection, stream });
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
475
|
* Attempts to encrypt the incoming `connection` with the provided `cryptos`
|
|
476
476
|
*/
|
|
477
|
-
async _encryptInbound(connection) {
|
|
478
|
-
const protocols = Array.from(this.
|
|
477
|
+
async _encryptInbound(connection, options) {
|
|
478
|
+
const protocols = Array.from(this.connectionEncrypters.keys());
|
|
479
479
|
connection.log('handling inbound crypto protocol selection', protocols);
|
|
480
480
|
try {
|
|
481
481
|
const { stream, protocol } = await mss.handle(connection, protocols, {
|
|
482
482
|
log: connection.log
|
|
483
483
|
});
|
|
484
|
-
const encrypter = this.
|
|
484
|
+
const encrypter = this.connectionEncrypters.get(protocol);
|
|
485
485
|
if (encrypter == null) {
|
|
486
486
|
throw new Error(`no crypto module found for ${protocol}`);
|
|
487
487
|
}
|
|
488
488
|
connection.log('encrypting inbound connection using', protocol);
|
|
489
489
|
return {
|
|
490
|
-
...await encrypter.secureInbound(
|
|
490
|
+
...await encrypter.secureInbound(stream, options),
|
|
491
491
|
protocol
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
494
|
catch (err) {
|
|
495
495
|
connection.log.error('encrypting inbound connection failed', err);
|
|
496
|
-
throw new
|
|
496
|
+
throw new EncryptionFailedError(err.message);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
/**
|
|
500
500
|
* Attempts to encrypt the given `connection` with the provided connection encrypters.
|
|
501
501
|
* The first `ConnectionEncrypter` module to succeed will be used
|
|
502
502
|
*/
|
|
503
|
-
async _encryptOutbound(connection,
|
|
504
|
-
const protocols = Array.from(this.
|
|
503
|
+
async _encryptOutbound(connection, options) {
|
|
504
|
+
const protocols = Array.from(this.connectionEncrypters.keys());
|
|
505
505
|
connection.log('selecting outbound crypto protocol', protocols);
|
|
506
506
|
try {
|
|
507
507
|
connection.log.trace('selecting encrypter from %s', protocols);
|
|
@@ -509,19 +509,19 @@ export class DefaultUpgrader {
|
|
|
509
509
|
log: connection.log,
|
|
510
510
|
yieldBytes: true
|
|
511
511
|
});
|
|
512
|
-
const encrypter = this.
|
|
512
|
+
const encrypter = this.connectionEncrypters.get(protocol);
|
|
513
513
|
if (encrypter == null) {
|
|
514
514
|
throw new Error(`no crypto module found for ${protocol}`);
|
|
515
515
|
}
|
|
516
|
-
connection.log('encrypting outbound connection to %p using %s',
|
|
516
|
+
connection.log('encrypting outbound connection to %p using %s', options?.remotePeer, encrypter);
|
|
517
517
|
return {
|
|
518
|
-
...await encrypter.secureOutbound(
|
|
518
|
+
...await encrypter.secureOutbound(stream, options),
|
|
519
519
|
protocol
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
522
|
catch (err) {
|
|
523
|
-
connection.log.error('encrypting outbound connection to %p failed',
|
|
524
|
-
throw new
|
|
523
|
+
connection.log.error('encrypting outbound connection to %p failed', options?.remotePeer, err);
|
|
524
|
+
throw new EncryptionFailedError(err.message);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
/**
|
|
@@ -543,7 +543,7 @@ export class DefaultUpgrader {
|
|
|
543
543
|
}
|
|
544
544
|
catch (err) {
|
|
545
545
|
connection.log.error('error multiplexing outbound connection', err);
|
|
546
|
-
throw new
|
|
546
|
+
throw new MuxerUnavailableError(String(err));
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
/**
|
|
@@ -562,7 +562,7 @@ export class DefaultUpgrader {
|
|
|
562
562
|
}
|
|
563
563
|
catch (err) {
|
|
564
564
|
connection.log.error('error multiplexing inbound connection', err);
|
|
565
|
-
throw new
|
|
565
|
+
throw new MuxerUnavailableError(String(err));
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}
|
package/dist/src/upgrader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAI1F,MAAM,+BAA+B,GAAG,KAAK,CAAA;AAiC7C,SAAS,uBAAuB,CAAE,QAAgB,EAAE,SAAoB;IACtE,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAElD,OAAO,OAAO,CAAC,iBAAiB,CAAA;IAClC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,2BAA2B,EAAE,CAAC;YACnD,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC;IAED,OAAO,2BAA2B,CAAA;AACpC,CAAC;AAED,SAAS,uBAAuB,CAAE,QAAgB,EAAE,SAAoB,EAAE,UAA4B,EAAE;IACtG,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAElD,IAAI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/F,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QAC3C,UAAU,CAAC,GAAG,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAA;QACvD,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE;gBACnE,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAC,CAAA;YACF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAEzC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA;QACjC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAA;YAClE,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;CACF"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAoB,CAAA;AACxC,eAAO,MAAM,IAAI,WAAW,CAAA"}
|
package/dist/src/version.js
CHANGED
package/dist/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAA;AACxC,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libp2p",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-7cd984569",
|
|
4
4
|
"description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme",
|
|
@@ -85,42 +85,42 @@
|
|
|
85
85
|
"test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@libp2p/crypto": "
|
|
89
|
-
"@libp2p/interface": "
|
|
90
|
-
"@libp2p/interface-internal": "
|
|
91
|
-
"@libp2p/logger": "
|
|
92
|
-
"@libp2p/multistream-select": "
|
|
93
|
-
"@libp2p/peer-collections": "
|
|
94
|
-
"@libp2p/peer-id": "
|
|
95
|
-
"@libp2p/peer-
|
|
96
|
-
"@libp2p/
|
|
97
|
-
"@libp2p/utils": "^5.4.9",
|
|
88
|
+
"@libp2p/crypto": "5.0.0-7cd984569",
|
|
89
|
+
"@libp2p/interface": "2.0.0-7cd984569",
|
|
90
|
+
"@libp2p/interface-internal": "2.0.0-7cd984569",
|
|
91
|
+
"@libp2p/logger": "5.0.0-7cd984569",
|
|
92
|
+
"@libp2p/multistream-select": "6.0.0-7cd984569",
|
|
93
|
+
"@libp2p/peer-collections": "6.0.0-7cd984569",
|
|
94
|
+
"@libp2p/peer-id": "5.0.0-7cd984569",
|
|
95
|
+
"@libp2p/peer-store": "11.0.0-7cd984569",
|
|
96
|
+
"@libp2p/utils": "6.0.0-7cd984569",
|
|
98
97
|
"@multiformats/dns": "^1.0.6",
|
|
99
98
|
"@multiformats/multiaddr": "^12.2.3",
|
|
100
99
|
"@multiformats/multiaddr-matcher": "^1.2.1",
|
|
101
100
|
"any-signal": "^4.1.1",
|
|
102
|
-
"datastore-core": "^
|
|
103
|
-
"interface-datastore": "^8.
|
|
101
|
+
"datastore-core": "^10.0.0",
|
|
102
|
+
"interface-datastore": "^8.3.0",
|
|
104
103
|
"it-byte-stream": "^1.0.12",
|
|
105
104
|
"it-merge": "^3.0.5",
|
|
106
105
|
"it-parallel": "^3.0.7",
|
|
107
106
|
"merge-options": "^3.0.4",
|
|
108
107
|
"multiformats": "^13.1.0",
|
|
109
108
|
"p-defer": "^4.0.1",
|
|
109
|
+
"p-retry": "^6.2.0",
|
|
110
110
|
"progress-events": "^1.0.0",
|
|
111
111
|
"race-event": "^1.3.0",
|
|
112
112
|
"race-signal": "^1.0.2",
|
|
113
113
|
"uint8arrays": "^5.1.0"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@chainsafe/libp2p-yamux": "^
|
|
117
|
-
"@libp2p/circuit-relay-v2": "
|
|
118
|
-
"@libp2p/identify": "
|
|
119
|
-
"@libp2p/interface-compliance-tests": "
|
|
120
|
-
"@libp2p/mplex": "
|
|
121
|
-
"@libp2p/plaintext": "
|
|
122
|
-
"@libp2p/tcp": "
|
|
123
|
-
"@libp2p/websockets": "
|
|
116
|
+
"@chainsafe/libp2p-yamux": "^7.0.0",
|
|
117
|
+
"@libp2p/circuit-relay-v2": "2.0.0-7cd984569",
|
|
118
|
+
"@libp2p/identify": "3.0.0-7cd984569",
|
|
119
|
+
"@libp2p/interface-compliance-tests": "6.0.0-7cd984569",
|
|
120
|
+
"@libp2p/mplex": "11.0.0-7cd984569",
|
|
121
|
+
"@libp2p/plaintext": "2.0.0-7cd984569",
|
|
122
|
+
"@libp2p/tcp": "10.0.0-7cd984569",
|
|
123
|
+
"@libp2p/websockets": "9.0.0-7cd984569",
|
|
124
124
|
"@multiformats/mafmt": "^12.1.6",
|
|
125
125
|
"aegir": "^44.0.1",
|
|
126
126
|
"delay": "^6.0.0",
|
package/src/components.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { serviceCapabilities, serviceDependencies } from '@libp2p/interface'
|
|
2
2
|
import { isStartable, type Startable, type Libp2pEvents, type ComponentLogger, type NodeInfo, type ConnectionProtector, type ConnectionGater, type ContentRouting, type TypedEventTarget, type Metrics, type PeerId, type PeerRouting, type PeerStore, type PrivateKey, type Upgrader } from '@libp2p/interface'
|
|
3
3
|
import { defaultLogger } from '@libp2p/logger'
|
|
4
|
+
import { MissingServiceError, UnmetServiceDependenciesError } from './errors.js'
|
|
4
5
|
import type { AddressManager, ConnectionManager, RandomWalk, Registrar, TransportManager } from '@libp2p/interface-internal'
|
|
5
6
|
import type { DNS } from '@multiformats/dns'
|
|
6
7
|
import type { Datastore } from 'interface-datastore'
|
|
@@ -134,7 +135,7 @@ export function defaultComponents (init: ComponentsInit = {}): Components {
|
|
|
134
135
|
const service = components.components[prop]
|
|
135
136
|
|
|
136
137
|
if (service == null && !OPTIONAL_SERVICES.includes(prop)) {
|
|
137
|
-
throw new
|
|
138
|
+
throw new MissingServiceError(`${prop} not set`)
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
return service
|
|
@@ -170,7 +171,7 @@ export function checkServiceDependencies (components: Components): void {
|
|
|
170
171
|
for (const service of Object.values(components.components)) {
|
|
171
172
|
for (const capability of getServiceDependencies(service)) {
|
|
172
173
|
if (serviceCapabilities[capability] !== true) {
|
|
173
|
-
throw new
|
|
174
|
+
throw new UnmetServiceDependenciesError(`Service "${getServiceName(service)}" required capability "${capability}" but it was not provided by any component, you may need to add additional configuration when creating your node.`)
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
}
|
package/src/config.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { peerIdFromKeys } from '@libp2p/peer-id'
|
|
1
|
+
import { FaultTolerance, InvalidParametersError } from '@libp2p/interface'
|
|
3
2
|
import { defaultAddressSort } from '@libp2p/utils/address-sort'
|
|
4
3
|
import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'
|
|
5
4
|
import mergeOptions from 'merge-options'
|
|
6
|
-
import { codes, messages } from './errors.js'
|
|
7
5
|
import type { Libp2pInit } from './index.js'
|
|
8
6
|
import type { ServiceMap } from '@libp2p/interface'
|
|
9
7
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -26,15 +24,11 @@ const DefaultConfig: Libp2pInit = {
|
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
export async function validateConfig <T extends ServiceMap = Record<string, unknown>> (opts: Libp2pInit<T>): Promise<Libp2pInit<T
|
|
30
|
-
const resultingOptions: Libp2pInit<T>
|
|
27
|
+
export async function validateConfig <T extends ServiceMap = Record<string, unknown>> (opts: Libp2pInit<T>): Promise<Libp2pInit<T>> {
|
|
28
|
+
const resultingOptions: Libp2pInit<T> = mergeOptions(DefaultConfig, opts)
|
|
31
29
|
|
|
32
30
|
if (resultingOptions.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { // eslint-disable-line no-undef
|
|
33
|
-
throw new
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (resultingOptions.privateKey != null && !(await peerIdFromKeys(resultingOptions.privateKey.public.bytes, resultingOptions.privateKey.bytes)).equals(resultingOptions.peerId)) {
|
|
37
|
-
throw new CodeError('Private key doesn\'t match peer id', codes.ERR_INVALID_KEY)
|
|
31
|
+
throw new InvalidParametersError('Private network is enforced, but no protector was provided')
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
return resultingOptions
|
package/src/connection/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { connectionSymbol,
|
|
2
|
-
import type { AbortOptions, Logger, ComponentLogger, Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions, PeerId } from '@libp2p/interface'
|
|
1
|
+
import { connectionSymbol, setMaxListeners, LimitedConnectionError, ConnectionClosedError, ConnectionClosingError } from '@libp2p/interface'
|
|
2
|
+
import type { AbortOptions, Logger, ComponentLogger, Direction, Connection, Stream, ConnectionTimeline, ConnectionStatus, NewStreamOptions, PeerId, ConnectionLimits } from '@libp2p/interface'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
5
5
|
const CLOSE_TIMEOUT = 500
|
|
@@ -16,7 +16,7 @@ interface ConnectionInit {
|
|
|
16
16
|
timeline: ConnectionTimeline
|
|
17
17
|
multiplexer?: string
|
|
18
18
|
encryption?: string
|
|
19
|
-
|
|
19
|
+
limits?: ConnectionLimits
|
|
20
20
|
logger: ComponentLogger
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -45,7 +45,7 @@ export class ConnectionImpl implements Connection {
|
|
|
45
45
|
public multiplexer?: string
|
|
46
46
|
public encryption?: string
|
|
47
47
|
public status: ConnectionStatus
|
|
48
|
-
public
|
|
48
|
+
public limits?: ConnectionLimits
|
|
49
49
|
public readonly log: Logger
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -86,7 +86,7 @@ export class ConnectionImpl implements Connection {
|
|
|
86
86
|
this.timeline = init.timeline
|
|
87
87
|
this.multiplexer = init.multiplexer
|
|
88
88
|
this.encryption = init.encryption
|
|
89
|
-
this.
|
|
89
|
+
this.limits = init.limits
|
|
90
90
|
this.log = init.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`)
|
|
91
91
|
|
|
92
92
|
if (this.remoteAddr.getPeerId() == null) {
|
|
@@ -116,19 +116,19 @@ export class ConnectionImpl implements Connection {
|
|
|
116
116
|
*/
|
|
117
117
|
async newStream (protocols: string | string[], options?: NewStreamOptions): Promise<Stream> {
|
|
118
118
|
if (this.status === 'closing') {
|
|
119
|
-
throw new
|
|
119
|
+
throw new ConnectionClosingError('the connection is being closed')
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
if (this.status === 'closed') {
|
|
123
|
-
throw new
|
|
123
|
+
throw new ConnectionClosedError('the connection is closed')
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
if (!Array.isArray(protocols)) {
|
|
127
127
|
protocols = [protocols]
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
if (this.
|
|
131
|
-
throw new
|
|
130
|
+
if (this.limits != null && options?.runOnLimitedConnection !== true) {
|
|
131
|
+
throw new LimitedConnectionError('Cannot open protocol stream on limited connection')
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
const stream = await this._newStream(protocols, options)
|