libp2p 0.36.2-c64a586 → 0.36.2-da3d19b
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/address-manager/index.d.ts +2 -1
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/address-manager/index.js +1 -1
- package/dist/src/address-manager/index.js.map +1 -1
- package/dist/src/circuit/auto-relay.d.ts.map +1 -1
- package/dist/src/circuit/auto-relay.js +7 -6
- package/dist/src/circuit/auto-relay.js.map +1 -1
- package/dist/src/circuit/circuit/hop.d.ts +1 -1
- package/dist/src/circuit/circuit/hop.d.ts.map +1 -1
- package/dist/src/circuit/circuit/hop.js +4 -4
- package/dist/src/circuit/circuit/hop.js.map +1 -1
- package/dist/src/circuit/index.d.ts +1 -1
- package/dist/src/circuit/index.d.ts.map +1 -1
- package/dist/src/circuit/listener.d.ts +3 -3
- package/dist/src/circuit/listener.d.ts.map +1 -1
- package/dist/src/circuit/listener.js +10 -2
- package/dist/src/circuit/listener.js.map +1 -1
- package/dist/src/circuit/pb/index.d.ts +4 -4
- package/dist/src/circuit/pb/index.d.ts.map +1 -1
- package/dist/src/circuit/transport.d.ts.map +1 -1
- package/dist/src/circuit/transport.js +6 -4
- package/dist/src/circuit/transport.js.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +5 -7
- package/dist/src/config.js.map +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dialler.js +4 -4
- package/dist/src/connection-manager/auto-dialler.js.map +1 -1
- package/dist/src/{dialer → connection-manager/dialer}/auto-dialer.d.ts +2 -0
- package/dist/src/connection-manager/dialer/auto-dialer.d.ts.map +1 -0
- package/dist/src/connection-manager/dialer/auto-dialer.js +37 -0
- package/dist/src/connection-manager/dialer/auto-dialer.js.map +1 -0
- package/dist/src/{dialer → connection-manager/dialer}/dial-request.d.ts +2 -2
- package/dist/src/connection-manager/dialer/dial-request.d.ts.map +1 -0
- package/dist/src/{dialer → connection-manager/dialer}/dial-request.js +1 -1
- package/dist/src/connection-manager/dialer/dial-request.js.map +1 -0
- package/dist/src/{dialer → connection-manager/dialer}/index.d.ts +37 -8
- package/dist/src/connection-manager/dialer/index.d.ts.map +1 -0
- package/dist/src/{dialer → connection-manager/dialer}/index.js +10 -24
- package/dist/src/connection-manager/dialer/index.js.map +1 -0
- package/dist/src/connection-manager/index.d.ts +57 -26
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js +79 -41
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/connection-manager/latency-monitor.d.ts +1 -1
- package/dist/src/connection-manager/latency-monitor.d.ts.map +1 -1
- package/dist/src/connection-manager/latency-monitor.js +1 -1
- package/dist/src/connection-manager/latency-monitor.js.map +1 -1
- package/dist/src/connection-manager/visibility-change-emitter.d.ts +1 -1
- package/dist/src/connection-manager/visibility-change-emitter.d.ts.map +1 -1
- package/dist/src/connection-manager/visibility-change-emitter.js +1 -1
- package/dist/src/connection-manager/visibility-change-emitter.js.map +1 -1
- package/dist/src/content-routing/index.d.ts +2 -1
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/content-routing/index.js.map +1 -1
- package/dist/src/dht/dummy-dht.d.ts +17 -0
- package/dist/src/dht/dummy-dht.d.ts.map +1 -0
- package/dist/src/dht/dummy-dht.js +39 -0
- package/dist/src/dht/dummy-dht.js.map +1 -0
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/fetch/index.d.ts +1 -1
- package/dist/src/fetch/index.d.ts.map +1 -1
- package/dist/src/fetch/index.js +1 -1
- package/dist/src/fetch/index.js.map +1 -1
- package/dist/src/fetch/pb/proto.d.ts +3 -3
- package/dist/src/fetch/pb/proto.d.ts.map +1 -1
- package/dist/src/identify/index.d.ts +1 -1
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/identify/index.js +4 -4
- package/dist/src/identify/index.js.map +1 -1
- package/dist/src/identify/pb/message.d.ts +1 -1
- package/dist/src/identify/pb/message.d.ts.map +1 -1
- package/dist/src/index.d.ts +14 -26
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/insecure/pb/proto.d.ts +3 -3
- package/dist/src/insecure/pb/proto.d.ts.map +1 -1
- package/dist/src/keychain/index.d.ts +1 -1
- package/dist/src/libp2p.d.ts +7 -5
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +71 -46
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/metrics/index.d.ts +1 -1
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/dist/src/metrics/stats.d.ts +2 -6
- package/dist/src/metrics/stats.d.ts.map +1 -1
- package/dist/src/metrics/stats.js +1 -1
- package/dist/src/metrics/stats.js.map +1 -1
- package/dist/src/nat-manager.d.ts +1 -1
- package/dist/src/nat-manager.d.ts.map +1 -1
- package/dist/src/peer-record-updater.d.ts +1 -1
- package/dist/src/peer-record-updater.d.ts.map +1 -1
- package/dist/src/peer-routing.d.ts +2 -1
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-routing.js.map +1 -1
- package/dist/src/ping/index.d.ts +1 -1
- package/dist/src/ping/index.d.ts.map +1 -1
- package/dist/src/ping/index.js +2 -1
- package/dist/src/ping/index.js.map +1 -1
- package/dist/src/pubsub/dummy-pubsub.d.ts +17 -0
- package/dist/src/pubsub/dummy-pubsub.d.ts.map +1 -0
- package/dist/src/pubsub/dummy-pubsub.js +37 -0
- package/dist/src/pubsub/dummy-pubsub.js.map +1 -0
- package/dist/src/registrar.js +1 -1
- package/dist/src/registrar.js.map +1 -1
- package/dist/src/transport-manager.d.ts +3 -1
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/transport-manager.js +1 -1
- package/dist/src/transport-manager.js.map +1 -1
- package/dist/src/upgrader.d.ts +1 -1
- package/dist/src/upgrader.d.ts.map +1 -1
- package/dist/src/upgrader.js +1 -1
- package/dist/src/upgrader.js.map +1 -1
- package/package.json +26 -26
- package/src/address-manager/index.ts +2 -1
- package/src/circuit/auto-relay.ts +8 -6
- package/src/circuit/circuit/hop.ts +5 -5
- package/src/circuit/index.ts +1 -1
- package/src/circuit/listener.ts +18 -5
- package/src/circuit/transport.ts +7 -4
- package/src/config.ts +5 -7
- package/src/connection-manager/auto-dialler.ts +5 -5
- package/src/{dialer → connection-manager/dialer}/auto-dialer.ts +23 -4
- package/src/{dialer → connection-manager/dialer}/dial-request.ts +4 -4
- package/src/{dialer → connection-manager/dialer}/index.ts +48 -40
- package/src/connection-manager/index.ts +145 -59
- package/src/connection-manager/latency-monitor.ts +1 -1
- package/src/connection-manager/visibility-change-emitter.ts +1 -1
- package/src/content-routing/index.ts +2 -1
- package/src/dht/dummy-dht.ts +51 -0
- package/src/errors.ts +2 -0
- package/src/fetch/index.ts +2 -2
- package/src/identify/index.ts +5 -5
- package/src/index.ts +15 -31
- package/src/libp2p.ts +84 -55
- package/src/metrics/index.ts +1 -1
- package/src/metrics/stats.ts +2 -7
- package/src/nat-manager.ts +1 -1
- package/src/peer-record-updater.ts +1 -1
- package/src/peer-routing.ts +2 -1
- package/src/ping/index.ts +3 -2
- package/src/pubsub/dummy-pubsub.ts +51 -0
- package/src/registrar.ts +1 -1
- package/src/transport-manager.ts +3 -1
- package/src/upgrader.ts +1 -1
- package/dist/src/dialer/auto-dialer.d.ts.map +0 -1
- package/dist/src/dialer/auto-dialer.js +0 -24
- package/dist/src/dialer/auto-dialer.js.map +0 -1
- package/dist/src/dialer/dial-request.d.ts.map +0 -1
- package/dist/src/dialer/dial-request.js.map +0 -1
- package/dist/src/dialer/index.d.ts.map +0 -1
- package/dist/src/dialer/index.js.map +0 -1
package/src/identify/index.ts
CHANGED
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
import { codes } from '../errors.js'
|
|
23
23
|
import type { IncomingStreamData } from '@libp2p/interfaces/registrar'
|
|
24
24
|
import type { Connection } from '@libp2p/interfaces/connection'
|
|
25
|
-
import type { Startable } from '@libp2p/interfaces'
|
|
26
|
-
import { peerIdFromKeys
|
|
25
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
26
|
+
import { peerIdFromKeys } from '@libp2p/peer-id'
|
|
27
27
|
import type { Components } from '@libp2p/interfaces/components'
|
|
28
28
|
|
|
29
29
|
const log = logger('libp2p:identify')
|
|
@@ -161,15 +161,15 @@ export class IdentifyService implements Startable {
|
|
|
161
161
|
|
|
162
162
|
const connections: Connection[] = []
|
|
163
163
|
|
|
164
|
-
for (const
|
|
165
|
-
const peerId =
|
|
164
|
+
for (const conn of this.components.getConnectionManager().getConnections()) {
|
|
165
|
+
const peerId = conn.remotePeer
|
|
166
166
|
const peer = await this.components.getPeerStore().get(peerId)
|
|
167
167
|
|
|
168
168
|
if (!peer.protocols.includes(this.identifyPushProtocolStr)) {
|
|
169
169
|
continue
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
connections.push(
|
|
172
|
+
connections.push(conn)
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
await this.push(connections)
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createLibp2pNode } from './libp2p.js'
|
|
2
|
-
import type { AbortOptions,
|
|
2
|
+
import type { AbortOptions, RecursivePartial } from '@libp2p/interfaces'
|
|
3
|
+
import type { EventEmitter } from '@libp2p/interfaces/events'
|
|
4
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
3
5
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
6
|
import type { FaultTolerance } from './transport-manager.js'
|
|
5
7
|
import type { HostProperties } from './identify/index.js'
|
|
@@ -16,11 +18,12 @@ import type { ConnectionEncrypter } from '@libp2p/interfaces/connection-encrypte
|
|
|
16
18
|
import type { PeerRouting } from '@libp2p/interfaces/peer-routing'
|
|
17
19
|
import type { ContentRouting } from '@libp2p/interfaces/content-routing'
|
|
18
20
|
import type { PubSub } from '@libp2p/interfaces/pubsub'
|
|
19
|
-
import type {
|
|
21
|
+
import type { Registrar, StreamHandler } from '@libp2p/interfaces/registrar'
|
|
22
|
+
import type { ConnectionManager } from '@libp2p/interfaces/connection-manager'
|
|
20
23
|
import type { Metrics, MetricsInit } from '@libp2p/interfaces/metrics'
|
|
21
24
|
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
|
|
22
|
-
import type { DialerInit } from '@libp2p/interfaces/dialer'
|
|
23
25
|
import type { KeyChain } from './keychain/index.js'
|
|
26
|
+
import type { ConnectionManagerInit } from './connection-manager/index.js'
|
|
24
27
|
|
|
25
28
|
export interface PersistentPeerStoreOptions {
|
|
26
29
|
threshold?: number
|
|
@@ -71,29 +74,6 @@ export interface AddressesConfig {
|
|
|
71
74
|
announceFilter: (multiaddrs: Multiaddr[]) => Multiaddr[]
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
export interface ConnectionManagerConfig {
|
|
75
|
-
/**
|
|
76
|
-
* If true, try to connect to all discovered peers up to the connection manager limit
|
|
77
|
-
*/
|
|
78
|
-
autoDial?: boolean
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The maximum number of connections to keep open
|
|
82
|
-
*/
|
|
83
|
-
maxConnections: number
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The minimum number of connections to keep open
|
|
87
|
-
*/
|
|
88
|
-
minConnections: number
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* How long to wait between attempting to keep our number of concurrent connections
|
|
92
|
-
* above minConnections
|
|
93
|
-
*/
|
|
94
|
-
autoDialInterval: number
|
|
95
|
-
}
|
|
96
|
-
|
|
97
77
|
export interface TransportManagerConfig {
|
|
98
78
|
faultTolerance?: FaultTolerance
|
|
99
79
|
}
|
|
@@ -117,11 +97,10 @@ export interface Libp2pInit {
|
|
|
117
97
|
peerId: PeerId
|
|
118
98
|
host: HostProperties
|
|
119
99
|
addresses: AddressesConfig
|
|
120
|
-
connectionManager:
|
|
100
|
+
connectionManager: ConnectionManagerInit
|
|
121
101
|
connectionGater: Partial<ConnectionGater>
|
|
122
102
|
transportManager: TransportManagerConfig
|
|
123
103
|
datastore: Datastore
|
|
124
|
-
dialer: DialerInit
|
|
125
104
|
metrics: MetricsInit
|
|
126
105
|
peerStore: PeerStoreInit
|
|
127
106
|
peerRouting: PeerRoutingConfig
|
|
@@ -154,9 +133,8 @@ export interface Libp2p extends Startable, EventEmitter<Libp2pEvents> {
|
|
|
154
133
|
connectionManager: ConnectionManager
|
|
155
134
|
registrar: Registrar
|
|
156
135
|
metrics?: Metrics
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
dht?: DualDHT
|
|
136
|
+
pubsub: PubSub
|
|
137
|
+
dht: DualDHT
|
|
160
138
|
|
|
161
139
|
/**
|
|
162
140
|
* Load keychain keys from the datastore.
|
|
@@ -223,6 +201,12 @@ export interface Libp2p extends Startable, EventEmitter<Libp2pEvents> {
|
|
|
223
201
|
* Sends a request to fetch the value associated with the given key from the given peer.
|
|
224
202
|
*/
|
|
225
203
|
fetch: (peer: PeerId | Multiaddr | string, key: string) => Promise<Uint8Array | null>
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type
|
|
207
|
+
* this may mean searching the DHT if the key is not present in the KeyStore.
|
|
208
|
+
*/
|
|
209
|
+
getPublicKey: (peer: PeerId, options?: AbortOptions) => Promise<Uint8Array>
|
|
226
210
|
}
|
|
227
211
|
|
|
228
212
|
export type Libp2pOptions = RecursivePartial<Libp2pInit>
|
package/src/libp2p.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { logger } from '@libp2p/logger'
|
|
2
|
-
import { AbortOptions
|
|
2
|
+
import type { AbortOptions } from '@libp2p/interfaces'
|
|
3
|
+
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
|
|
4
|
+
import { Startable, isStartable } from '@libp2p/interfaces/startable'
|
|
3
5
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
6
|
import { MemoryDatastore } from 'datastore-core/memory'
|
|
5
7
|
import { DefaultPeerRouting } from './peer-routing.js'
|
|
@@ -11,7 +13,6 @@ import { DefaultConnectionManager } from './connection-manager/index.js'
|
|
|
11
13
|
import { AutoDialler } from './connection-manager/auto-dialler.js'
|
|
12
14
|
import { Circuit } from './circuit/transport.js'
|
|
13
15
|
import { Relay } from './circuit/index.js'
|
|
14
|
-
import { DefaultDialer } from './dialer/index.js'
|
|
15
16
|
import { KeyChain } from './keychain/index.js'
|
|
16
17
|
import { DefaultMetrics } from './metrics/index.js'
|
|
17
18
|
import { DefaultTransportManager } from './transport-manager.js'
|
|
@@ -25,14 +26,15 @@ import { PeerRecordUpdater } from './peer-record-updater.js'
|
|
|
25
26
|
import { DHTPeerRouting } from './dht/dht-peer-routing.js'
|
|
26
27
|
import { PersistentPeerStore } from '@libp2p/peer-store'
|
|
27
28
|
import { DHTContentRouting } from './dht/dht-content-routing.js'
|
|
28
|
-
import { AutoDialer } from './dialer/auto-dialer.js'
|
|
29
|
+
import { AutoDialer } from './connection-manager/dialer/auto-dialer.js'
|
|
29
30
|
import { Initializable, Components, isInitializable } from '@libp2p/interfaces/components'
|
|
30
31
|
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
31
32
|
import type { Connection } from '@libp2p/interfaces/connection'
|
|
32
33
|
import type { PeerRouting } from '@libp2p/interfaces/peer-routing'
|
|
33
34
|
import type { ContentRouting } from '@libp2p/interfaces/content-routing'
|
|
34
35
|
import type { PubSub } from '@libp2p/interfaces/pubsub'
|
|
35
|
-
import type {
|
|
36
|
+
import type { Registrar, StreamHandler } from '@libp2p/interfaces/registrar'
|
|
37
|
+
import type { ConnectionManager } from '@libp2p/interfaces/connection-manager'
|
|
36
38
|
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
|
|
37
39
|
import type { Libp2p, Libp2pEvents, Libp2pInit, Libp2pOptions } from './index.js'
|
|
38
40
|
import { validateConfig } from './config.js'
|
|
@@ -44,13 +46,16 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
|
44
46
|
import errCode from 'err-code'
|
|
45
47
|
import { unmarshalPublicKey } from '@libp2p/crypto/keys'
|
|
46
48
|
import type { Metrics } from '@libp2p/interfaces/metrics'
|
|
49
|
+
import { DummyDHT } from './dht/dummy-dht.js'
|
|
50
|
+
import { DummyPubSub } from './pubsub/dummy-pubsub.js'
|
|
51
|
+
import { PeerSet } from '@libp2p/peer-collections'
|
|
47
52
|
|
|
48
53
|
const log = logger('libp2p')
|
|
49
54
|
|
|
50
55
|
export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
51
56
|
public peerId: PeerId
|
|
52
|
-
public dht
|
|
53
|
-
public pubsub
|
|
57
|
+
public dht: DualDHT
|
|
58
|
+
public pubsub: PubSub
|
|
54
59
|
public identifyService?: IdentifyService
|
|
55
60
|
public fetchService: FetchService
|
|
56
61
|
public pingService: PingService
|
|
@@ -70,34 +75,40 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
70
75
|
constructor (init: Libp2pInit) {
|
|
71
76
|
super()
|
|
72
77
|
|
|
73
|
-
this.services = []
|
|
74
78
|
this.initializables = []
|
|
75
79
|
this.started = false
|
|
76
80
|
this.peerId = init.peerId
|
|
77
81
|
this.components = new Components({
|
|
78
82
|
peerId: init.peerId,
|
|
79
|
-
datastore: init.datastore ?? new MemoryDatastore()
|
|
83
|
+
datastore: init.datastore ?? new MemoryDatastore(),
|
|
84
|
+
connectionGater: {
|
|
85
|
+
denyDialPeer: async () => await Promise.resolve(false),
|
|
86
|
+
denyDialMultiaddr: async () => await Promise.resolve(false),
|
|
87
|
+
denyInboundConnection: async () => await Promise.resolve(false),
|
|
88
|
+
denyOutboundConnection: async () => await Promise.resolve(false),
|
|
89
|
+
denyInboundEncryptedConnection: async () => await Promise.resolve(false),
|
|
90
|
+
denyOutboundEncryptedConnection: async () => await Promise.resolve(false),
|
|
91
|
+
denyInboundUpgradedConnection: async () => await Promise.resolve(false),
|
|
92
|
+
denyOutboundUpgradedConnection: async () => await Promise.resolve(false),
|
|
93
|
+
filterMultiaddrForPeer: async () => await Promise.resolve(true),
|
|
94
|
+
...init.connectionGater
|
|
95
|
+
}
|
|
80
96
|
})
|
|
97
|
+
this.components.setPeerStore(new PersistentPeerStore({
|
|
98
|
+
addressFilter: this.components.getConnectionGater().filterMultiaddrForPeer,
|
|
99
|
+
...init.peerStore
|
|
100
|
+
}))
|
|
101
|
+
|
|
102
|
+
this.services = [
|
|
103
|
+
this.components
|
|
104
|
+
]
|
|
81
105
|
|
|
82
106
|
// Create Metrics
|
|
83
107
|
if (init.metrics.enabled) {
|
|
84
|
-
this.metrics = this.components.setMetrics(
|
|
108
|
+
this.metrics = this.components.setMetrics(new DefaultMetrics(init.metrics))
|
|
85
109
|
}
|
|
86
110
|
|
|
87
|
-
this.components.
|
|
88
|
-
denyDialPeer: async () => await Promise.resolve(false),
|
|
89
|
-
denyDialMultiaddr: async () => await Promise.resolve(false),
|
|
90
|
-
denyInboundConnection: async () => await Promise.resolve(false),
|
|
91
|
-
denyOutboundConnection: async () => await Promise.resolve(false),
|
|
92
|
-
denyInboundEncryptedConnection: async () => await Promise.resolve(false),
|
|
93
|
-
denyOutboundEncryptedConnection: async () => await Promise.resolve(false),
|
|
94
|
-
denyInboundUpgradedConnection: async () => await Promise.resolve(false),
|
|
95
|
-
denyOutboundUpgradedConnection: async () => await Promise.resolve(false),
|
|
96
|
-
filterMultiaddrForPeer: async () => await Promise.resolve(true),
|
|
97
|
-
...init.connectionGater
|
|
98
|
-
}))
|
|
99
|
-
|
|
100
|
-
this.peerStore = this.components.setPeerStore(this.configureComponent(new PersistentPeerStore(this.components, init.peerStore)))
|
|
111
|
+
this.peerStore = this.components.getPeerStore()
|
|
101
112
|
|
|
102
113
|
this.peerStore.addEventListener('peer', evt => {
|
|
103
114
|
const { detail: peerData } = evt
|
|
@@ -107,32 +118,30 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
107
118
|
|
|
108
119
|
// Set up connection protector if configured
|
|
109
120
|
if (init.connectionProtector != null) {
|
|
110
|
-
this.components.setConnectionProtector(
|
|
121
|
+
this.components.setConnectionProtector(init.connectionProtector)
|
|
111
122
|
}
|
|
112
123
|
|
|
113
124
|
// Set up the Upgrader
|
|
114
|
-
this.components.setUpgrader(
|
|
125
|
+
this.components.setUpgrader(new DefaultUpgrader(this.components, {
|
|
115
126
|
connectionEncryption: (init.connectionEncryption ?? []).map(component => this.configureComponent(component)),
|
|
116
127
|
muxers: (init.streamMuxers ?? []).map(component => this.configureComponent(component))
|
|
117
|
-
}))
|
|
128
|
+
}))
|
|
118
129
|
|
|
119
130
|
// Create the Connection Manager
|
|
120
|
-
this.connectionManager = this.components.setConnectionManager(
|
|
131
|
+
this.connectionManager = this.components.setConnectionManager(new DefaultConnectionManager(init.connectionManager))
|
|
121
132
|
|
|
122
133
|
// Create the Registrar
|
|
123
|
-
this.registrar = this.components.setRegistrar(
|
|
134
|
+
this.registrar = this.components.setRegistrar(new DefaultRegistrar(this.components))
|
|
124
135
|
|
|
125
136
|
// Setup the transport manager
|
|
126
|
-
this.components.setTransportManager(
|
|
137
|
+
this.components.setTransportManager(new DefaultTransportManager(this.components, init.transportManager))
|
|
127
138
|
|
|
128
139
|
// Addresses {listen, announce, noAnnounce}
|
|
129
|
-
this.components.setAddressManager(
|
|
140
|
+
this.components.setAddressManager(new DefaultAddressManager(this.components, init.addresses))
|
|
130
141
|
|
|
131
142
|
// update our peer record when addresses change
|
|
132
143
|
this.configureComponent(new PeerRecordUpdater(this.components))
|
|
133
144
|
|
|
134
|
-
this.components.setDialer(this.configureComponent(new DefaultDialer(this.components, init.dialer)))
|
|
135
|
-
|
|
136
145
|
this.configureComponent(new AutoDialler(this.components, {
|
|
137
146
|
enabled: init.connectionManager.autoDial,
|
|
138
147
|
minConnections: init.connectionManager.minConnections,
|
|
@@ -167,12 +176,16 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
167
176
|
|
|
168
177
|
// dht provided components (peerRouting, contentRouting, dht)
|
|
169
178
|
if (init.dht != null) {
|
|
170
|
-
this.dht = this.components.setDHT(
|
|
179
|
+
this.dht = this.components.setDHT(init.dht)
|
|
180
|
+
} else {
|
|
181
|
+
this.dht = new DummyDHT()
|
|
171
182
|
}
|
|
172
183
|
|
|
173
184
|
// Create pubsub if provided
|
|
174
185
|
if (init.pubsub != null) {
|
|
175
|
-
this.pubsub = this.components.setPubSub(
|
|
186
|
+
this.pubsub = this.components.setPubSub(init.pubsub)
|
|
187
|
+
} else {
|
|
188
|
+
this.pubsub = new DummyPubSub()
|
|
176
189
|
}
|
|
177
190
|
|
|
178
191
|
// Attach remaining APIs
|
|
@@ -180,7 +193,7 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
180
193
|
|
|
181
194
|
const peerRouters: PeerRouting[] = (init.peerRouters ?? []).map(component => this.configureComponent(component))
|
|
182
195
|
|
|
183
|
-
if (
|
|
196
|
+
if (init.dht != null) {
|
|
184
197
|
// add dht to routers
|
|
185
198
|
peerRouters.push(this.configureComponent(new DHTPeerRouting(this.dht)))
|
|
186
199
|
|
|
@@ -197,7 +210,7 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
197
210
|
|
|
198
211
|
const contentRouters: ContentRouting[] = (init.contentRouters ?? []).map(component => this.configureComponent(component))
|
|
199
212
|
|
|
200
|
-
if (
|
|
213
|
+
if (init.dht != null) {
|
|
201
214
|
// add dht to routers
|
|
202
215
|
contentRouters.push(this.configureComponent(new DHTContentRouting(this.dht)))
|
|
203
216
|
}
|
|
@@ -210,7 +223,7 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
210
223
|
this.components.getTransportManager().add(this.configureComponent(new Circuit()))
|
|
211
224
|
|
|
212
225
|
this.configureComponent(new Relay(this.components, {
|
|
213
|
-
addressSorter: init.
|
|
226
|
+
addressSorter: init.connectionManager.addressSorter,
|
|
214
227
|
...init.relay
|
|
215
228
|
}))
|
|
216
229
|
}
|
|
@@ -225,7 +238,8 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
225
238
|
|
|
226
239
|
const autoDialer = this.configureComponent(new AutoDialer(this.components, {
|
|
227
240
|
enabled: init.connectionManager.autoDial !== false,
|
|
228
|
-
minConnections: init.connectionManager.minConnections
|
|
241
|
+
minConnections: init.connectionManager.minConnections,
|
|
242
|
+
dialTimeout: init.connectionManager.dialTimeout ?? 30000
|
|
229
243
|
}))
|
|
230
244
|
|
|
231
245
|
this.addEventListener('peer:discovery', evt => {
|
|
@@ -373,24 +387,41 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
373
387
|
}
|
|
374
388
|
|
|
375
389
|
getConnections (peerId?: PeerId): Connection[] {
|
|
376
|
-
if (peerId == null) {
|
|
377
|
-
return this.components.getConnectionManager().getConnectionList()
|
|
378
|
-
}
|
|
379
|
-
|
|
380
390
|
return this.components.getConnectionManager().getConnections(peerId)
|
|
381
391
|
}
|
|
382
392
|
|
|
383
393
|
getPeers (): PeerId[] {
|
|
384
|
-
|
|
385
|
-
|
|
394
|
+
const peerSet = new PeerSet()
|
|
395
|
+
|
|
396
|
+
for (const conn of this.components.getConnectionManager().getConnections()) {
|
|
397
|
+
peerSet.add(conn.remotePeer)
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
return Array.from(peerSet)
|
|
386
401
|
}
|
|
387
402
|
|
|
388
403
|
async dial (peer: PeerId | Multiaddr, options: AbortOptions = {}): Promise<Connection> {
|
|
389
|
-
|
|
404
|
+
const { id, multiaddrs } = getPeer(peer)
|
|
405
|
+
|
|
406
|
+
await this.components.getPeerStore().addressBook.add(id, multiaddrs)
|
|
407
|
+
|
|
408
|
+
return await this.components.getConnectionManager().openConnection(id, options)
|
|
390
409
|
}
|
|
391
410
|
|
|
392
411
|
async dialProtocol (peer: PeerId | Multiaddr, protocols: string | string[], options: AbortOptions = {}) {
|
|
393
|
-
|
|
412
|
+
if (protocols == null) {
|
|
413
|
+
throw errCode(new Error('no protocols were provided to open a stream'), codes.ERR_INVALID_PROTOCOLS_FOR_STREAM)
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
protocols = Array.isArray(protocols) ? protocols : [protocols]
|
|
417
|
+
|
|
418
|
+
if (protocols.length === 0) {
|
|
419
|
+
throw errCode(new Error('no protocols were provided to open a stream'), codes.ERR_INVALID_PROTOCOLS_FOR_STREAM)
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const connection = await this.dial(peer)
|
|
423
|
+
|
|
424
|
+
return await connection.newStream(protocols)
|
|
394
425
|
}
|
|
395
426
|
|
|
396
427
|
getMultiaddrs (): Multiaddr[] {
|
|
@@ -400,21 +431,19 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
400
431
|
async hangUp (peer: PeerId | Multiaddr | string): Promise<void> {
|
|
401
432
|
const { id } = getPeer(peer)
|
|
402
433
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
await Promise.all(
|
|
406
|
-
connections.map(async connection => {
|
|
407
|
-
return await connection.close()
|
|
408
|
-
})
|
|
409
|
-
)
|
|
434
|
+
await this.components.getConnectionManager().closeConnections(id)
|
|
410
435
|
}
|
|
411
436
|
|
|
412
437
|
/**
|
|
413
438
|
* Get the public key for the given peer id
|
|
414
439
|
*/
|
|
415
|
-
async getPublicKey (peer: PeerId, options: AbortOptions = {}) {
|
|
440
|
+
async getPublicKey (peer: PeerId, options: AbortOptions = {}): Promise<Uint8Array> {
|
|
416
441
|
log('getPublicKey %p', peer)
|
|
417
442
|
|
|
443
|
+
if (peer.publicKey != null) {
|
|
444
|
+
return peer.publicKey
|
|
445
|
+
}
|
|
446
|
+
|
|
418
447
|
const peerInfo = await this.peerStore.get(peer)
|
|
419
448
|
|
|
420
449
|
if (peerInfo.pubKey != null) {
|
|
@@ -437,7 +466,7 @@ export class Libp2pNode extends EventEmitter<Libp2pEvents> implements Libp2p {
|
|
|
437
466
|
|
|
438
467
|
await this.peerStore.keyBook.set(peer, event.value)
|
|
439
468
|
|
|
440
|
-
return key
|
|
469
|
+
return key.bytes
|
|
441
470
|
}
|
|
442
471
|
}
|
|
443
472
|
|
package/src/metrics/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { METRICS as defaultOptions } from '../constants.js'
|
|
|
5
5
|
import { DefaultStats, StatsInit } from './stats.js'
|
|
6
6
|
import type { ComponentMetricsUpdate, Metrics, Stats, TrackStreamOptions } from '@libp2p/interfaces/metrics'
|
|
7
7
|
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
8
|
-
import type { Startable } from '@libp2p/interfaces'
|
|
8
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
9
9
|
import type { Duplex } from 'it-stream-types'
|
|
10
10
|
|
|
11
11
|
const initialCounters: ['dataReceived', 'dataSent'] = [
|
package/src/metrics/stats.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
|
|
1
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
2
2
|
import { createMovingAverage } from './moving-average.js'
|
|
3
3
|
// @ts-expect-error no types
|
|
4
4
|
import retimer from 'retimer'
|
|
5
|
-
import type { MovingAverages, Stats } from '@libp2p/interfaces/metrics'
|
|
5
|
+
import type { MovingAverages, Stats, TransferStats } from '@libp2p/interfaces/metrics'
|
|
6
6
|
|
|
7
7
|
export interface StatsEvents {
|
|
8
8
|
'update': CustomEvent<TransferStats>
|
|
@@ -16,11 +16,6 @@ export interface StatsInit {
|
|
|
16
16
|
computeThrottleTimeout: number
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export interface TransferStats {
|
|
20
|
-
dataReceived: BigInt
|
|
21
|
-
dataSent: BigInt
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
export class DefaultStats extends EventEmitter<StatsEvents> implements Stats {
|
|
25
20
|
private readonly enabled: boolean
|
|
26
21
|
public queue: Array<[string, number, number]>
|
package/src/nat-manager.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as pkg from './version.js'
|
|
|
7
7
|
import errCode from 'err-code'
|
|
8
8
|
import { codes } from './errors.js'
|
|
9
9
|
import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback'
|
|
10
|
-
import type { Startable } from '@libp2p/interfaces'
|
|
10
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
11
11
|
import type { Components } from '@libp2p/interfaces/components'
|
|
12
12
|
|
|
13
13
|
const log = logger('libp2p:nat')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RecordEnvelope, PeerRecord } from '@libp2p/peer-record'
|
|
2
2
|
import type { Components } from '@libp2p/interfaces/components'
|
|
3
|
-
import type { Startable } from '@libp2p/interfaces'
|
|
3
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
4
4
|
import { logger } from '@libp2p/logger'
|
|
5
5
|
import { protocols } from '@multiformats/multiaddr'
|
|
6
6
|
|
package/src/peer-routing.ts
CHANGED
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
import { setMaxListeners } from 'events'
|
|
22
22
|
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
23
23
|
import type { PeerRouting } from '@libp2p/interfaces/peer-routing'
|
|
24
|
-
import type { AbortOptions
|
|
24
|
+
import type { AbortOptions } from '@libp2p/interfaces'
|
|
25
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
25
26
|
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
|
|
26
27
|
import type { Components } from '@libp2p/interfaces/components'
|
|
27
28
|
|
package/src/ping/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
|
|
|
8
8
|
import { PROTOCOL_NAME, PING_LENGTH, PROTOCOL_VERSION } from './constants.js'
|
|
9
9
|
import type { IncomingStreamData } from '@libp2p/interfaces/registrar'
|
|
10
10
|
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
11
|
-
import type { Startable } from '@libp2p/interfaces'
|
|
11
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
12
12
|
import type { Components } from '@libp2p/interfaces/components'
|
|
13
13
|
|
|
14
14
|
const log = logger('libp2p:ping')
|
|
@@ -63,7 +63,8 @@ export class PingService implements Startable {
|
|
|
63
63
|
async ping (peer: PeerId): Promise<number> {
|
|
64
64
|
log('dialing %s to %p', this.protocol, peer)
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const connection = await this.components.getConnectionManager().openConnection(peer)
|
|
67
|
+
const { stream } = await connection.newStream([this.protocol])
|
|
67
68
|
const start = Date.now()
|
|
68
69
|
const data = randomBytes(PING_LENGTH)
|
|
69
70
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EventEmitter } from '@libp2p/interfaces/events'
|
|
2
|
+
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
3
|
+
import type { PublishResult, PubSub, PubSubEvents, StrictNoSign, StrictSign } from '@libp2p/interfaces/pubsub'
|
|
4
|
+
import errCode from 'err-code'
|
|
5
|
+
import { messages, codes } from '../errors.js'
|
|
6
|
+
|
|
7
|
+
export class DummyPubSub extends EventEmitter<PubSubEvents> implements PubSub {
|
|
8
|
+
isStarted (): boolean {
|
|
9
|
+
return false
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
start (): void | Promise<void> {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
stop (): void | Promise<void> {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get globalSignaturePolicy (): typeof StrictSign | typeof StrictNoSign {
|
|
21
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get multicodecs (): string[] {
|
|
25
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getPeers (): PeerId[] {
|
|
29
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getTopics (): string[] {
|
|
33
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
subscribe (): void {
|
|
37
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
unsubscribe (): void {
|
|
41
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getSubscribers (): PeerId[] {
|
|
45
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async publish (): Promise<PublishResult> {
|
|
49
|
+
throw errCode(new Error(messages.PUBSUB_DISABLED), codes.ERR_PUBSUB_DISABLED)
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/registrar.ts
CHANGED
|
@@ -192,7 +192,7 @@ export class DefaultRegistrar implements Registrar {
|
|
|
192
192
|
|
|
193
193
|
for (const { topology, protocols } of this.topologies.values()) {
|
|
194
194
|
if (supportsProtocol(added, protocols)) {
|
|
195
|
-
const connection = this.components.getConnectionManager().
|
|
195
|
+
const connection = this.components.getConnectionManager().getConnections(peerId)[0]
|
|
196
196
|
|
|
197
197
|
if (connection == null) {
|
|
198
198
|
continue
|
package/src/transport-manager.ts
CHANGED
|
@@ -5,7 +5,9 @@ import errCode from 'err-code'
|
|
|
5
5
|
import type { Listener, Transport, TransportManager, TransportManagerEvents } from '@libp2p/interfaces/transport'
|
|
6
6
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
7
7
|
import type { Connection } from '@libp2p/interfaces/connection'
|
|
8
|
-
import { AbortOptions
|
|
8
|
+
import type { AbortOptions } from '@libp2p/interfaces'
|
|
9
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
10
|
+
import type { Startable } from '@libp2p/interfaces/startable'
|
|
9
11
|
import type { Components } from '@libp2p/interfaces/components'
|
|
10
12
|
import { trackedMap } from '@libp2p/tracked-map'
|
|
11
13
|
|
package/src/upgrader.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { pipe } from 'it-pipe'
|
|
|
6
6
|
import mutableProxy from 'mutable-proxy'
|
|
7
7
|
import { codes } from './errors.js'
|
|
8
8
|
import { createConnection } from '@libp2p/connection'
|
|
9
|
-
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
|
|
9
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
10
10
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
11
11
|
import type { Connection, ProtocolStream, Stream } from '@libp2p/interfaces/connection'
|
|
12
12
|
import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interfaces/connection-encrypter'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-dialer.d.ts","sourceRoot":"","sources":["../../../src/dialer/auto-dialer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAI/D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;gBAE1B,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc;IAMlD,MAAM,CAAE,GAAG,EAAE,WAAW,CAAC,QAAQ,CAAC;CAiB1C"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { logger } from '@libp2p/logger';
|
|
2
|
-
const log = logger('libp2p:dialer:auto-dialer');
|
|
3
|
-
export class AutoDialer {
|
|
4
|
-
constructor(components, init) {
|
|
5
|
-
this.components = components;
|
|
6
|
-
this.enabled = init.enabled;
|
|
7
|
-
this.minConnections = init.minConnections;
|
|
8
|
-
}
|
|
9
|
-
handle(evt) {
|
|
10
|
-
const { detail: peer } = evt;
|
|
11
|
-
// If auto dialing is on and we have no connection to the peer, check if we should dial
|
|
12
|
-
if (this.enabled && this.components.getConnectionManager().getConnection(peer.id) == null) {
|
|
13
|
-
const minConnections = this.minConnections ?? 0;
|
|
14
|
-
if (minConnections > this.components.getConnectionManager().getConnectionList().length) {
|
|
15
|
-
log('auto-dialing discovered peer %p', peer.id);
|
|
16
|
-
void this.components.getDialer().dial(peer.id)
|
|
17
|
-
.catch(err => {
|
|
18
|
-
log.error('could not connect to discovered peer %p with %o', peer.id, err);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=auto-dialer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-dialer.js","sourceRoot":"","sources":["../../../src/dialer/auto-dialer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGvC,MAAM,GAAG,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAA;AAO/C,MAAM,OAAO,UAAU;I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