@streamr/trackerless-network 100.0.0-pretestnet.0 → 100.0.0-pretestnet.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/package.json +8 -8
  2. package/dist/src/NetworkNode.js +1 -1
  3. package/dist/src/NetworkNode.js.map +1 -1
  4. package/dist/src/NetworkStack.js +1 -1
  5. package/dist/src/NetworkStack.js.map +1 -1
  6. package/dist/src/logic/DeliveryRpcLocal.d.ts +1 -1
  7. package/dist/src/logic/EntryPointDiscovery.d.ts +1 -1
  8. package/dist/src/logic/EntryPointDiscovery.js +5 -5
  9. package/dist/src/logic/EntryPointDiscovery.js.map +1 -1
  10. package/dist/src/logic/Layer0Node.d.ts +1 -1
  11. package/dist/src/logic/Layer1Node.d.ts +1 -1
  12. package/dist/src/logic/RandomGraphNode.d.ts +2 -1
  13. package/dist/src/logic/RandomGraphNode.js +8 -8
  14. package/dist/src/logic/RandomGraphNode.js.map +1 -1
  15. package/dist/src/logic/StreamrNode.d.ts +1 -0
  16. package/dist/src/logic/StreamrNode.js +34 -28
  17. package/dist/src/logic/StreamrNode.js.map +1 -1
  18. package/dist/src/logic/createRandomGraphNode.js +8 -7
  19. package/dist/src/logic/createRandomGraphNode.js.map +1 -1
  20. package/dist/src/logic/inspect/Inspector.d.ts +2 -2
  21. package/dist/src/logic/inspect/Inspector.js +2 -2
  22. package/dist/src/logic/inspect/Inspector.js.map +1 -1
  23. package/dist/src/logic/neighbor-discovery/Handshaker.d.ts +2 -1
  24. package/dist/src/logic/neighbor-discovery/Handshaker.js +3 -3
  25. package/dist/src/logic/neighbor-discovery/Handshaker.js.map +1 -1
  26. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.d.ts +1 -1
  27. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js +1 -1
  28. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js.map +1 -1
  29. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.d.ts +1 -1
  30. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js +2 -2
  31. package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.js.map +1 -1
  32. package/dist/src/logic/proxy/ProxyClient.d.ts +1 -1
  33. package/dist/src/logic/proxy/ProxyClient.js +5 -5
  34. package/dist/src/logic/proxy/ProxyClient.js.map +1 -1
  35. package/dist/src/logic/proxy/ProxyConnectionRpcLocal.d.ts +1 -1
  36. package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js +1 -1
  37. package/dist/src/logic/proxy/ProxyConnectionRpcLocal.js.map +1 -1
  38. package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js +1 -1
  39. package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js.map +1 -1
  40. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.d.ts +1 -1
  41. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js +2 -2
  42. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcLocal.js.map +1 -1
  43. package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +77 -60
  44. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +71 -58
  45. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
  46. package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +87 -124
  47. package/dist/src/proto/packages/dht/protos/DhtRpc.js +83 -101
  48. package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
  49. package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +37 -32
  50. package/dist/test/benchmark/first-message.js +1 -1
  51. package/dist/test/benchmark/first-message.js.map +1 -1
  52. package/dist/test/utils/utils.d.ts +1 -1
  53. package/dist/test/utils/utils.js +10 -8
  54. package/dist/test/utils/utils.js.map +1 -1
  55. package/karma.config.js +2 -2
  56. package/package.json +8 -8
  57. package/src/NetworkNode.ts +1 -1
  58. package/src/NetworkStack.ts +1 -1
  59. package/src/logic/DeliveryRpcLocal.ts +1 -1
  60. package/src/logic/EntryPointDiscovery.ts +6 -6
  61. package/src/logic/Layer0Node.ts +1 -1
  62. package/src/logic/Layer1Node.ts +1 -1
  63. package/src/logic/RandomGraphNode.ts +19 -13
  64. package/src/logic/StreamrNode.ts +22 -12
  65. package/src/logic/createRandomGraphNode.ts +8 -7
  66. package/src/logic/inspect/Inspector.ts +4 -4
  67. package/src/logic/neighbor-discovery/Handshaker.ts +15 -6
  68. package/src/logic/neighbor-discovery/NeighborUpdateManager.ts +2 -2
  69. package/src/logic/neighbor-discovery/NeighborUpdateRpcLocal.ts +3 -3
  70. package/src/logic/proxy/ProxyClient.ts +7 -7
  71. package/src/logic/proxy/ProxyConnectionRpcLocal.ts +2 -2
  72. package/src/logic/proxy/ProxyConnectionRpcRemote.ts +2 -2
  73. package/src/logic/temporary-connection/TemporaryConnectionRpcLocal.ts +3 -3
  74. package/src/proto/packages/dht/protos/DhtRpc.client.ts +113 -97
  75. package/src/proto/packages/dht/protos/DhtRpc.server.ts +37 -32
  76. package/src/proto/packages/dht/protos/DhtRpc.ts +115 -160
  77. package/test/benchmark/first-message.ts +1 -1
  78. package/test/end-to-end/inspect.test.ts +6 -3
  79. package/test/end-to-end/proxy-and-full-node.test.ts +1 -0
  80. package/test/end-to-end/proxy-connections.test.ts +2 -0
  81. package/test/end-to-end/proxy-key-exchange.test.ts +1 -0
  82. package/test/end-to-end/random-graph-with-real-connections.test.ts +10 -10
  83. package/test/end-to-end/webrtc-full-node-network.test.ts +2 -1
  84. package/test/end-to-end/websocket-full-node-network.test.ts +3 -1
  85. package/test/integration/Handshakes.test.ts +1 -1
  86. package/test/integration/Inspect.test.ts +1 -1
  87. package/test/integration/NetworkStack.test.ts +4 -2
  88. package/test/integration/NetworkStackStoppedDuringStart.test.ts +4 -2
  89. package/test/integration/RandomGraphNode-Layer1Node-Latencies.test.ts +2 -2
  90. package/test/integration/RandomGraphNode-Layer1Node.test.ts +2 -2
  91. package/test/unit/DeliveryRpcLocal.test.ts +1 -1
  92. package/test/unit/EntrypointDiscovery.test.ts +3 -3
  93. package/test/unit/HandshakeRpcLocal.test.ts +2 -2
  94. package/test/unit/Handshaker.test.ts +3 -2
  95. package/test/unit/Inspector.test.ts +1 -1
  96. package/test/unit/NodeList.test.ts +1 -1
  97. package/test/unit/RandomGraphNode.test.ts +1 -1
  98. package/test/utils/mock/MockLayer0Node.ts +1 -1
  99. package/test/utils/mock/Transport.ts +1 -1
  100. package/test/utils/utils.ts +10 -8
