libp2p 0.45.0-752db6d6 → 0.45.0-e93d258d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -30
- package/dist/index.min.js +26 -26
- package/dist/src/address-manager/index.d.ts +3 -3
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/address-manager/index.js +8 -2
- package/dist/src/address-manager/index.js.map +1 -1
- package/dist/src/autonat/index.d.ts +1 -1
- package/dist/src/autonat/index.d.ts.map +1 -1
- package/dist/src/autonat/index.js +13 -4
- package/dist/src/autonat/index.js.map +1 -1
- package/dist/src/circuit-relay/index.d.ts +1 -1
- package/dist/src/circuit-relay/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/advert-service.d.ts +2 -2
- package/dist/src/circuit-relay/server/advert-service.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/advert-service.js +7 -3
- package/dist/src/circuit-relay/server/advert-service.js.map +1 -1
- package/dist/src/circuit-relay/server/index.d.ts +8 -8
- package/dist/src/circuit-relay/server/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/index.js +23 -10
- package/dist/src/circuit-relay/server/index.js.map +1 -1
- package/dist/src/circuit-relay/server/reservation-store.d.ts +5 -5
- package/dist/src/circuit-relay/server/reservation-store.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/reservation-store.js +10 -3
- package/dist/src/circuit-relay/server/reservation-store.js.map +1 -1
- package/dist/src/circuit-relay/server/reservation-voucher.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/reservation-voucher.js +5 -2
- package/dist/src/circuit-relay/server/reservation-voucher.js.map +1 -1
- package/dist/src/circuit-relay/transport/discovery.d.ts +4 -4
- package/dist/src/circuit-relay/transport/discovery.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/discovery.js +9 -3
- package/dist/src/circuit-relay/transport/discovery.js.map +1 -1
- package/dist/src/circuit-relay/transport/index.d.ts +8 -9
- package/dist/src/circuit-relay/transport/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/index.js +20 -14
- package/dist/src/circuit-relay/transport/index.js.map +1 -1
- package/dist/src/circuit-relay/transport/listener.d.ts +1 -1
- package/dist/src/circuit-relay/transport/listener.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/listener.js +15 -19
- package/dist/src/circuit-relay/transport/listener.js.map +1 -1
- package/dist/src/circuit-relay/transport/reservation-store.d.ts +5 -5
- package/dist/src/circuit-relay/transport/reservation-store.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/reservation-store.js +55 -49
- package/dist/src/circuit-relay/transport/reservation-store.js.map +1 -1
- package/dist/src/circuit-relay/utils.d.ts.map +1 -1
- package/dist/src/circuit-relay/utils.js +3 -3
- package/dist/src/circuit-relay/utils.js.map +1 -1
- package/dist/src/components.d.ts +6 -6
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/components.js +2 -2
- package/dist/src/components.js.map +1 -1
- package/dist/src/config/connection-gater.browser.d.ts.map +1 -1
- package/dist/src/config/connection-gater.browser.js.map +1 -1
- package/dist/src/config.d.ts +2 -2
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +4 -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 +38 -8
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/connection-manager/auto-dial.d.ts +3 -3
- package/dist/src/connection-manager/auto-dial.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dial.js +9 -1
- package/dist/src/connection-manager/auto-dial.js.map +1 -1
- package/dist/src/connection-manager/connection-pruner.d.ts +2 -2
- package/dist/src/connection-manager/connection-pruner.d.ts.map +1 -1
- package/dist/src/connection-manager/connection-pruner.js +5 -0
- package/dist/src/connection-manager/connection-pruner.js.map +1 -1
- package/dist/src/connection-manager/dial-queue.d.ts +6 -6
- package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
- package/dist/src/connection-manager/dial-queue.js +25 -11
- package/dist/src/connection-manager/dial-queue.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +12 -12
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js +21 -7
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/connection-manager/utils.d.ts +2 -3
- package/dist/src/connection-manager/utils.d.ts.map +1 -1
- package/dist/src/connection-manager/utils.js +3 -3
- package/dist/src/connection-manager/utils.js.map +1 -1
- package/dist/src/content-routing/index.d.ts +2 -2
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/content-routing/index.js +7 -4
- package/dist/src/content-routing/index.js.map +1 -1
- package/dist/src/content-routing/utils.d.ts +1 -1
- package/dist/src/content-routing/utils.d.ts.map +1 -1
- package/dist/src/fetch/index.d.ts +2 -2
- package/dist/src/fetch/index.d.ts.map +1 -1
- package/dist/src/fetch/index.js +12 -7
- package/dist/src/fetch/index.js.map +1 -1
- package/dist/src/get-peer.d.ts +1 -1
- package/dist/src/get-peer.d.ts.map +1 -1
- package/dist/src/get-peer.js +3 -3
- package/dist/src/get-peer.js.map +1 -1
- package/dist/src/identify/identify.d.ts +3 -3
- package/dist/src/identify/identify.d.ts.map +1 -1
- package/dist/src/identify/identify.js +91 -81
- package/dist/src/identify/identify.js.map +1 -1
- package/dist/src/identify/index.d.ts +5 -4
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/identify/index.js +1 -1
- package/dist/src/identify/index.js.map +1 -1
- package/dist/src/index.d.ts +19 -15
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/insecure/index.js +6 -8
- package/dist/src/insecure/index.js.map +1 -1
- package/dist/src/libp2p.d.ts +11 -11
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +58 -59
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/peer-routing.d.ts +2 -2
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-routing.js +8 -6
- package/dist/src/peer-routing.js.map +1 -1
- package/dist/src/ping/index.d.ts +2 -2
- package/dist/src/ping/index.d.ts.map +1 -1
- package/dist/src/ping/index.js +14 -8
- package/dist/src/ping/index.js.map +1 -1
- package/dist/src/pnet/crypto.js +3 -3
- package/dist/src/pnet/crypto.js.map +1 -1
- package/dist/src/pnet/index.d.ts.map +1 -1
- package/dist/src/pnet/index.js +9 -6
- package/dist/src/pnet/index.js.map +1 -1
- package/dist/src/pnet/key-generator.js +1 -1
- package/dist/src/pnet/key-generator.js.map +1 -1
- package/dist/src/pubsub/dummy-pubsub.d.ts.map +1 -1
- package/dist/src/pubsub/dummy-pubsub.js +2 -5
- package/dist/src/pubsub/dummy-pubsub.js.map +1 -1
- package/dist/src/registrar.d.ts +3 -4
- package/dist/src/registrar.d.ts.map +1 -1
- package/dist/src/registrar.js +6 -3
- package/dist/src/registrar.js.map +1 -1
- package/dist/src/transport-manager.d.ts +5 -5
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/transport-manager.js +8 -3
- 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 +11 -6
- package/dist/src/upgrader.js.map +1 -1
- package/dist/src/upnp-nat/index.d.ts +32 -3
- package/dist/src/upnp-nat/index.d.ts.map +1 -1
- package/dist/src/upnp-nat/index.js +13 -4
- package/dist/src/upnp-nat/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +4 -5
- package/src/address-manager/index.ts +6 -6
- package/src/autonat/index.ts +14 -14
- package/src/circuit-relay/index.ts +1 -1
- package/src/circuit-relay/server/advert-service.ts +4 -4
- package/src/circuit-relay/server/index.ts +18 -18
- package/src/circuit-relay/server/reservation-store.ts +5 -5
- package/src/circuit-relay/server/reservation-voucher.ts +1 -1
- package/src/circuit-relay/transport/discovery.ts +7 -7
- package/src/circuit-relay/transport/index.ts +18 -23
- package/src/circuit-relay/transport/listener.ts +8 -8
- package/src/circuit-relay/transport/reservation-store.ts +10 -10
- package/src/circuit-relay/utils.ts +6 -6
- package/src/components.ts +6 -6
- package/src/config/connection-gater.browser.ts +1 -1
- package/src/config.ts +8 -12
- package/src/connection/index.ts +6 -10
- package/src/connection-manager/auto-dial.ts +5 -5
- package/src/connection-manager/connection-pruner.ts +4 -4
- package/src/connection-manager/dial-queue.ts +18 -17
- package/src/connection-manager/index.ts +18 -18
- package/src/connection-manager/utils.ts +4 -5
- package/src/content-routing/index.ts +6 -6
- package/src/content-routing/utils.ts +1 -1
- package/src/fetch/index.ts +12 -12
- package/src/get-peer.ts +4 -4
- package/src/identify/identify.ts +20 -20
- package/src/identify/index.ts +6 -6
- package/src/index.ts +15 -15
- package/src/insecure/index.ts +6 -6
- package/src/libp2p.ts +35 -35
- package/src/peer-routing.ts +9 -9
- package/src/ping/index.ts +12 -12
- package/src/pnet/crypto.ts +3 -3
- package/src/pnet/index.ts +6 -6
- package/src/pnet/key-generator.ts +1 -1
- package/src/pubsub/dummy-pubsub.ts +2 -2
- package/src/registrar.ts +5 -6
- package/src/transport-manager.ts +8 -8
- package/src/upgrader.ts +17 -17
- package/src/upnp-nat/index.ts +9 -9
- package/src/version.ts +1 -1
package/src/registrar.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isTopology, type StreamHandlerOptions, type StreamHandlerRecord, type Registrar, type StreamHandler, type Topology } from '@libp2p/interface-registrar'
|
|
2
2
|
import { CodeError } from '@libp2p/interfaces/errors'
|
|
3
|
-
import {
|
|
4
|
-
import { isTopology, StreamHandlerOptions, StreamHandlerRecord } from '@libp2p/interface-registrar'
|
|
3
|
+
import { logger } from '@libp2p/logger'
|
|
5
4
|
import merge from 'merge-options'
|
|
6
|
-
import
|
|
7
|
-
import type { PeerStore } from '@libp2p/interface-peer-store'
|
|
5
|
+
import { codes } from './errors.js'
|
|
8
6
|
import type { Connection } from '@libp2p/interface-connection'
|
|
9
7
|
import type { ConnectionManager } from '@libp2p/interface-connection-manager'
|
|
8
|
+
import type { Libp2pEvents, PeerUpdate } from '@libp2p/interface-libp2p'
|
|
10
9
|
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
10
|
+
import type { PeerStore } from '@libp2p/interface-peer-store'
|
|
11
11
|
import type { EventEmitter } from '@libp2p/interfaces/events'
|
|
12
|
-
import type { Libp2pEvents, PeerUpdate } from '@libp2p/interface-libp2p'
|
|
13
12
|
|
|
14
13
|
const log = logger('libp2p:registrar')
|
|
15
14
|
|
package/src/transport-manager.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { FaultTolerance } from '@libp2p/interface-transport'
|
|
2
|
+
import { CodeError } from '@libp2p/interfaces/errors'
|
|
1
3
|
import { logger } from '@libp2p/logger'
|
|
4
|
+
import { trackedMap } from '@libp2p/tracked-map'
|
|
2
5
|
import { codes } from './errors.js'
|
|
3
|
-
import {
|
|
4
|
-
import { FaultTolerance } from '@libp2p/interface-transport'
|
|
5
|
-
import type { Listener, Transport, TransportManager, Upgrader } from '@libp2p/interface-transport'
|
|
6
|
-
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
6
|
+
import type { AddressManager } from '@libp2p/interface-address-manager'
|
|
7
7
|
import type { Connection } from '@libp2p/interface-connection'
|
|
8
|
+
import type { Libp2pEvents } from '@libp2p/interface-libp2p'
|
|
9
|
+
import type { Metrics } from '@libp2p/interface-metrics'
|
|
10
|
+
import type { Listener, Transport, TransportManager, Upgrader } from '@libp2p/interface-transport'
|
|
8
11
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
9
12
|
import type { EventEmitter } from '@libp2p/interfaces/events'
|
|
10
13
|
import type { Startable } from '@libp2p/interfaces/startable'
|
|
11
|
-
import {
|
|
12
|
-
import type { Metrics } from '@libp2p/interface-metrics'
|
|
13
|
-
import type { AddressManager } from '@libp2p/interface-address-manager'
|
|
14
|
-
import type { Libp2pEvents } from '@libp2p/interface-libp2p'
|
|
14
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
15
15
|
|
|
16
16
|
const log = logger('libp2p:transports')
|
|
17
17
|
|
package/src/upgrader.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { setMaxListeners } from 'events'
|
|
2
2
|
import { CodeError } from '@libp2p/interfaces/errors'
|
|
3
|
+
import { logger } from '@libp2p/logger'
|
|
3
4
|
import * as mss from '@libp2p/multistream-select'
|
|
4
|
-
import { codes } from './errors.js'
|
|
5
|
-
import { createConnection } from './connection/index.js'
|
|
6
|
-
import type { EventEmitter } from '@libp2p/interfaces/events'
|
|
7
5
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
6
|
+
import { abortableDuplex } from 'abortable-iterator'
|
|
7
|
+
import { anySignal } from 'any-signal'
|
|
8
|
+
import { createConnection } from './connection/index.js'
|
|
9
|
+
import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js'
|
|
10
|
+
import { codes } from './errors.js'
|
|
11
|
+
import { DEFAULT_MAX_INBOUND_STREAMS, DEFAULT_MAX_OUTBOUND_STREAMS } from './registrar.js'
|
|
8
12
|
import type { MultiaddrConnection, Connection, Stream, ConnectionProtector } from '@libp2p/interface-connection'
|
|
9
13
|
import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface-connection-encrypter'
|
|
10
|
-
import type {
|
|
14
|
+
import type { ConnectionGater } from '@libp2p/interface-connection-gater'
|
|
15
|
+
import type { ConnectionManager } from '@libp2p/interface-connection-manager'
|
|
16
|
+
import type { Libp2pEvents } from '@libp2p/interface-libp2p'
|
|
17
|
+
import type { Metrics } from '@libp2p/interface-metrics'
|
|
11
18
|
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
19
|
+
import type { PeerStore } from '@libp2p/interface-peer-store'
|
|
20
|
+
import type { Registrar } from '@libp2p/interface-registrar'
|
|
21
|
+
import type { StreamMuxer, StreamMuxerFactory } from '@libp2p/interface-stream-muxer'
|
|
12
22
|
import type { Upgrader, UpgraderOptions } from '@libp2p/interface-transport'
|
|
13
|
-
import type { Duplex, Source } from 'it-stream-types'
|
|
14
23
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
15
|
-
import type {
|
|
16
|
-
import {
|
|
17
|
-
import { abortableDuplex } from 'abortable-iterator'
|
|
18
|
-
import { setMaxListeners } from 'events'
|
|
19
|
-
import type { Metrics } from '@libp2p/interface-metrics'
|
|
20
|
-
import type { ConnectionManager } from '@libp2p/interface-connection-manager'
|
|
21
|
-
import type { PeerStore } from '@libp2p/interface-peer-store'
|
|
22
|
-
import type { ConnectionGater } from '@libp2p/interface-connection-gater'
|
|
23
|
-
import { INBOUND_UPGRADE_TIMEOUT } from './connection-manager/constants.js'
|
|
24
|
-
import { anySignal } from 'any-signal'
|
|
25
|
-
import type { Libp2pEvents } from '@libp2p/interface-libp2p'
|
|
24
|
+
import type { EventEmitter } from '@libp2p/interfaces/events'
|
|
25
|
+
import type { Duplex, Source } from 'it-stream-types'
|
|
26
26
|
|
|
27
27
|
const log = logger('libp2p:upgrader')
|
|
28
28
|
|
package/src/upnp-nat/index.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { upnpNat, NatAPI } from '@achingbrain/nat-port-mapper'
|
|
1
|
+
import { upnpNat, type NatAPI } from '@achingbrain/nat-port-mapper'
|
|
2
|
+
import { CodeError } from '@libp2p/interfaces/errors'
|
|
2
3
|
import { logger } from '@libp2p/logger'
|
|
4
|
+
import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback'
|
|
3
5
|
import { fromNodeAddress } from '@multiformats/multiaddr'
|
|
4
|
-
import { isBrowser } from 'wherearewe'
|
|
5
6
|
import isPrivateIp from 'private-ip'
|
|
6
|
-
import
|
|
7
|
-
import { CodeError } from '@libp2p/interfaces/errors'
|
|
7
|
+
import { isBrowser } from 'wherearewe'
|
|
8
8
|
import { codes } from '../errors.js'
|
|
9
|
-
import
|
|
10
|
-
import type { Startable } from '@libp2p/interfaces/startable'
|
|
11
|
-
import type { TransportManager } from '@libp2p/interface-transport'
|
|
12
|
-
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
9
|
+
import * as pkg from '../version.js'
|
|
13
10
|
import type { AddressManager } from '@libp2p/interface-address-manager'
|
|
11
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
12
|
+
import type { TransportManager } from '@libp2p/interface-transport'
|
|
13
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
14
14
|
|
|
15
15
|
const log = logger('libp2p:upnp-nat')
|
|
16
16
|
const DEFAULT_TTL = 7200
|
|
@@ -205,7 +205,7 @@ class UPnPNAT implements Startable {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
export function uPnPNATService (init: UPnPNATInit = {}): (components: UPnPNATComponents) =>
|
|
208
|
+
export function uPnPNATService (init: UPnPNATInit = {}): (components: UPnPNATComponents) => UPnPNAT {
|
|
209
209
|
return (components: UPnPNATComponents) => {
|
|
210
210
|
return new UPnPNAT(components, init)
|
|
211
211
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '0.45.0-
|
|
1
|
+
export const version = '0.45.0-e93d258d'
|
|
2
2
|
export const name = 'libp2p'
|