@streamr/trackerless-network 100.0.0 → 100.1.0
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/package.json +6 -6
- package/dist/src/NetworkNode.js +11 -11
- package/dist/src/NetworkNode.js.map +1 -1
- package/dist/src/NetworkStack.d.ts +4 -4
- package/dist/src/NetworkStack.js +18 -16
- package/dist/src/NetworkStack.js.map +1 -1
- package/dist/src/exports.d.ts +1 -1
- package/dist/src/logic/{StreamrNode.d.ts → ContentDeliveryManager.d.ts} +6 -6
- package/dist/src/logic/{StreamrNode.js → ContentDeliveryManager.js} +7 -9
- package/dist/src/logic/ContentDeliveryManager.js.map +1 -0
- package/dist/src/logic/{DeliveryRpcLocal.d.ts → ContentDeliveryRpcLocal.d.ts} +4 -4
- package/dist/src/logic/{DeliveryRpcLocal.js → ContentDeliveryRpcLocal.js} +4 -4
- package/dist/src/logic/ContentDeliveryRpcLocal.js.map +1 -0
- package/dist/src/logic/{DeliveryRpcRemote.d.ts → ContentDeliveryRpcRemote.d.ts} +2 -2
- package/dist/src/logic/{DeliveryRpcRemote.js → ContentDeliveryRpcRemote.js} +4 -4
- package/dist/src/logic/ContentDeliveryRpcRemote.js.map +1 -0
- package/dist/src/logic/EntryPointDiscovery.js +1 -1
- package/dist/src/logic/EntryPointDiscovery.js.map +1 -1
- package/dist/src/logic/NodeList.d.ts +11 -11
- package/dist/src/logic/NodeList.js.map +1 -1
- package/dist/src/logic/RandomGraphNode.d.ts +1 -1
- package/dist/src/logic/RandomGraphNode.js +12 -12
- package/dist/src/logic/RandomGraphNode.js.map +1 -1
- package/dist/src/logic/createRandomGraphNode.js +1 -1
- package/dist/src/logic/createRandomGraphNode.js.map +1 -1
- package/dist/src/logic/formStreamPartDeliveryServiceId.d.ts +1 -1
- package/dist/src/logic/formStreamPartDeliveryServiceId.js +4 -3
- package/dist/src/logic/formStreamPartDeliveryServiceId.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.d.ts +2 -2
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.js +3 -3
- package/dist/src/logic/neighbor-discovery/HandshakeRpcLocal.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js +2 -2
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/Handshaker.d.ts +1 -1
- package/dist/src/logic/neighbor-discovery/Handshaker.js +6 -6
- package/dist/src/logic/neighbor-discovery/Handshaker.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js +2 -2
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js.map +1 -1
- package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js +6 -0
- package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js.map +1 -1
- package/dist/src/logic/proxy/ProxyClient.d.ts +1 -1
- package/dist/src/logic/proxy/ProxyClient.js +8 -8
- package/dist/src/logic/proxy/ProxyClient.js.map +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.d.ts +2 -2
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js +3 -3
- package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js.map +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js.map +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js +3 -3
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js.map +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js +2 -2
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js.map +1 -1
- package/dist/src/proto/google/protobuf/any.d.ts +11 -4
- package/dist/src/proto/google/protobuf/any.js.map +1 -1
- package/dist/src/proto/google/protobuf/empty.d.ts +0 -1
- package/dist/src/proto/google/protobuf/empty.js.map +1 -1
- package/dist/src/proto/google/protobuf/timestamp.d.ts +9 -3
- package/dist/src/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +10 -0
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +9 -2
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +44 -0
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +29 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +6 -0
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.d.ts +4 -4
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js +7 -7
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js.map +1 -1
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.d.ts +9 -5
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js +8 -4
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js.map +1 -1
- package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.server.d.ts +2 -2
- package/dist/test/benchmark/first-message.js +4 -4
- package/dist/test/benchmark/first-message.js.map +1 -1
- package/dist/test/utils/utils.d.ts +2 -2
- package/dist/test/utils/utils.js +9 -6
- package/dist/test/utils/utils.js.map +1 -1
- package/karma.config.js +2 -0
- package/package.json +6 -6
- package/protos/NetworkRpc.proto +3 -2
- package/src/NetworkNode.ts +11 -11
- package/src/NetworkStack.ts +23 -18
- package/src/exports.ts +1 -1
- package/src/logic/{StreamrNode.ts → ContentDeliveryManager.ts} +12 -13
- package/src/logic/{DeliveryRpcLocal.ts → ContentDeliveryRpcLocal.ts} +5 -5
- package/src/logic/{DeliveryRpcRemote.ts → ContentDeliveryRpcRemote.ts} +2 -2
- package/src/logic/EntryPointDiscovery.ts +1 -1
- package/src/logic/NodeList.ts +13 -13
- package/src/logic/RandomGraphNode.ts +19 -21
- package/src/logic/createRandomGraphNode.ts +2 -2
- package/src/logic/formStreamPartDeliveryServiceId.ts +2 -1
- package/src/logic/neighbor-discovery/HandshakeRpcLocal.ts +5 -5
- package/src/logic/neighbor-discovery/HandshakeRpcRemote.ts +2 -2
- package/src/logic/neighbor-discovery/Handshaker.ts +10 -11
- package/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.ts +4 -4
- package/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.ts +1 -1
- package/src/logic/protocol-integration/stream-message/StreamMessageTranslator.ts +16 -10
- package/src/logic/proxy/ProxyClient.ts +11 -11
- package/src/logic/proxy/ProxyConnectionRpcLocal.ts +6 -6
- package/src/logic/proxy/ProxyConnectionRpcRemote.ts +1 -1
- package/src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts +5 -5
- package/src/logic/temporary-connection/TemporaryConnectionRpcRemote.ts +2 -2
- package/src/proto/google/protobuf/any.ts +11 -4
- package/src/proto/google/protobuf/empty.ts +0 -1
- package/src/proto/google/protobuf/timestamp.ts +9 -3
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +15 -2
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +6 -0
- package/src/proto/packages/dht/protos/DhtRpc.ts +58 -0
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.client.ts +8 -8
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.server.ts +2 -2
- package/src/proto/packages/trackerless-network/protos/NetworkRpc.ts +10 -6
- package/test/benchmark/first-message.ts +4 -4
- package/test/end-to-end/inspect.test.ts +6 -6
- package/test/end-to-end/proxy-and-full-node.test.ts +19 -19
- package/test/end-to-end/proxy-connections.test.ts +7 -7
- package/test/end-to-end/proxy-key-exchange.test.ts +3 -3
- package/test/end-to-end/webrtc-full-node-network.test.ts +8 -8
- package/test/end-to-end/websocket-full-node-network.test.ts +9 -9
- package/test/integration/ContentDeliveryManager.test.ts +135 -0
- package/test/integration/{DeliveryRpcRemote.test.ts → ContentDeliveryRpcRemote.test.ts} +6 -6
- package/test/integration/Inspect.test.ts +2 -2
- package/test/integration/NetworkRpc.test.ts +3 -3
- package/test/integration/NetworkStack.test.ts +7 -7
- package/test/integration/NodeInfoRpc.test.ts +10 -10
- package/test/integration/joining-streams-on-offline-peers.test.ts +3 -3
- package/test/integration/streamEntryPointReplacing.test.ts +6 -4
- package/test/unit/ContentDeliveryManager.test.ts +96 -0
- package/test/unit/{DeliveryRpcLocal.test.ts → ContentDeliveryRpcLocal.test.ts} +4 -4
- package/test/unit/HandshakeRpcLocal.test.ts +19 -19
- package/test/unit/Handshaker.test.ts +2 -2
- package/test/unit/NeighborFinder.test.ts +2 -2
- package/test/unit/NeighborUpdateRpcLocal.test.ts +8 -8
- package/test/unit/NetworkNode.test.ts +6 -6
- package/test/unit/NodeList.test.ts +6 -6
- package/test/unit/RandomGraphNode.test.ts +3 -3
- package/test/utils/utils.ts +9 -6
- package/dist/src/logic/DeliveryRpcLocal.js.map +0 -1
- package/dist/src/logic/DeliveryRpcRemote.js.map +0 -1
- package/dist/src/logic/StreamrNode.js.map +0 -1
- package/test/integration/StreamrNode.test.ts +0 -131
- package/test/unit/StreamrNode.test.ts +0 -98
package/src/NetworkStack.ts
CHANGED
|
@@ -4,21 +4,22 @@ import {
|
|
|
4
4
|
DhtNodeOptions,
|
|
5
5
|
ListeningRpcCommunicator,
|
|
6
6
|
PeerDescriptor,
|
|
7
|
-
areEqualPeerDescriptors
|
|
7
|
+
areEqualPeerDescriptors,
|
|
8
|
+
getNodeIdFromPeerDescriptor
|
|
8
9
|
} from '@streamr/dht'
|
|
9
10
|
import { StreamID, StreamPartID, toStreamPartID } from '@streamr/protocol'
|
|
10
11
|
import { Logger, MetricsContext, waitForCondition } from '@streamr/utils'
|
|
11
12
|
import { pull } from 'lodash'
|
|
12
13
|
import { version as applicationVersion } from '../package.json'
|
|
14
|
+
import { ContentDeliveryManager, ContentDeliveryManagerConfig } from './logic/ContentDeliveryManager'
|
|
13
15
|
import { Layer0Node } from './logic/Layer0Node'
|
|
14
|
-
import { StreamrNode, StreamrNodeConfig } from './logic/StreamrNode'
|
|
15
16
|
import { NodeInfoClient } from './logic/node-info/NodeInfoClient'
|
|
16
17
|
import { NODE_INFO_RPC_SERVICE_ID, NodeInfoRpcLocal } from './logic/node-info/NodeInfoRpcLocal'
|
|
17
18
|
import { NodeInfoResponse, ProxyDirection, StreamMessage } from './proto/packages/trackerless-network/protos/NetworkRpc'
|
|
18
19
|
|
|
19
20
|
export interface NetworkOptions {
|
|
20
21
|
layer0?: DhtNodeOptions
|
|
21
|
-
networkNode?:
|
|
22
|
+
networkNode?: ContentDeliveryManagerConfig
|
|
22
23
|
metricsContext?: MetricsContext
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -54,7 +55,7 @@ export type NodeInfo = Required<NodeInfoResponse>
|
|
|
54
55
|
export class NetworkStack {
|
|
55
56
|
|
|
56
57
|
private layer0Node?: Layer0Node
|
|
57
|
-
private
|
|
58
|
+
private contentDeliveryManager?: ContentDeliveryManager
|
|
58
59
|
private stopped = false
|
|
59
60
|
private readonly metricsContext: MetricsContext
|
|
60
61
|
private readonly options: NetworkOptions
|
|
@@ -68,7 +69,7 @@ export class NetworkStack {
|
|
|
68
69
|
...options.layer0,
|
|
69
70
|
metricsContext: this.metricsContext
|
|
70
71
|
})
|
|
71
|
-
this.
|
|
72
|
+
this.contentDeliveryManager = new ContentDeliveryManager({
|
|
72
73
|
...options.networkNode,
|
|
73
74
|
metricsContext: this.metricsContext
|
|
74
75
|
})
|
|
@@ -76,32 +77,36 @@ export class NetworkStack {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
async joinStreamPart(streamPartId: StreamPartID, neighborRequirement?: { minCount: number, timeout: number }): Promise<void> {
|
|
79
|
-
if (this.
|
|
80
|
+
if (this.getContentDeliveryManager().isProxiedStreamPart(streamPartId)) {
|
|
80
81
|
throw new Error(`Cannot join to ${streamPartId} as proxy connections have been set`)
|
|
81
82
|
}
|
|
82
83
|
await this.ensureConnectedToControlLayer()
|
|
83
|
-
this.
|
|
84
|
+
this.getContentDeliveryManager().joinStreamPart(streamPartId)
|
|
84
85
|
if (neighborRequirement !== undefined) {
|
|
85
86
|
await waitForCondition(() => {
|
|
86
|
-
return this.
|
|
87
|
+
return this.getContentDeliveryManager().getNeighbors(streamPartId).length >= neighborRequirement.minCount
|
|
87
88
|
}, neighborRequirement.timeout)
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
async broadcast(msg: StreamMessage): Promise<void> {
|
|
92
93
|
const streamPartId = toStreamPartID(msg.messageId!.streamId as StreamID, msg.messageId!.streamPartition)
|
|
93
|
-
if (
|
|
94
|
+
if (
|
|
95
|
+
this.getContentDeliveryManager().isProxiedStreamPart(streamPartId, ProxyDirection.SUBSCRIBE)
|
|
96
|
+
&& (msg.body.oneofKind === 'contentMessage')
|
|
97
|
+
) {
|
|
94
98
|
throw new Error(`Cannot broadcast to ${streamPartId} as proxy subscribe connections have been set`)
|
|
95
99
|
}
|
|
96
100
|
// TODO could combine these two calls to isProxiedStreamPart?
|
|
97
|
-
if (!this.
|
|
101
|
+
if (!this.contentDeliveryManager!.isProxiedStreamPart(streamPartId)) {
|
|
98
102
|
await this.ensureConnectedToControlLayer()
|
|
99
103
|
}
|
|
100
|
-
this.
|
|
104
|
+
this.getContentDeliveryManager().broadcast(msg)
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
async start(doJoin = true): Promise<void> {
|
|
104
108
|
await this.layer0Node!.start()
|
|
109
|
+
logger.info(`Starting node with id ${getNodeIdFromPeerDescriptor(this.layer0Node!.getLocalPeerDescriptor())}`)
|
|
105
110
|
const connectionManager = this.layer0Node!.getTransport() as ConnectionManager
|
|
106
111
|
if ((this.options.layer0?.entryPoints !== undefined) && (this.options.layer0.entryPoints.some((entryPoint) =>
|
|
107
112
|
areEqualPeerDescriptors(entryPoint, this.layer0Node!.getLocalPeerDescriptor())
|
|
@@ -114,8 +119,8 @@ export class NetworkStack {
|
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
// TODO: remove undefined checks here. Assume that start is approproately awaited before stop is called.
|
|
117
|
-
await this.
|
|
118
|
-
if (this.
|
|
122
|
+
await this.contentDeliveryManager?.start(this.layer0Node!, connectionManager, connectionManager)
|
|
123
|
+
if (this.contentDeliveryManager) {
|
|
119
124
|
const infoRpcCommunicator = new ListeningRpcCommunicator(NODE_INFO_RPC_SERVICE_ID, this.getConnectionManager())
|
|
120
125
|
this.nodeInfoRpcLocal = new NodeInfoRpcLocal(this, infoRpcCommunicator)
|
|
121
126
|
this.nodeInfoClient = new NodeInfoClient(
|
|
@@ -140,8 +145,8 @@ export class NetworkStack {
|
|
|
140
145
|
}
|
|
141
146
|
}
|
|
142
147
|
|
|
143
|
-
|
|
144
|
-
return this.
|
|
148
|
+
getContentDeliveryManager(): ContentDeliveryManager {
|
|
149
|
+
return this.contentDeliveryManager!
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
getLayer0Node(): Layer0Node {
|
|
@@ -167,7 +172,7 @@ export class NetworkStack {
|
|
|
167
172
|
connections: this.getLayer0Node().getConnections(),
|
|
168
173
|
neighbors: this.getLayer0Node().getNeighbors()
|
|
169
174
|
},
|
|
170
|
-
streamPartitions: this.
|
|
175
|
+
streamPartitions: this.getContentDeliveryManager().getNodeInfo(),
|
|
171
176
|
version: applicationVersion
|
|
172
177
|
}
|
|
173
178
|
}
|
|
@@ -184,9 +189,9 @@ export class NetworkStack {
|
|
|
184
189
|
if (!this.stopped) {
|
|
185
190
|
this.stopped = true
|
|
186
191
|
pull(instances, this)
|
|
187
|
-
await this.
|
|
192
|
+
await this.contentDeliveryManager!.destroy()
|
|
188
193
|
await this.layer0Node!.stop()
|
|
189
|
-
this.
|
|
194
|
+
this.contentDeliveryManager = undefined
|
|
190
195
|
this.layer0Node = undefined
|
|
191
196
|
}
|
|
192
197
|
}
|
package/src/exports.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { NetworkStack, NetworkOptions, NodeInfo } from './NetworkStack'
|
|
2
2
|
export { NetworkNode, createNetworkNode } from './NetworkNode'
|
|
3
|
-
export {
|
|
3
|
+
export { ContentDeliveryManagerConfig } from './logic/ContentDeliveryManager'
|
|
4
4
|
export { ProxyDirection, GroupKeyRequest, GroupKeyResponse } from './proto/packages/trackerless-network/protos/NetworkRpc'
|
|
5
5
|
export { streamPartIdToDataKey } from './logic/EntryPointDiscovery'
|
|
6
6
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionLocker,
|
|
3
|
+
DhtAddress,
|
|
3
4
|
DhtNode,
|
|
5
|
+
EXISTING_CONNECTION_TIMEOUT,
|
|
4
6
|
ITransport,
|
|
5
7
|
PeerDescriptor,
|
|
6
|
-
EXISTING_CONNECTION_TIMEOUT,
|
|
7
|
-
DhtAddress,
|
|
8
8
|
getNodeIdFromPeerDescriptor
|
|
9
9
|
} from '@streamr/dht'
|
|
10
10
|
import { StreamID, StreamPartID, StreamPartIDUtils, toStreamPartID } from '@streamr/protocol'
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
} from '@streamr/utils'
|
|
19
19
|
import { EventEmitter } from 'eventemitter3'
|
|
20
20
|
import { sampleSize } from 'lodash'
|
|
21
|
-
import { ProxyDirection,
|
|
21
|
+
import { ProxyDirection, StreamMessage, StreamPartitionInfo } from '../proto/packages/trackerless-network/protos/NetworkRpc'
|
|
22
|
+
import { EntryPointDiscovery, NETWORK_SPLIT_AVOIDANCE_LIMIT } from './EntryPointDiscovery'
|
|
22
23
|
import { Layer0Node } from './Layer0Node'
|
|
23
24
|
import { Layer1Node } from './Layer1Node'
|
|
24
25
|
import { RandomGraphNode } from './RandomGraphNode'
|
|
25
|
-
import { NETWORK_SPLIT_AVOIDANCE_LIMIT, EntryPointDiscovery } from './EntryPointDiscovery'
|
|
26
26
|
import { createRandomGraphNode } from './createRandomGraphNode'
|
|
27
27
|
import { ProxyClient } from './proxy/ProxyClient'
|
|
28
28
|
|
|
@@ -50,7 +50,7 @@ interface Metrics extends MetricsDefinition {
|
|
|
50
50
|
broadcastBytesPerSecond: Metric
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export interface
|
|
53
|
+
export interface ContentDeliveryManagerConfig {
|
|
54
54
|
metricsContext?: MetricsContext
|
|
55
55
|
streamPartitionNeighborTargetCount?: number
|
|
56
56
|
streamPartitionMinPropagationTargets?: number
|
|
@@ -58,20 +58,20 @@ export interface StreamrNodeConfig {
|
|
|
58
58
|
rpcRequestTimeout?: number
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
export class ContentDeliveryManager extends EventEmitter<Events> {
|
|
62
|
+
|
|
63
63
|
private transport?: ITransport
|
|
64
64
|
private connectionLocker?: ConnectionLocker
|
|
65
65
|
private layer0Node?: Layer0Node
|
|
66
66
|
private readonly metricsContext: MetricsContext
|
|
67
67
|
private readonly metrics: Metrics
|
|
68
|
-
private readonly config:
|
|
68
|
+
private readonly config: ContentDeliveryManagerConfig
|
|
69
69
|
private readonly streamParts: Map<StreamPartID, StreamPartDelivery>
|
|
70
70
|
private readonly knownStreamPartEntryPoints: Map<StreamPartID, PeerDescriptor[]> = new Map()
|
|
71
71
|
private started = false
|
|
72
72
|
private destroyed = false
|
|
73
73
|
|
|
74
|
-
constructor(config:
|
|
74
|
+
constructor(config: ContentDeliveryManagerConfig) {
|
|
75
75
|
super()
|
|
76
76
|
this.config = config
|
|
77
77
|
this.streamParts = new Map()
|
|
@@ -87,7 +87,6 @@ export class StreamrNode extends EventEmitter<Events> {
|
|
|
87
87
|
if (this.started || this.destroyed) {
|
|
88
88
|
return
|
|
89
89
|
}
|
|
90
|
-
logger.info(`Starting new StreamrNode with id ${getNodeIdFromPeerDescriptor(startedAndJoinedLayer0Node.getLocalPeerDescriptor())}`)
|
|
91
90
|
this.started = true
|
|
92
91
|
this.layer0Node = startedAndJoinedLayer0Node
|
|
93
92
|
this.transport = transport
|
|
@@ -98,7 +97,7 @@ export class StreamrNode extends EventEmitter<Events> {
|
|
|
98
97
|
if (!this.started || this.destroyed) {
|
|
99
98
|
return
|
|
100
99
|
}
|
|
101
|
-
logger.trace('Destroying
|
|
100
|
+
logger.trace('Destroying ContentDeliveryManager')
|
|
102
101
|
this.destroyed = true
|
|
103
102
|
await Promise.all(Array.from(this.streamParts.values()).map((streamPart) => streamPart.stop()))
|
|
104
103
|
this.streamParts.clear()
|
|
@@ -175,7 +174,7 @@ export class StreamrNode extends EventEmitter<Events> {
|
|
|
175
174
|
try {
|
|
176
175
|
await this.startLayersAndJoinDht(streamPartId, entryPointDiscovery)
|
|
177
176
|
} catch (err) {
|
|
178
|
-
logger.warn(`Failed to join to stream part ${streamPartId}
|
|
177
|
+
logger.warn(`Failed to join to stream part ${streamPartId}`, { err })
|
|
179
178
|
}
|
|
180
179
|
})
|
|
181
180
|
}
|
|
@@ -297,7 +296,7 @@ export class StreamrNode extends EventEmitter<Events> {
|
|
|
297
296
|
return {
|
|
298
297
|
id: streamPartId,
|
|
299
298
|
controlLayerNeighbors: stream.layer1Node.getNeighbors(),
|
|
300
|
-
|
|
299
|
+
contentDeliveryLayerNeighbors: stream.node.getNeighbors()
|
|
301
300
|
}
|
|
302
301
|
})
|
|
303
302
|
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
MessageRef,
|
|
7
7
|
StreamMessage
|
|
8
8
|
} from '../proto/packages/trackerless-network/protos/NetworkRpc'
|
|
9
|
-
import {
|
|
9
|
+
import { IContentDeliveryRpc } from '../proto/packages/trackerless-network/protos/NetworkRpc.server'
|
|
10
10
|
import { ServerCallContext } from '@protobuf-ts/runtime-rpc'
|
|
11
11
|
import { StreamPartID } from '@streamr/protocol'
|
|
12
12
|
|
|
13
|
-
export interface
|
|
13
|
+
export interface ContentDeliveryRpcLocalConfig {
|
|
14
14
|
localPeerDescriptor: PeerDescriptor
|
|
15
15
|
streamPartId: StreamPartID
|
|
16
16
|
markAndCheckDuplicate: (messageId: MessageID, previousMessageRef?: MessageRef) => boolean
|
|
@@ -20,11 +20,11 @@ export interface DeliveryRpcLocalConfig {
|
|
|
20
20
|
rpcCommunicator: ListeningRpcCommunicator
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export class
|
|
23
|
+
export class ContentDeliveryRpcLocal implements IContentDeliveryRpc {
|
|
24
24
|
|
|
25
|
-
private readonly config:
|
|
25
|
+
private readonly config: ContentDeliveryRpcLocalConfig
|
|
26
26
|
|
|
27
|
-
constructor(config:
|
|
27
|
+
constructor(config: ContentDeliveryRpcLocalConfig) {
|
|
28
28
|
this.config = config
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
LeaveStreamPartNotice,
|
|
5
5
|
StreamMessage
|
|
6
6
|
} from '../proto/packages/trackerless-network/protos/NetworkRpc'
|
|
7
|
-
import {
|
|
7
|
+
import { ContentDeliveryRpcClient } from '../proto/packages/trackerless-network/protos/NetworkRpc.client'
|
|
8
8
|
import { StreamPartID } from '@streamr/protocol'
|
|
9
9
|
|
|
10
10
|
const logger = new Logger(module)
|
|
11
11
|
|
|
12
|
-
export class
|
|
12
|
+
export class ContentDeliveryRpcRemote extends RpcRemote<ContentDeliveryRpcClient> {
|
|
13
13
|
|
|
14
14
|
async sendStreamMessage(msg: StreamMessage): Promise<void> {
|
|
15
15
|
const options = this.formDhtRpcOptions({
|
package/src/logic/NodeList.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DhtAddress, getNodeIdFromPeerDescriptor } from '@streamr/dht'
|
|
2
2
|
import { sample } from 'lodash'
|
|
3
|
-
import {
|
|
3
|
+
import { ContentDeliveryRpcRemote } from './ContentDeliveryRpcRemote'
|
|
4
4
|
import { EventEmitter } from 'eventemitter3'
|
|
5
5
|
|
|
6
6
|
export interface Events {
|
|
7
|
-
nodeAdded: (id: DhtAddress, remote:
|
|
8
|
-
nodeRemoved: (id: DhtAddress, remote:
|
|
7
|
+
nodeAdded: (id: DhtAddress, remote: ContentDeliveryRpcRemote) => void
|
|
8
|
+
nodeRemoved: (id: DhtAddress, remote: ContentDeliveryRpcRemote) => void
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const getValuesOfIncludedKeys = (nodes: Map<DhtAddress,
|
|
11
|
+
const getValuesOfIncludedKeys = (nodes: Map<DhtAddress, ContentDeliveryRpcRemote>, exclude: DhtAddress[]): ContentDeliveryRpcRemote[] => {
|
|
12
12
|
return Array.from(nodes.entries())
|
|
13
13
|
.filter(([id, _node]) => !exclude.includes(id))
|
|
14
14
|
.map(([_id, node]) => node)
|
|
@@ -17,7 +17,7 @@ const getValuesOfIncludedKeys = (nodes: Map<DhtAddress, DeliveryRpcRemote>, excl
|
|
|
17
17
|
// The items in the list are in the insertion order
|
|
18
18
|
|
|
19
19
|
export class NodeList extends EventEmitter<Events> {
|
|
20
|
-
private readonly nodes: Map<DhtAddress,
|
|
20
|
+
private readonly nodes: Map<DhtAddress, ContentDeliveryRpcRemote>
|
|
21
21
|
private readonly limit: number
|
|
22
22
|
private ownId: DhtAddress
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ export class NodeList extends EventEmitter<Events> {
|
|
|
28
28
|
this.ownId = ownId
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
add(remote:
|
|
31
|
+
add(remote: ContentDeliveryRpcRemote): void {
|
|
32
32
|
const nodeId = getNodeIdFromPeerDescriptor(remote.getPeerDescriptor())
|
|
33
33
|
if ((this.ownId !== nodeId) && (this.nodes.size < this.limit)) {
|
|
34
34
|
const isExistingNode = this.nodes.has(nodeId)
|
|
@@ -53,7 +53,7 @@ export class NodeList extends EventEmitter<Events> {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// Replace nodes does not emit nodeRemoved events, use with caution
|
|
56
|
-
replaceAll(neighbors:
|
|
56
|
+
replaceAll(neighbors: ContentDeliveryRpcRemote[]): void {
|
|
57
57
|
this.nodes.clear()
|
|
58
58
|
const limited = neighbors.splice(0, this.limit)
|
|
59
59
|
limited.forEach((remote) => {
|
|
@@ -65,7 +65,7 @@ export class NodeList extends EventEmitter<Events> {
|
|
|
65
65
|
return Array.from(this.nodes.keys())
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
get(id: DhtAddress):
|
|
68
|
+
get(id: DhtAddress): ContentDeliveryRpcRemote | undefined {
|
|
69
69
|
return this.nodes.get(id)
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -73,16 +73,16 @@ export class NodeList extends EventEmitter<Events> {
|
|
|
73
73
|
return Array.from(this.nodes.keys()).filter((node) => !exclude.includes(node)).length
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
getRandom(exclude: DhtAddress[]):
|
|
76
|
+
getRandom(exclude: DhtAddress[]): ContentDeliveryRpcRemote | undefined {
|
|
77
77
|
return sample(getValuesOfIncludedKeys(this.nodes, exclude))
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
getFirst(exclude: DhtAddress[]):
|
|
80
|
+
getFirst(exclude: DhtAddress[]): ContentDeliveryRpcRemote | undefined {
|
|
81
81
|
const included = getValuesOfIncludedKeys(this.nodes, exclude)
|
|
82
82
|
return included[0]
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
getFirstAndLast(exclude: DhtAddress[]):
|
|
85
|
+
getFirstAndLast(exclude: DhtAddress[]): ContentDeliveryRpcRemote[] {
|
|
86
86
|
const included = getValuesOfIncludedKeys(this.nodes, exclude)
|
|
87
87
|
if (included.length === 0) {
|
|
88
88
|
return []
|
|
@@ -90,12 +90,12 @@ export class NodeList extends EventEmitter<Events> {
|
|
|
90
90
|
return included.length > 1 ? [this.getFirst(exclude)!, this.getLast(exclude)!] : [this.getFirst(exclude)!]
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
getLast(exclude: DhtAddress[]):
|
|
93
|
+
getLast(exclude: DhtAddress[]): ContentDeliveryRpcRemote | undefined {
|
|
94
94
|
const included = getValuesOfIncludedKeys(this.nodes, exclude)
|
|
95
95
|
return included[included.length - 1]
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
getAll():
|
|
98
|
+
getAll(): ContentDeliveryRpcRemote[] {
|
|
99
99
|
return Array.from(this.nodes.values())
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -18,16 +18,15 @@ import {
|
|
|
18
18
|
CloseTemporaryConnection,
|
|
19
19
|
} from '../proto/packages/trackerless-network/protos/NetworkRpc'
|
|
20
20
|
import { NodeList } from './NodeList'
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { IDeliveryRpc } from '../proto/packages/trackerless-network/protos/NetworkRpc.server'
|
|
21
|
+
import { ContentDeliveryRpcClient } from '../proto/packages/trackerless-network/protos/NetworkRpc.client'
|
|
22
|
+
import { ContentDeliveryRpcRemote } from './ContentDeliveryRpcRemote'
|
|
24
23
|
import { DuplicateMessageDetector } from './DuplicateMessageDetector'
|
|
25
24
|
import { Logger, addManagedEventListener } from '@streamr/utils'
|
|
26
25
|
import { Handshaker } from './neighbor-discovery/Handshaker'
|
|
27
26
|
import { Propagation } from './propagation/Propagation'
|
|
28
27
|
import { NeighborFinder } from './neighbor-discovery/NeighborFinder'
|
|
29
28
|
import { NeighborUpdateManager } from './neighbor-discovery/NeighborUpdateManager'
|
|
30
|
-
import {
|
|
29
|
+
import { ContentDeliveryRpcLocal } from './ContentDeliveryRpcLocal'
|
|
31
30
|
import { ProxyConnectionRpcLocal } from './proxy/ProxyConnectionRpcLocal'
|
|
32
31
|
import { Inspector } from './inspect/Inspector'
|
|
33
32
|
import { TemporaryConnectionRpcLocal } from './temporary-connection/TemporaryConnectionRpcLocal'
|
|
@@ -75,14 +74,14 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
75
74
|
private started = false
|
|
76
75
|
private readonly duplicateDetectors: Map<string, DuplicateMessageDetector>
|
|
77
76
|
private config: StrictRandomGraphNodeConfig
|
|
78
|
-
private readonly
|
|
77
|
+
private readonly contentDeliveryRpcLocal: ContentDeliveryRpcLocal
|
|
79
78
|
private abortController: AbortController = new AbortController()
|
|
80
79
|
|
|
81
80
|
constructor(config: StrictRandomGraphNodeConfig) {
|
|
82
81
|
super()
|
|
83
82
|
this.config = config
|
|
84
83
|
this.duplicateDetectors = new Map()
|
|
85
|
-
this.
|
|
84
|
+
this.contentDeliveryRpcLocal = new ContentDeliveryRpcLocal({
|
|
86
85
|
localPeerDescriptor: this.config.localPeerDescriptor,
|
|
87
86
|
streamPartId: this.config.streamPartId,
|
|
88
87
|
rpcCommunicator: this.config.rpcCommunicator,
|
|
@@ -206,9 +205,9 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
206
205
|
|
|
207
206
|
private registerDefaultServerMethods(): void {
|
|
208
207
|
this.config.rpcCommunicator.registerRpcNotification(StreamMessage, 'sendStreamMessage',
|
|
209
|
-
(msg: StreamMessage, context) => this.
|
|
208
|
+
(msg: StreamMessage, context) => this.contentDeliveryRpcLocal.sendStreamMessage(msg, context))
|
|
210
209
|
this.config.rpcCommunicator.registerRpcNotification(LeaveStreamPartNotice, 'leaveStreamPartNotice',
|
|
211
|
-
(req: LeaveStreamPartNotice, context) => this.
|
|
210
|
+
(req: LeaveStreamPartNotice, context) => this.contentDeliveryRpcLocal.leaveStreamPartNotice(req, context))
|
|
212
211
|
this.config.rpcCommunicator.registerRpcMethod(TemporaryConnectionRequest, TemporaryConnectionResponse, 'openConnection',
|
|
213
212
|
(req: TemporaryConnectionRequest, context) => this.config.temporaryConnectionRpcLocal.openConnection(req, context))
|
|
214
213
|
this.config.rpcCommunicator.registerRpcNotification(CloseTemporaryConnection, 'closeConnection',
|
|
@@ -221,20 +220,20 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
221
220
|
return
|
|
222
221
|
}
|
|
223
222
|
this.config.leftNodeView.replaceAll(ringPeers.left.map((peer) =>
|
|
224
|
-
new
|
|
223
|
+
new ContentDeliveryRpcRemote(
|
|
225
224
|
this.config.localPeerDescriptor,
|
|
226
225
|
peer,
|
|
227
226
|
this.config.rpcCommunicator,
|
|
228
|
-
|
|
227
|
+
ContentDeliveryRpcClient,
|
|
229
228
|
this.config.rpcRequestTimeout
|
|
230
229
|
)
|
|
231
230
|
))
|
|
232
231
|
this.config.rightNodeView.replaceAll(ringPeers.right.map((peer) =>
|
|
233
|
-
new
|
|
232
|
+
new ContentDeliveryRpcRemote(
|
|
234
233
|
this.config.localPeerDescriptor,
|
|
235
234
|
peer,
|
|
236
235
|
this.config.rpcCommunicator,
|
|
237
|
-
|
|
236
|
+
ContentDeliveryRpcClient,
|
|
238
237
|
this.config.rpcRequestTimeout
|
|
239
238
|
)
|
|
240
239
|
))
|
|
@@ -261,11 +260,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
261
260
|
|
|
262
261
|
private updateNearbyNodeView(nodes: PeerDescriptor[]) {
|
|
263
262
|
this.config.nearbyNodeView.replaceAll(Array.from(nodes).map((descriptor) =>
|
|
264
|
-
new
|
|
263
|
+
new ContentDeliveryRpcRemote(
|
|
265
264
|
this.config.localPeerDescriptor,
|
|
266
265
|
descriptor,
|
|
267
266
|
this.config.rpcCommunicator,
|
|
268
|
-
|
|
267
|
+
ContentDeliveryRpcClient,
|
|
269
268
|
this.config.rpcRequestTimeout
|
|
270
269
|
)
|
|
271
270
|
))
|
|
@@ -274,13 +273,12 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
274
273
|
break
|
|
275
274
|
}
|
|
276
275
|
this.config.nearbyNodeView.add(
|
|
277
|
-
new
|
|
276
|
+
new ContentDeliveryRpcRemote(
|
|
278
277
|
this.config.localPeerDescriptor,
|
|
279
278
|
descriptor,
|
|
280
279
|
this.config.rpcCommunicator,
|
|
281
|
-
|
|
280
|
+
ContentDeliveryRpcClient,
|
|
282
281
|
this.config.rpcRequestTimeout
|
|
283
|
-
|
|
284
282
|
)
|
|
285
283
|
)
|
|
286
284
|
}
|
|
@@ -291,11 +289,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
291
289
|
return
|
|
292
290
|
}
|
|
293
291
|
this.config.randomNodeView.replaceAll(randomNodes.map((descriptor) =>
|
|
294
|
-
new
|
|
292
|
+
new ContentDeliveryRpcRemote(
|
|
295
293
|
this.config.localPeerDescriptor,
|
|
296
294
|
descriptor,
|
|
297
295
|
this.config.rpcCommunicator,
|
|
298
|
-
|
|
296
|
+
ContentDeliveryRpcClient,
|
|
299
297
|
this.config.rpcRequestTimeout
|
|
300
298
|
)
|
|
301
299
|
))
|
|
@@ -310,11 +308,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
|
|
|
310
308
|
return
|
|
311
309
|
}
|
|
312
310
|
this.config.randomNodeView.replaceAll(randomNodes.map((descriptor) =>
|
|
313
|
-
new
|
|
311
|
+
new ContentDeliveryRpcRemote(
|
|
314
312
|
this.config.localPeerDescriptor,
|
|
315
313
|
descriptor,
|
|
316
314
|
this.config.rpcCommunicator,
|
|
317
|
-
|
|
315
|
+
ContentDeliveryRpcClient,
|
|
318
316
|
this.config.rpcRequestTimeout
|
|
319
317
|
)
|
|
320
318
|
))
|
|
@@ -10,7 +10,7 @@ import { MarkOptional } from 'ts-essentials'
|
|
|
10
10
|
import { ProxyConnectionRpcLocal } from './proxy/ProxyConnectionRpcLocal'
|
|
11
11
|
import { Inspector } from './inspect/Inspector'
|
|
12
12
|
import { TemporaryConnectionRpcLocal } from './temporary-connection/TemporaryConnectionRpcLocal'
|
|
13
|
-
import {
|
|
13
|
+
import { formStreamPartContentDeliveryServiceId } from './formStreamPartDeliveryServiceId'
|
|
14
14
|
|
|
15
15
|
type RandomGraphNodeConfig = MarkOptional<StrictRandomGraphNodeConfig,
|
|
16
16
|
'nearbyNodeView' | 'randomNodeView' | 'neighbors' | 'leftNodeView' | 'rightNodeView' | 'propagation'
|
|
@@ -26,7 +26,7 @@ type RandomGraphNodeConfig = MarkOptional<StrictRandomGraphNodeConfig,
|
|
|
26
26
|
const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGraphNodeConfig => {
|
|
27
27
|
const ownNodeId = getNodeIdFromPeerDescriptor(config.localPeerDescriptor)
|
|
28
28
|
const rpcCommunicator = config.rpcCommunicator ?? new ListeningRpcCommunicator(
|
|
29
|
-
|
|
29
|
+
formStreamPartContentDeliveryServiceId(config.streamPartId),
|
|
30
30
|
config.transport
|
|
31
31
|
)
|
|
32
32
|
const neighborTargetCount = config.neighborTargetCount ?? 4
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ServiceID } from '@streamr/dht'
|
|
2
2
|
import { StreamPartID } from '@streamr/protocol'
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const formStreamPartContentDeliveryServiceId = (streamPartId: StreamPartID): ServiceID => {
|
|
5
|
+
// could be "content-delivery" instead of "delivery", but that is a breaking change
|
|
5
6
|
return `stream-part-delivery-${streamPartId}`
|
|
6
7
|
}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from '@streamr/dht'
|
|
17
17
|
import { IHandshakeRpc } from '../../proto/packages/trackerless-network/protos/NetworkRpc.server'
|
|
18
18
|
import { HandshakeRpcRemote } from './HandshakeRpcRemote'
|
|
19
|
-
import {
|
|
19
|
+
import { ContentDeliveryRpcRemote } from '../ContentDeliveryRpcRemote'
|
|
20
20
|
import { Logger } from '@streamr/utils'
|
|
21
21
|
import { StreamPartID } from '@streamr/protocol'
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ interface HandshakeRpcLocalConfig {
|
|
|
27
27
|
ongoingInterleaves: Set<DhtAddress>
|
|
28
28
|
maxNeighborCount: number
|
|
29
29
|
createRpcRemote: (target: PeerDescriptor) => HandshakeRpcRemote
|
|
30
|
-
|
|
30
|
+
createContentDeliveryRpcRemote: (peerDescriptor: PeerDescriptor) => ContentDeliveryRpcRemote
|
|
31
31
|
handshakeWithInterleaving: (target: PeerDescriptor, senderId: DhtAddress) => Promise<boolean>
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -74,7 +74,7 @@ export class HandshakeRpcLocal implements IHandshakeRpc {
|
|
|
74
74
|
requestId: request.requestId,
|
|
75
75
|
accepted: true
|
|
76
76
|
}
|
|
77
|
-
this.config.neighbors.add(this.config.
|
|
77
|
+
this.config.neighbors.add(this.config.createContentDeliveryRpcRemote(requester))
|
|
78
78
|
return res
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -117,7 +117,7 @@ export class HandshakeRpcLocal implements IHandshakeRpc {
|
|
|
117
117
|
this.config.ongoingInterleaves.delete(nodeId)
|
|
118
118
|
})
|
|
119
119
|
}
|
|
120
|
-
this.config.neighbors.add(this.config.
|
|
120
|
+
this.config.neighbors.add(this.config.createContentDeliveryRpcRemote(requester))
|
|
121
121
|
return {
|
|
122
122
|
requestId: request.requestId,
|
|
123
123
|
accepted: true,
|
|
@@ -133,7 +133,7 @@ export class HandshakeRpcLocal implements IHandshakeRpc {
|
|
|
133
133
|
this.config.neighbors.remove(senderId)
|
|
134
134
|
return { accepted: true }
|
|
135
135
|
} catch (err) {
|
|
136
|
-
logger.debug(`interleaveRequest to ${getNodeIdFromPeerDescriptor(message.interleaveTargetDescriptor!)} failed
|
|
136
|
+
logger.debug(`interleaveRequest to ${getNodeIdFromPeerDescriptor(message.interleaveTargetDescriptor!)} failed`, { err })
|
|
137
137
|
return { accepted: false }
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -36,7 +36,7 @@ export class HandshakeRpcRemote extends RpcRemote<HandshakeRpcClient> {
|
|
|
36
36
|
interleaveTargetDescriptor: response.interleaveTargetDescriptor
|
|
37
37
|
}
|
|
38
38
|
} catch (err: any) {
|
|
39
|
-
logger.debug(`handshake to ${getNodeIdFromPeerDescriptor(this.getPeerDescriptor())} failed
|
|
39
|
+
logger.debug(`handshake to ${getNodeIdFromPeerDescriptor(this.getPeerDescriptor())} failed`, { err })
|
|
40
40
|
return {
|
|
41
41
|
accepted: false
|
|
42
42
|
}
|
|
@@ -57,7 +57,7 @@ export class HandshakeRpcRemote extends RpcRemote<HandshakeRpcClient> {
|
|
|
57
57
|
accepted: res.accepted
|
|
58
58
|
}
|
|
59
59
|
} catch (err) {
|
|
60
|
-
logger.debug(`interleaveRequest to ${getNodeIdFromPeerDescriptor(this.getPeerDescriptor())} failed
|
|
60
|
+
logger.debug(`interleaveRequest to ${getNodeIdFromPeerDescriptor(this.getPeerDescriptor())} failed`, { err })
|
|
61
61
|
return {
|
|
62
62
|
accepted: false
|
|
63
63
|
}
|