@@ -1 +1 @@
1
- {"version":3,"file":"first-message.js","sourceRoot":"","sources":["../../../test/benchmark/first-message.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;AAE/B,sCAA+E;AAC/E,gDAA4I;AAC5I,0CAAyE;AACzE,4CAAmB;AAGnB,uDAAmE;AACnE,6EAA2E;AAC3E,0CAAyF;AAIzF,MAAM,QAAQ,GAAG,KAAK,CAAA;AAEtB,IAAI,KAAoB,CAAA;AACxB,IAAI,SAAoB,CAAA;AACxB,IAAI,QAAwB,CAAA;AAC5B,MAAM,gBAAgB,GAAqB,EAAE,CAAA;AAC7C,MAAM,WAAW,GAAmC,IAAI,GAAG,EAAE,CAAA;AAC7D,IAAI,WAAwB,CAAA;AAC5B,IAAI,eAA2C,CAAA;AAC/C,IAAI,CAAC,GAAG,CAAC,CAAA;AAET,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;IAC7B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAChC,KAAK,GAAG,EAAE,CAAA;IACV,SAAS,GAAG,IAAI,eAAS,CAAC,iBAAW,CAAC,IAAI,CAAC,CAAA;IAC3C,MAAM,cAAc,GAAG,IAAA,gCAAwB,EAAC;QAC5C,MAAM,EAAE,IAAA,qBAAe,GAAE;KAC5B,CAAC,CAAA;IACF,QAAQ,GAAG,cAAc,CAAA;IACzB,MAAM,UAAU,GAAG,IAAA,sCAA8B,EAAC,cAAc,EAAE,SAAS,EAAE,CAAC,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AAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAuD,CAAA;IAClI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAA;IAC5D,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAA;IAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;IACpC,IAAI,eAAe,EAAE;QACjB,aAAa,CAAC,eAAe,CAAC,CAAA;KACjC;AACL,CAAC,CAAC,CAAA"}
@@ -9,7 +9,7 @@ import { StreamPartID } from '@streamr/protocol';
9
9
  import { NodeID } from '../../src/identifiers';
10
10
  import { Layer1Node } from '../../src/logic/Layer1Node';
11
11
  export declare const mockConnectionLocker: ConnectionLocker;
12
- export declare const createMockRandomGraphNodeAndDhtNode: (ownPeerDescriptor: PeerDescriptor, entryPointDescriptor: PeerDescriptor, streamPartId: StreamPartID, simulator: Simulator) => Promise<[Layer1Node, RandomGraphNode]>;
12
+ export declare const createMockRandomGraphNodeAndDhtNode: (localPeerDescriptor: PeerDescriptor, entryPointDescriptor: PeerDescriptor, streamPartId: StreamPartID, simulator: Simulator) => Promise<[Layer1Node, RandomGraphNode]>;
13
13
  export declare const createStreamMessage: (content: string, streamPartId: StreamPartID, publisherId: EthereumAddress, timestamp?: number, sequenceNumber?: number) => StreamMessage;
14
14
  export declare const createRandomNodeId: () => NodeID;
15
15
  export declare const createMockPeerDescriptor: (opts?: Omit<Partial<PeerDescriptor>, 'kademliaId' | 'type'>) => PeerDescriptor;
@@ -16,21 +16,23 @@ exports.mockConnectionLocker = {
16
16
  weakLockConnection: () => { },
17
17
  weakUnlockConnection: () => { }
18
18
  };
19
- const createMockRandomGraphNodeAndDhtNode = async (ownPeerDescriptor, entryPointDescriptor, streamPartId, simulator) => {
20
- const mockCm = new dht_1.SimulatorTransport(ownPeerDescriptor, simulator);
19
+ const createMockRandomGraphNodeAndDhtNode = async (localPeerDescriptor, entryPointDescriptor, streamPartId, simulator) => {
20
+ const mockCm = new dht_1.SimulatorTransport(localPeerDescriptor, simulator);
21
21
  await mockCm.start();
22
22
  const layer1Node = new dht_1.DhtNode({
23
23
  transport: mockCm,
24
- peerDescriptor: ownPeerDescriptor,
24
+ peerDescriptor: localPeerDescriptor,
25
25
  numberOfNodesPerKBucket: 4,
26
- entryPoints: [entryPointDescriptor]
26
+ entryPoints: [entryPointDescriptor],
27
+ rpcRequestTimeout: 5000
27
28
  });
28
29
  const randomGraphNode = (0, createRandomGraphNode_1.createRandomGraphNode)({
29
30
  streamPartId,
30
31
  transport: mockCm,
31
32
  layer1Node,
32
33
  connectionLocker: mockCm,
33
- ownPeerDescriptor
34
+ localPeerDescriptor,
35
+ rpcRequestTimeout: 5000
34
36
  });
35
37
  return [layer1Node, randomGraphNode];
36
38
  };
@@ -39,8 +41,8 @@ const createStreamMessage = (content, streamPartId, publisherId, timestamp, sequ
39
41
  const messageId = {
40
42
  streamId: protocol_1.StreamPartIDUtils.getStreamID(streamPartId),
41
43
  streamPartition: protocol_1.StreamPartIDUtils.getStreamPartition(streamPartId),
42
- sequenceNumber: sequenceNumber || 0,
43
- timestamp: timestamp || Date.now(),
44
+ sequenceNumber: sequenceNumber ?? 0,
45
+ timestamp: timestamp ?? Date.now(),
44
46
  publisherId: (0, utils_1.hexToBinary)(publisherId),
45
47
  messageChainId: 'messageChain0',
46
48
  };
@@ -68,7 +70,7 @@ const createMockPeerDescriptor = (opts) => {
68
70
  };
69
71
  exports.createMockPeerDescriptor = createMockPeerDescriptor;
70
72
  const createMockDeliveryRpcRemote = (remotePeerDescriptor) => {
71
- return new DeliveryRpcRemote_1.DeliveryRpcRemote((0, exports.createMockPeerDescriptor)(), remotePeerDescriptor || (0, exports.createMockPeerDescriptor)(), 'mock', {});
73
+ return new DeliveryRpcRemote_1.DeliveryRpcRemote((0, exports.createMockPeerDescriptor)(), remotePeerDescriptor ?? (0, exports.createMockPeerDescriptor)(), 'mock', {});
72
74
  };
73
75
  exports.createMockDeliveryRpcRemote = createMockDeliveryRpcRemote;
74
76
  const createMockHandshakeRpcRemote = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../test/utils/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,sCAAiH;AAEjH,+FAMuE;AACvE,yEAAqE;AACrE,iFAA6E;AAC7E,8FAA0F;AAC1F,uDAAsE;AACtE,0CAA2E;AAC3E,gDAAmE;AAItD,QAAA,oBAAoB,GAAqB;IAClD,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC5B,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;CACjC,CAAA;AAEM,MAAM,mCAAmC,GAAG,KAAK,EACpD,iBAAiC,EACjC,oBAAoC,EACpC,YAA0B,EAC1B,SAAoB,EACoB,EAAE;IAC1C,MAAM,MAAM,GAAG,IAAI,wBAAkB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;IACnE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACpB,MAAM,UAAU,GAAG,IAAI,aAAO,CAAC;QAC3B,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,iBAAiB;QACjC,uBAAuB,EAAE,CAAC;QAC1B,WAAW,EAAE,CAAC,oBAAoB,CAAC;KACtC,CAAC,CAAA;IACF,MAAM,eAAe,GAAG,IAAA,6CAAqB,EAAC;QAC1C,YAAY;QACZ,SAAS,EAAE,MAAM;QACjB,UAAU;QACV,gBAAgB,EAAE,MAAM;QACxB,iBAAiB;KACpB,CAAC,CAAA;IACF,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC,CAAA;AACxC,CAAC,CAAA;AAtBY,QAAA,mCAAmC,uCAsB/C;AAEM,MAAM,mBAAm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EACpB,WAA6B,EAClB,EAAE;IACb,MAAM,SAAS,GAAG,IAAI,wBAAkB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;IACnE,OAAO,IAAA,+BAAiB,EAAC;QACrB,MAAM,EAAE;YACJ,cAAc;YACd,WAAW;YACX,SAAS;YACT,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,MAAM;YACvB,WAAW,EAAE,MAAM;SACtB;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAhBY,QAAA,8BAA8B,kCAgB1C"}
package/karma.config.js CHANGED
@@ -12,8 +12,8 @@ module.exports = createKarmaConfig(TEST_PATHS, createWebpackConfig({
12
12
  entry: './src/exports.ts',
13
13
  libraryName: 'trackerless-network',
14
14
  alias: {
15
- [path.resolve(__dirname, '../dht/src/connection/WebRTC/NodeWebRtcConnection.ts')]:
16
- path.resolve(__dirname, '../dht/src/connection/WebRTC/BrowserWebRtcConnection.ts'),
15
+ [path.resolve(__dirname, '../dht/src/connection/webrtc/NodeWebrtcConnection.ts')]:
16
+ path.resolve(__dirname, '../dht/src/connection/webrtc/BrowserWebrtcConnection.ts'),
17
17
  '@streamr/dht': path.resolve('../dht/src/exports.ts'),
18
18
  '@streamr/proto-rpc': path.resolve('../proto-rpc/src/exports.ts'),
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamr/trackerless-network",
3
- "version": "100.0.0-pretestnet.0",
3
+ "version": "100.0.0-pretestnet.3",
4
4
  "description": "Minimal and extendable implementation of the Streamr Network node.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "@protobuf-ts/runtime": "^2.8.2",
32
32
  "@protobuf-ts/runtime-rpc": "^2.8.2",
33
- "@streamr/dht": "100.0.0-pretestnet.0",
34
- "@streamr/proto-rpc": "100.0.0-pretestnet.0",
35
- "@streamr/protocol": "100.0.0-pretestnet.0",
36
- "@streamr/test-utils": "100.0.0-pretestnet.0",
37
- "@streamr/utils": "100.0.0-pretestnet.0",
33
+ "@streamr/dht": "100.0.0-pretestnet.3",
34
+ "@streamr/proto-rpc": "100.0.0-pretestnet.3",
35
+ "@streamr/protocol": "100.0.0-pretestnet.3",
36
+ "@streamr/test-utils": "100.0.0-pretestnet.3",
37
+ "@streamr/utils": "100.0.0-pretestnet.3",
38
38
  "eventemitter3": "^5.0.0",
39
39
  "lodash": "^4.17.21",
40
40
  "uuid": "^9.0.1",
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@streamr/browser-test-runner": "^0.0.1",
45
- "@types/lodash": "^4.14.200",
46
- "@types/uuid": "^9.0.6",
45
+ "@types/lodash": "^4.14.201",
46
+ "@types/uuid": "^9.0.7",
47
47
  "@types/yallist": "^4.0.1",
48
48
  "commander": "^11.1.0",
49
49
  "expect": "^29.6.2",
@@ -102,7 +102,7 @@ export class NetworkNode {
102
102
  }
103
103
 
104
104
  getPeerDescriptor(): PeerDescriptor {
105
- return this.stack.getLayer0Node().getPeerDescriptor()
105
+ return this.stack.getLayer0Node().getLocalPeerDescriptor()
106
106
  }
107
107
 
108
108
  getMetricsContext(): MetricsContext {
@@ -66,7 +66,7 @@ export class NetworkStack extends EventEmitter<NetworkStackEvents> {
66
66
  await this.layer0Node!.start()
67
67
  const connectionManager = this.layer0Node!.getTransport() as ConnectionManager
68
68
  if ((this.options.layer0?.entryPoints !== undefined) && (this.options.layer0.entryPoints.some((entryPoint) =>
69
- areEqualPeerDescriptors(entryPoint, this.layer0Node!.getPeerDescriptor())
69
+ areEqualPeerDescriptors(entryPoint, this.layer0Node!.getLocalPeerDescriptor())
70
70
  ))) {
71
71
  await this.layer0Node?.joinDht(this.options.layer0.entryPoints)
72
72
  } else {
@@ -12,7 +12,7 @@ import { NodeID, getNodeIdFromPeerDescriptor } from '../identifiers'
12
12
  import { StreamPartID } from '@streamr/protocol'
13
13
 
14
14
  export interface DeliveryRpcLocalConfig {
15
- ownPeerDescriptor: PeerDescriptor
15
+ localPeerDescriptor: PeerDescriptor
16
16
  streamPartId: StreamPartID
17
17
  markAndCheckDuplicate: (messageId: MessageID, previousMessageRef?: MessageRef) => boolean
18
18
  broadcast: (message: StreamMessage, previousNode?: NodeID) => void
@@ -56,7 +56,7 @@ export const NETWORK_SPLIT_AVOIDANCE_LIMIT = 4
56
56
 
57
57
  interface EntryPointDiscoveryConfig {
58
58
  streamPartId: StreamPartID
59
- ownPeerDescriptor: PeerDescriptor
59
+ localPeerDescriptor: PeerDescriptor
60
60
  layer1Node: Layer1Node
61
61
  getEntryPointData: (key: Uint8Array) => Promise<DataEntry[]>
62
62
  storeEntryPointData: (key: Uint8Array, data: Any) => Promise<PeerDescriptor[]>
@@ -87,7 +87,7 @@ export class EntryPointDiscovery {
87
87
  }
88
88
  const discoveredEntryPoints = await this.discoverEntryPoints()
89
89
  if (discoveredEntryPoints.length === 0) {
90
- discoveredEntryPoints.push(this.config.ownPeerDescriptor)
90
+ discoveredEntryPoints.push(this.config.localPeerDescriptor)
91
91
  }
92
92
  return {
93
93
  discoveredEntryPoints,
@@ -109,7 +109,7 @@ export class EntryPointDiscovery {
109
109
  }
110
110
 
111
111
  private async queryEntrypoints(key: Uint8Array): Promise<PeerDescriptor[]> {
112
- logger.trace(`Finding data from dht node ${getNodeIdFromPeerDescriptor(this.config.ownPeerDescriptor)}`)
112
+ logger.trace(`Finding data from dht node ${getNodeIdFromPeerDescriptor(this.config.localPeerDescriptor)}`)
113
113
  try {
114
114
  const result = await this.config.getEntryPointData(key)
115
115
  return parseEntryPointData(result)
@@ -133,8 +133,8 @@ export class EntryPointDiscovery {
133
133
  }
134
134
 
135
135
  private async storeSelfAsEntryPoint(): Promise<void> {
136
- const ownPeerDescriptor = this.config.ownPeerDescriptor
137
- const dataToStore = Any.pack(ownPeerDescriptor, PeerDescriptor)
136
+ const localPeerDescriptor = this.config.localPeerDescriptor
137
+ const dataToStore = Any.pack(localPeerDescriptor, PeerDescriptor)
138
138
  try {
139
139
  await this.config.storeEntryPointData(streamPartIdToDataKey(this.config.streamPartId), dataToStore)
140
140
  } catch (err) {
@@ -148,7 +148,7 @@ export class EntryPointDiscovery {
148
148
  try {
149
149
  const discovered = await this.discoverEntryPoints()
150
150
  if (discovered.length < ENTRYPOINT_STORE_LIMIT
151
- || discovered.some((peerDescriptor) => areEqualPeerDescriptors(peerDescriptor, this.config.ownPeerDescriptor))) {
151
+ || discovered.some((peerDescriptor) => areEqualPeerDescriptors(peerDescriptor, this.config.localPeerDescriptor))) {
152
152
  await this.storeSelfAsEntryPoint()
153
153
  }
154
154
  } catch (err) {
@@ -4,7 +4,7 @@ import { Any } from '../proto/google/protobuf/any'
4
4
  export interface Layer0Node extends ITransport {
5
5
  joinDht(entryPointDescriptors: PeerDescriptor[]): Promise<void>
6
6
  hasJoined(): boolean
7
- getPeerDescriptor(): PeerDescriptor
7
+ getLocalPeerDescriptor(): PeerDescriptor
8
8
  getDataFromDht(key: Uint8Array): Promise<DataEntry[]>
9
9
  storeDataToDht(key: Uint8Array, data: Any): Promise<PeerDescriptor[]>
10
10
  deleteDataFromDht(key: Uint8Array): Promise<void>
@@ -11,7 +11,7 @@ export interface Layer1Node {
11
11
  on<T extends keyof Layer1NodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor, peers: PeerDescriptor[]) => void): void
12
12
  once<T extends keyof Layer1NodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor, peers: PeerDescriptor[]) => void): void
13
13
  off<T extends keyof Layer1NodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor, peers: PeerDescriptor[]) => void): void
14
- removeContact: (peerDescriptor: PeerDescriptor, removeFromOpenInternetPeers?: boolean) => void
14
+ removeContact: (peerDescriptor: PeerDescriptor) => void
15
15
  getClosestContacts: (maxCount?: number) => PeerDescriptor[]
16
16
  getKBucketPeers: () => PeerDescriptor[]
17
17
  getBucketSize: () => number
@@ -43,7 +43,7 @@ export interface StrictRandomGraphNodeConfig {
43
43
  layer1Node: Layer1Node
44
44
  transport: ITransport
45
45
  connectionLocker: ConnectionLocker
46
- ownPeerDescriptor: PeerDescriptor
46
+ localPeerDescriptor: PeerDescriptor
47
47
  nodeViewSize: number
48
48
  nearbyNodeView: NodeList
49
49
  randomNodeView: NodeList
@@ -57,6 +57,7 @@ export interface StrictRandomGraphNodeConfig {
57
57
  inspector: IInspector
58
58
  temporaryConnectionRpcLocal: TemporaryConnectionRpcLocal
59
59
  proxyConnectionRpcLocal?: ProxyConnectionRpcLocal
60
+ rpcRequestTimeout?: number
60
61
  }
61
62
 
62
63
  const logger = new Logger(module)
@@ -74,7 +75,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
74
75
  this.config = config
75
76
  this.duplicateDetectors = new Map()
76
77
  this.deliveryRpcLocal = new DeliveryRpcLocal({
77
- ownPeerDescriptor: this.config.ownPeerDescriptor,
78
+ localPeerDescriptor: this.config.localPeerDescriptor,
78
79
  streamPartId: this.config.streamPartId,
79
80
  rpcCommunicator: this.config.rpcCommunicator,
80
81
  markAndCheckDuplicate: (msg: MessageID, prev?: MessageRef) => markAndCheckDuplicate(this.duplicateDetectors, msg, prev),
@@ -86,7 +87,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
86
87
  || this.config.proxyConnectionRpcLocal?.getConnection(senderId )?.remote
87
88
  // TODO: check integrity of notifier?
88
89
  if (contact) {
89
- this.config.layer1Node.removeContact(contact.getPeerDescriptor(), true)
90
+ this.config.layer1Node.removeContact(contact.getPeerDescriptor())
90
91
  this.config.targetNeighbors.remove(contact.getPeerDescriptor())
91
92
  this.config.nearbyNodeView.remove(contact.getPeerDescriptor())
92
93
  this.config.connectionLocker.unlockConnection(contact.getPeerDescriptor(), this.config.streamPartId)
@@ -187,10 +188,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
187
188
  private updateNearbyNodeView(nodes: PeerDescriptor[]) {
188
189
  this.config.nearbyNodeView.replaceAll(Array.from(nodes).map((descriptor) =>
189
190
  new DeliveryRpcRemote(
190
- this.config.ownPeerDescriptor,
191
+ this.config.localPeerDescriptor,
191
192
  descriptor,
192
193
  this.config.streamPartId,
193
- toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
194
+ toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport())),
195
+ this.config.rpcRequestTimeout
194
196
  )
195
197
  ))
196
198
  for (const descriptor of this.config.layer1Node.getKBucketPeers()) {
@@ -199,10 +201,12 @@ export class RandomGraphNode extends EventEmitter<Events> {
199
201
  }
200
202
  this.config.nearbyNodeView.add(
201
203
  new DeliveryRpcRemote(
202
- this.config.ownPeerDescriptor,
204
+ this.config.localPeerDescriptor,
203
205
  descriptor,
204
206
  this.config.streamPartId,
205
- toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
207
+ toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport())),
208
+ this.config.rpcRequestTimeout
209
+
206
210
  )
207
211
  )
208
212
  }
@@ -214,10 +218,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
214
218
  }
215
219
  this.config.randomNodeView.replaceAll(randomNodes.map((descriptor) =>
216
220
  new DeliveryRpcRemote(
217
- this.config.ownPeerDescriptor,
221
+ this.config.localPeerDescriptor,
218
222
  descriptor,
219
223
  this.config.streamPartId,
220
- toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
224
+ toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport())),
225
+ this.config.rpcRequestTimeout
221
226
  )
222
227
  ))
223
228
  if (this.config.targetNeighbors.size() < this.config.numOfTargetNeighbors) {
@@ -232,10 +237,11 @@ export class RandomGraphNode extends EventEmitter<Events> {
232
237
  }
233
238
  this.config.randomNodeView.replaceAll(randomNodes.map((descriptor) =>
234
239
  new DeliveryRpcRemote(
235
- this.config.ownPeerDescriptor,
240
+ this.config.localPeerDescriptor,
236
241
  descriptor,
237
242
  this.config.streamPartId,
238
- toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
243
+ toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport())),
244
+ this.config.rpcRequestTimeout
239
245
  )
240
246
  ))
241
247
  }
@@ -274,7 +280,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
274
280
  this.abortController.abort()
275
281
  this.config.proxyConnectionRpcLocal?.stop()
276
282
  this.config.targetNeighbors.getAll().map((remote) => remote.leaveStreamPartNotice())
277
- this.config.rpcCommunicator.stop()
283
+ this.config.rpcCommunicator.destroy()
278
284
  this.removeAllListeners()
279
285
  this.config.nearbyNodeView.stop()
280
286
  this.config.targetNeighbors.stop()
@@ -307,7 +313,7 @@ export class RandomGraphNode extends EventEmitter<Events> {
307
313
  }
308
314
 
309
315
  getOwnNodeId(): NodeID {
310
- return getNodeIdFromPeerDescriptor(this.config.ownPeerDescriptor)
316
+ return getNodeIdFromPeerDescriptor(this.config.localPeerDescriptor)
311
317
  }
312
318
 
313
319
  getNumberOfOutgoingHandshakes(): number {
@@ -2,7 +2,8 @@ import {
2
2
  ConnectionLocker,
3
3
  DhtNode,
4
4
  ITransport,
5
- PeerDescriptor
5
+ PeerDescriptor,
6
+ EXISTING_CONNECTION_TIMEOUT
6
7
  } from '@streamr/dht'
7
8
  import { StreamID, StreamPartID, StreamPartIDUtils, toStreamPartID } from '@streamr/protocol'
8
9
  import {
@@ -55,6 +56,7 @@ export interface StreamrNodeConfig {
55
56
  streamPartitionNumOfNeighbors?: number
56
57
  streamPartitionMinPropagationTargets?: number
57
58
  acceptProxyConnections?: boolean
59
+ rpcRequestTimeout?: number
58
60
  }
59
61
 
60
62
  // TODO rename class?
@@ -86,7 +88,7 @@ export class StreamrNode extends EventEmitter<Events> {
86
88
  if (this.started || this.destroyed) {
87
89
  return
88
90
  }
89
- logger.info(`Starting new StreamrNode with id ${getNodeIdFromPeerDescriptor(startedAndJoinedLayer0Node.getPeerDescriptor())}`)
91
+ logger.info(`Starting new StreamrNode with id ${getNodeIdFromPeerDescriptor(startedAndJoinedLayer0Node.getLocalPeerDescriptor())}`)
90
92
  this.started = true
91
93
  this.layer0Node = startedAndJoinedLayer0Node
92
94
  this.transport = transport
@@ -137,7 +139,7 @@ export class StreamrNode extends EventEmitter<Events> {
137
139
  const node = this.createRandomGraphNode(streamPartId, layer1Node)
138
140
  const entryPointDiscovery = new EntryPointDiscovery({
139
141
  streamPartId,
140
- ownPeerDescriptor: this.getPeerDescriptor(),
142
+ localPeerDescriptor: this.getPeerDescriptor(),
141
143
  layer1Node,
142
144
  getEntryPointData: (key) => this.layer0Node!.getDataFromDht(key),
143
145
  storeEntryPointData: (key, data) => this.layer0Node!.storeDataToDht(key, data),
@@ -193,28 +195,29 @@ export class StreamrNode extends EventEmitter<Events> {
193
195
  }
194
196
  }
195
197
 
196
- private createLayer1Node = (streamPartId: StreamPartID, entryPoints: PeerDescriptor[]): Layer1Node => {
198
+ private createLayer1Node(streamPartId: StreamPartID, entryPoints: PeerDescriptor[]): Layer1Node {
197
199
  return new DhtNode({
198
200
  transport: this.layer0Node!,
199
201
  serviceId: 'layer1::' + streamPartId,
200
- peerDescriptor: this.layer0Node!.getPeerDescriptor(),
202
+ peerDescriptor: this.layer0Node!.getLocalPeerDescriptor(),
201
203
  entryPoints,
202
204
  numberOfNodesPerKBucket: 4,
203
- rpcRequestTimeout: 5000,
205
+ rpcRequestTimeout: EXISTING_CONNECTION_TIMEOUT,
204
206
  dhtJoinTimeout: 20000
205
207
  })
206
208
  }
207
209
 
208
- private createRandomGraphNode = (streamPartId: StreamPartID, layer1Node: Layer1Node) => {
210
+ private createRandomGraphNode(streamPartId: StreamPartID, layer1Node: Layer1Node) {
209
211
  return createRandomGraphNode({
210
212
  streamPartId,
211
213
  transport: this.transport!,
212
214
  layer1Node,
213
215
  connectionLocker: this.connectionLocker!,
214
- ownPeerDescriptor: this.layer0Node!.getPeerDescriptor(),
216
+ localPeerDescriptor: this.layer0Node!.getLocalPeerDescriptor(),
215
217
  minPropagationTargets: this.config.streamPartitionMinPropagationTargets,
216
218
  numOfTargetNeighbors: this.config.streamPartitionNumOfNeighbors,
217
- acceptProxyConnections: this.config.acceptProxyConnections
219
+ acceptProxyConnections: this.config.acceptProxyConnections,
220
+ rpcRequestTimeout: this.config.rpcRequestTimeout
218
221
  })
219
222
  }
220
223
 
@@ -257,7 +260,7 @@ export class StreamrNode extends EventEmitter<Events> {
257
260
  private createProxyClient(streamPartId: StreamPartID): ProxyClient {
258
261
  return new ProxyClient({
259
262
  transport: this.transport!,
260
- ownPeerDescriptor: this.layer0Node!.getPeerDescriptor(),
263
+ localPeerDescriptor: this.layer0Node!.getLocalPeerDescriptor(),
261
264
  streamPartId,
262
265
  connectionLocker: this.connectionLocker!,
263
266
  minPropagationTargets: this.config.streamPartitionMinPropagationTargets
@@ -292,11 +295,11 @@ export class StreamrNode extends EventEmitter<Events> {
292
295
  }
293
296
 
294
297
  getPeerDescriptor(): PeerDescriptor {
295
- return this.layer0Node!.getPeerDescriptor()
298
+ return this.layer0Node!.getLocalPeerDescriptor()
296
299
  }
297
300
 
298
301
  getNodeId(): NodeID {
299
- return getNodeIdFromPeerDescriptor(this.layer0Node!.getPeerDescriptor())
302
+ return getNodeIdFromPeerDescriptor(this.layer0Node!.getLocalPeerDescriptor())
300
303
  }
301
304
 
302
305
  getNeighbors(streamPartId: StreamPartID): NodeID[] {
@@ -317,3 +320,10 @@ export class StreamrNode extends EventEmitter<Events> {
317
320
  process.exit()
318
321
  })
319
322
  })
323
+
324
+ declare let window: any
325
+ if (typeof window === 'object') {
326
+ window.addEventListener('unload', async () => {
327
+ await cleanUp()
328
+ })
329
+ }
@@ -25,7 +25,7 @@ type RandomGraphNodeConfig = MarkOptional<StrictRandomGraphNodeConfig,
25
25
  }
26
26
 
27
27
  const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGraphNodeConfig => {
28
- const ownNodeId = getNodeIdFromPeerDescriptor(config.ownPeerDescriptor)
28
+ const ownNodeId = getNodeIdFromPeerDescriptor(config.localPeerDescriptor)
29
29
  const rpcCommunicator = config.rpcCommunicator ?? new ListeningRpcCommunicator(
30
30
  formStreamPartDeliveryServiceId(config.streamPartId),
31
31
  config.transport
@@ -42,10 +42,10 @@ const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGr
42
42
  const temporaryConnectionRpcLocal = new TemporaryConnectionRpcLocal({
43
43
  streamPartId: config.streamPartId,
44
44
  rpcCommunicator,
45
- ownPeerDescriptor: config.ownPeerDescriptor
45
+ localPeerDescriptor: config.localPeerDescriptor
46
46
  })
47
47
  const proxyConnectionRpcLocal = acceptProxyConnections ? new ProxyConnectionRpcLocal({
48
- ownPeerDescriptor: config.ownPeerDescriptor,
48
+ localPeerDescriptor: config.localPeerDescriptor,
49
49
  streamPartId: config.streamPartId,
50
50
  rpcCommunicator
51
51
  }) : undefined
@@ -64,14 +64,15 @@ const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGr
64
64
  }
65
65
  })
66
66
  const handshaker = config.handshaker ?? new Handshaker({
67
- ownPeerDescriptor: config.ownPeerDescriptor,
67
+ localPeerDescriptor: config.localPeerDescriptor,
68
68
  streamPartId: config.streamPartId,
69
69
  connectionLocker: config.connectionLocker,
70
70
  rpcCommunicator,
71
71
  nearbyNodeView,
72
72
  randomNodeView,
73
73
  targetNeighbors,
74
- maxNeighborCount: numOfTargetNeighbors
74
+ maxNeighborCount: numOfTargetNeighbors,
75
+ rpcRequestTimeout: config.rpcRequestTimeout
75
76
  })
76
77
  const neighborFinder = config.neighborFinder ?? new NeighborFinder({
77
78
  targetNeighbors,
@@ -82,14 +83,14 @@ const createConfigWithDefaults = (config: RandomGraphNodeConfig): StrictRandomGr
82
83
  const neighborUpdateManager = config.neighborUpdateManager ?? new NeighborUpdateManager({
83
84
  targetNeighbors,
84
85
  nearbyNodeView,
85
- ownPeerDescriptor: config.ownPeerDescriptor,
86
+ localPeerDescriptor: config.localPeerDescriptor,
86
87
  neighborFinder,
87
88
  streamPartId: config.streamPartId,
88
89
  rpcCommunicator,
89
90
  neighborUpdateInterval
90
91
  })
91
92
  const inspector = config.inspector ?? new Inspector({
92
- ownPeerDescriptor: config.ownPeerDescriptor,
93
+ localPeerDescriptor: config.localPeerDescriptor,
93
94
  rpcCommunicator,
94
95
  streamPartId: config.streamPartId,
95
96
  connectionLocker: config.connectionLocker
@@ -9,7 +9,7 @@ import { NodeID, getNodeIdFromPeerDescriptor } from '../../identifiers'
9
9
  import { StreamPartID } from '@streamr/protocol'
10
10
 
11
11
  interface InspectorConfig {
12
- ownPeerDescriptor: PeerDescriptor
12
+ localPeerDescriptor: PeerDescriptor
13
13
  streamPartId: StreamPartID
14
14
  rpcCommunicator: RpcCommunicator
15
15
  connectionLocker: ConnectionLocker
@@ -32,14 +32,14 @@ export class Inspector implements IInspector {
32
32
  private readonly sessions: Map<NodeID, InspectSession> = new Map()
33
33
  private readonly streamPartId: StreamPartID
34
34
  private readonly client: ProtoRpcClient<TemporaryConnectionRpcClient>
35
- private readonly ownPeerDescriptor: PeerDescriptor
35
+ private readonly localPeerDescriptor: PeerDescriptor
36
36
  private readonly connectionLocker: ConnectionLocker
37
37
  private readonly inspectionTimeout: number
38
38
  private readonly openInspectConnection: (peerDescriptor: PeerDescriptor, lockId: string) => Promise<void>
39
39
 
40
40
  constructor(config: InspectorConfig) {
41
41
  this.streamPartId = config.streamPartId
42
- this.ownPeerDescriptor = config.ownPeerDescriptor
42
+ this.localPeerDescriptor = config.localPeerDescriptor
43
43
  this.client = toProtoRpcClient(new TemporaryConnectionRpcClient(config.rpcCommunicator.getRpcClientTransport()))
44
44
  this.connectionLocker = config.connectionLocker
45
45
  this.inspectionTimeout = config.inspectionTimeout ?? DEFAULT_TIMEOUT
@@ -47,7 +47,7 @@ export class Inspector implements IInspector {
47
47
  }
48
48
 
49
49
  async defaultOpenInspectConnection(peerDescriptor: PeerDescriptor, lockId: string): Promise<void> {
50
- const rpcRemote = new TemporaryConnectionRpcRemote(this.ownPeerDescriptor, peerDescriptor, this.streamPartId, this.client)
50
+ const rpcRemote = new TemporaryConnectionRpcRemote(this.localPeerDescriptor, peerDescriptor, this.streamPartId, this.client)
51
51
  await rpcRemote.openConnection()
52
52
  this.connectionLocker.lockConnection(peerDescriptor, lockId)
53
53
  }
@@ -19,7 +19,7 @@ import { NodeID, getNodeIdFromPeerDescriptor } from '../../identifiers'
19
19
  import { StreamPartID } from '@streamr/protocol'
20
20
 
21
21
  interface HandshakerConfig {
22
- ownPeerDescriptor: PeerDescriptor
22
+ localPeerDescriptor: PeerDescriptor
23
23
  streamPartId: StreamPartID
24
24
  connectionLocker: ConnectionLocker
25
25
  targetNeighbors: NodeList
@@ -27,6 +27,7 @@ interface HandshakerConfig {
27
27
  randomNodeView: NodeList
28
28
  rpcCommunicator: RpcCommunicator
29
29
  maxNeighborCount: number
30
+ rpcRequestTimeout?: number
30
31
  }
31
32
 
32
33
  const logger = new Logger(module)
@@ -141,10 +142,11 @@ export class Handshaker implements IHandshaker {
141
142
 
142
143
  private async handshakeWithInterleaving(target: PeerDescriptor, interleaveSourceId: NodeID): Promise<boolean> {
143
144
  const targetNeighbor = new HandshakeRpcRemote(
144
- this.config.ownPeerDescriptor,
145
+ this.config.localPeerDescriptor,
145
146
  target,
146
147
  this.config.streamPartId,
147
- this.client
148
+ this.client,
149
+ this.config.rpcRequestTimeout
148
150
  )
149
151
  const targetNodeId = getNodeIdFromPeerDescriptor(targetNeighbor.getPeerDescriptor())
150
152
  this.ongoingHandshakes.add(targetNodeId)
@@ -162,15 +164,22 @@ export class Handshaker implements IHandshaker {
162
164
  }
163
165
 
164
166
  private createRpcRemote(targetPeerDescriptor: PeerDescriptor): HandshakeRpcRemote {
165
- return new HandshakeRpcRemote(this.config.ownPeerDescriptor, targetPeerDescriptor, this.config.streamPartId, this.client)
167
+ return new HandshakeRpcRemote(
168
+ this.config.localPeerDescriptor,
169
+ targetPeerDescriptor,
170
+ this.config.streamPartId,
171
+ this.client,
172
+ this.config.rpcRequestTimeout
173
+ )
166
174
  }
167
175
 
168
176
  private createDeliveryRpcRemote(targetPeerDescriptor: PeerDescriptor): DeliveryRpcRemote {
169
177
  return new DeliveryRpcRemote(
170
- this.config.ownPeerDescriptor,
178
+ this.config.localPeerDescriptor,
171
179
  targetPeerDescriptor,
172
180
  this.config.streamPartId,
173
- toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
181
+ toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport())),
182
+ this.config.rpcRequestTimeout
174
183
  )
175
184
  }
176
185
 
@@ -11,7 +11,7 @@ import { getNodeIdFromPeerDescriptor } from '../../identifiers'
11
11
  import { StreamPartID } from '@streamr/protocol'
12
12
 
13
13
  interface NeighborUpdateManagerConfig {
14
- ownPeerDescriptor: PeerDescriptor
14
+ localPeerDescriptor: PeerDescriptor
15
15
  targetNeighbors: NodeList
16
16
  nearbyNodeView: NodeList
17
17
  neighborFinder: INeighborFinder
@@ -64,6 +64,6 @@ export class NeighborUpdateManager implements INeighborUpdateManager {
64
64
  }
65
65
 
66
66
  private createRemote(targetPeerDescriptor: PeerDescriptor): NeighborUpdateRpcRemote {
67
- return new NeighborUpdateRpcRemote(this.config.ownPeerDescriptor, targetPeerDescriptor, this.config.streamPartId, this.client)
67
+ return new NeighborUpdateRpcRemote(this.config.localPeerDescriptor, targetPeerDescriptor, this.config.streamPartId, this.client)
68
68
  }
69
69
  }