@streamr/trackerless-network 100.0.0-pretestnet.2 → 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 +7 -7
  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 +4 -4
  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 +18 -12
  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 +6 -6
  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
@@ -44,7 +44,7 @@ export const retry = async <T>(task: () => Promise<T>, description: string, abor
44
44
 
45
45
  interface ProxyClientConfig {
46
46
  transport: ITransport
47
- ownPeerDescriptor: PeerDescriptor
47
+ localPeerDescriptor: PeerDescriptor
48
48
  streamPartId: StreamPartID
49
49
  connectionLocker: ConnectionLocker
50
50
  minPropagationTargets?: number // TODO could be required option if we apply all defaults somewhere at higher level
@@ -77,9 +77,9 @@ export class ProxyClient extends EventEmitter {
77
77
  super()
78
78
  this.config = config
79
79
  this.rpcCommunicator = new ListeningRpcCommunicator(formStreamPartDeliveryServiceId(config.streamPartId), config.transport)
80
- this.targetNeighbors = new NodeList(getNodeIdFromPeerDescriptor(this.config.ownPeerDescriptor), 1000)
80
+ this.targetNeighbors = new NodeList(getNodeIdFromPeerDescriptor(this.config.localPeerDescriptor), 1000)
81
81
  this.deliveryRpcLocal = new DeliveryRpcLocal({
82
- ownPeerDescriptor: this.config.ownPeerDescriptor,
82
+ localPeerDescriptor: this.config.localPeerDescriptor,
83
83
  streamPartId: this.config.streamPartId,
84
84
  markAndCheckDuplicate: (msg: MessageID, prev?: MessageRef) => markAndCheckDuplicate(this.duplicateDetectors, msg, prev),
85
85
  broadcast: (message: StreamMessage, previousNode?: NodeID) => this.broadcast(message, previousNode),
@@ -150,7 +150,7 @@ export class ProxyClient extends EventEmitter {
150
150
 
151
151
  private getInvalidConnections(): NodeID[] {
152
152
  return Array.from(this.connections.keys()).filter((id) => {
153
- return !this.definition!.nodes.has(id )
153
+ return !this.definition!.nodes.has(id)
154
154
  || this.definition!.direction !== this.connections.get(id)
155
155
  })
156
156
  }
@@ -167,13 +167,13 @@ export class ProxyClient extends EventEmitter {
167
167
  private async attemptConnection(nodeId: NodeID, direction: ProxyDirection, userId: EthereumAddress): Promise<void> {
168
168
  const peerDescriptor = this.definition!.nodes.get(nodeId)!
169
169
  const client = toProtoRpcClient(new ProxyConnectionRpcClient(this.rpcCommunicator.getRpcClientTransport()))
170
- const rpcRemote = new ProxyConnectionRpcRemote(this.config.ownPeerDescriptor, peerDescriptor, this.config.streamPartId, client)
170
+ const rpcRemote = new ProxyConnectionRpcRemote(this.config.localPeerDescriptor, peerDescriptor, this.config.streamPartId, client)
171
171
  const accepted = await rpcRemote.requestConnection(direction, userId)
172
172
  if (accepted) {
173
173
  this.config.connectionLocker.lockConnection(peerDescriptor, SERVICE_ID)
174
174
  this.connections.set(nodeId, direction)
175
175
  const remote = new DeliveryRpcRemote(
176
- this.config.ownPeerDescriptor,
176
+ this.config.localPeerDescriptor,
177
177
  peerDescriptor,
178
178
  this.config.streamPartId,
179
179
  toProtoRpcClient(new DeliveryRpcClient(this.rpcCommunicator.getRpcClientTransport()))
@@ -26,7 +26,7 @@ interface ProxyConnection {
26
26
  }
27
27
 
28
28
  interface ProxyConnectionRpcLocalConfig {
29
- ownPeerDescriptor: PeerDescriptor
29
+ localPeerDescriptor: PeerDescriptor
30
30
  streamPartId: StreamPartID
31
31
  rpcCommunicator: ListeningRpcCommunicator
32
32
  }
@@ -95,7 +95,7 @@ export class ProxyConnectionRpcLocal extends EventEmitter<Events> implements IPr
95
95
  direction: request.direction,
96
96
  userId: toEthereumAddress(binaryToHex(request.userId, true)),
97
97
  remote: new DeliveryRpcRemote(
98
- this.config.ownPeerDescriptor,
98
+ this.config.localPeerDescriptor,
99
99
  senderPeerDescriptor,
100
100
  this.config.streamPartId,
101
101
  toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
@@ -1,4 +1,4 @@
1
- import { Remote } from '@streamr/dht'
1
+ import { Remote, EXISTING_CONNECTION_TIMEOUT } from '@streamr/dht'
2
2
  import { EthereumAddress, Logger, hexToBinary } from '@streamr/utils'
3
3
  import { ProxyConnectionRequest, ProxyDirection } from '../../proto/packages/trackerless-network/protos/NetworkRpc'
4
4
  import { IProxyConnectionRpcClient } from '../../proto/packages/trackerless-network/protos/NetworkRpc.client'
@@ -13,7 +13,7 @@ export class ProxyConnectionRpcRemote extends Remote<IProxyConnectionRpcClient>
13
13
  userId: hexToBinary(userId)
14
14
  }
15
15
  const options = this.formDhtRpcOptions({
16
- timeout: 5000
16
+ timeout: EXISTING_CONNECTION_TIMEOUT
17
17
  })
18
18
  try {
19
19
  const res = await this.getClient().requestConnection(request, options)
@@ -13,7 +13,7 @@ import { StreamPartID } from '@streamr/protocol'
13
13
  interface TemporaryConnectionRpcLocalConfig {
14
14
  streamPartId: StreamPartID
15
15
  rpcCommunicator: ListeningRpcCommunicator
16
- ownPeerDescriptor: PeerDescriptor
16
+ localPeerDescriptor: PeerDescriptor
17
17
  }
18
18
 
19
19
  export class TemporaryConnectionRpcLocal implements ITemporaryConnectionRpc {
@@ -23,7 +23,7 @@ export class TemporaryConnectionRpcLocal implements ITemporaryConnectionRpc {
23
23
 
24
24
  constructor(config: TemporaryConnectionRpcLocalConfig) {
25
25
  this.config = config
26
- this.temporaryNodes = new NodeList(getNodeIdFromPeerDescriptor(config.ownPeerDescriptor), 10)
26
+ this.temporaryNodes = new NodeList(getNodeIdFromPeerDescriptor(config.localPeerDescriptor), 10)
27
27
  }
28
28
 
29
29
  getNodes(): NodeList {
@@ -40,7 +40,7 @@ export class TemporaryConnectionRpcLocal implements ITemporaryConnectionRpc {
40
40
  ): Promise<TemporaryConnectionResponse> {
41
41
  const sender = (context as DhtCallContext).incomingSourceDescriptor!
42
42
  const remote = new DeliveryRpcRemote(
43
- this.config.ownPeerDescriptor,
43
+ this.config.localPeerDescriptor,
44
44
  sender,
45
45
  this.config.streamPartId,
46
46
  toProtoRpcClient(new DeliveryRpcClient(this.config.rpcCommunicator.getRpcClientTransport()))
@@ -1,40 +1,41 @@
1
1
  // @generated by protobuf-ts 2.9.1 with parameter server_generic,generate_dependencies,long_type_number
2
2
  // @generated from protobuf file "packages/dht/protos/DhtRpc.proto" (package "dht", syntax proto3)
3
3
  // tslint:disable
4
- import { ExternalApiService } from "./DhtRpc";
4
+ import { ExternalApiRpc } from "./DhtRpc";
5
5
  import type { ExternalStoreDataResponse } from "./DhtRpc";
6
6
  import type { ExternalStoreDataRequest } from "./DhtRpc";
7
- import type { FindDataResponse } from "./DhtRpc";
8
- import type { FindDataRequest } from "./DhtRpc";
9
- import { ConnectionLocker } from "./DhtRpc";
7
+ import type { ExternalFindDataResponse } from "./DhtRpc";
8
+ import type { ExternalFindDataRequest } from "./DhtRpc";
9
+ import { ConnectionLockRpc } from "./DhtRpc";
10
10
  import type { DisconnectNoticeResponse } from "./DhtRpc";
11
11
  import type { DisconnectNotice } from "./DhtRpc";
12
12
  import type { UnlockRequest } from "./DhtRpc";
13
13
  import type { LockResponse } from "./DhtRpc";
14
14
  import type { LockRequest } from "./DhtRpc";
15
- import { WebRtcConnectorService } from "./DhtRpc";
15
+ import { WebrtcConnectorRpc } from "./DhtRpc";
16
16
  import type { IceCandidate } from "./DhtRpc";
17
17
  import type { RtcAnswer } from "./DhtRpc";
18
18
  import type { RtcOffer } from "./DhtRpc";
19
- import type { WebRtcConnectionRequest } from "./DhtRpc";
20
- import { WebSocketConnectorService } from "./DhtRpc";
21
- import type { WebSocketConnectionResponse } from "./DhtRpc";
22
- import type { WebSocketConnectionRequest } from "./DhtRpc";
23
- import { RecursiveFindSessionService } from "./DhtRpc";
24
- import type { RecursiveFindReport } from "./DhtRpc";
25
- import { StoreService } from "./DhtRpc";
19
+ import type { WebrtcConnectionRequest } from "./DhtRpc";
20
+ import { WebsocketConnectorRpc } from "./DhtRpc";
21
+ import type { WebsocketConnectionResponse } from "./DhtRpc";
22
+ import type { WebsocketConnectionRequest } from "./DhtRpc";
23
+ import { FindSessionRpc } from "./DhtRpc";
24
+ import type { FindResponse } from "./DhtRpc";
25
+ import { StoreRpc } from "./DhtRpc";
26
26
  import type { DeleteDataResponse } from "./DhtRpc";
27
27
  import type { DeleteDataRequest } from "./DhtRpc";
28
28
  import type { MigrateDataResponse } from "./DhtRpc";
29
29
  import type { MigrateDataRequest } from "./DhtRpc";
30
30
  import type { StoreDataResponse } from "./DhtRpc";
31
31
  import type { StoreDataRequest } from "./DhtRpc";
32
- import { RoutingService } from "./DhtRpc";
32
+ import { FindRpc } from "./DhtRpc";
33
+ import { RouterRpc } from "./DhtRpc";
33
34
  import type { RouteMessageAck } from "./DhtRpc";
34
35
  import type { RouteMessageWrapper } from "./DhtRpc";
35
36
  import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
36
37
  import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
37
- import { DhtRpcService } from "./DhtRpc";
38
+ import { DhtNodeRpc } from "./DhtRpc";
38
39
  import type { Empty } from "../../../google/protobuf/empty";
39
40
  import type { LeaveNotice } from "./DhtRpc";
40
41
  import type { PingResponse } from "./DhtRpc";
@@ -45,9 +46,9 @@ import type { ClosestPeersRequest } from "./DhtRpc";
45
46
  import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
46
47
  import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
47
48
  /**
48
- * @generated from protobuf service dht.DhtRpcService
49
+ * @generated from protobuf service dht.DhtNodeRpc
49
50
  */
50
- export interface IDhtRpcServiceClient {
51
+ export interface IDhtNodeRpcClient {
51
52
  /**
52
53
  * @generated from protobuf rpc: getClosestPeers(dht.ClosestPeersRequest) returns (dht.ClosestPeersResponse);
53
54
  */
@@ -62,12 +63,12 @@ export interface IDhtRpcServiceClient {
62
63
  leaveNotice(input: LeaveNotice, options?: RpcOptions): UnaryCall<LeaveNotice, Empty>;
63
64
  }
64
65
  /**
65
- * @generated from protobuf service dht.DhtRpcService
66
+ * @generated from protobuf service dht.DhtNodeRpc
66
67
  */
67
- export class DhtRpcServiceClient implements IDhtRpcServiceClient, ServiceInfo {
68
- typeName = DhtRpcService.typeName;
69
- methods = DhtRpcService.methods;
70
- options = DhtRpcService.options;
68
+ export class DhtNodeRpcClient implements IDhtNodeRpcClient, ServiceInfo {
69
+ typeName = DhtNodeRpc.typeName;
70
+ methods = DhtNodeRpc.methods;
71
+ options = DhtNodeRpc.options;
71
72
  constructor(private readonly _transport: RpcTransport) {
72
73
  }
73
74
  /**
@@ -93,9 +94,9 @@ export class DhtRpcServiceClient implements IDhtRpcServiceClient, ServiceInfo {
93
94
  }
94
95
  }
95
96
  /**
96
- * @generated from protobuf service dht.RoutingService
97
+ * @generated from protobuf service dht.RouterRpc
97
98
  */
98
- export interface IRoutingServiceClient {
99
+ export interface IRouterRpcClient {
99
100
  /**
100
101
  * @generated from protobuf rpc: routeMessage(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
101
102
  */
@@ -104,18 +105,14 @@ export interface IRoutingServiceClient {
104
105
  * @generated from protobuf rpc: forwardMessage(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
105
106
  */
106
107
  forwardMessage(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck>;
107
- /**
108
- * @generated from protobuf rpc: findRecursively(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
109
- */
110
- findRecursively(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck>;
111
108
  }
112
109
  /**
113
- * @generated from protobuf service dht.RoutingService
110
+ * @generated from protobuf service dht.RouterRpc
114
111
  */
115
- export class RoutingServiceClient implements IRoutingServiceClient, ServiceInfo {
116
- typeName = RoutingService.typeName;
117
- methods = RoutingService.methods;
118
- options = RoutingService.options;
112
+ export class RouterRpcClient implements IRouterRpcClient, ServiceInfo {
113
+ typeName = RouterRpc.typeName;
114
+ methods = RouterRpc.methods;
115
+ options = RouterRpc.options;
119
116
  constructor(private readonly _transport: RpcTransport) {
120
117
  }
121
118
  /**
@@ -132,18 +129,37 @@ export class RoutingServiceClient implements IRoutingServiceClient, ServiceInfo
132
129
  const method = this.methods[1], opt = this._transport.mergeOptions(options);
133
130
  return stackIntercept<RouteMessageWrapper, RouteMessageAck>("unary", this._transport, method, opt, input);
134
131
  }
132
+ }
133
+ /**
134
+ * @generated from protobuf service dht.FindRpc
135
+ */
136
+ export interface IFindRpcClient {
135
137
  /**
136
- * @generated from protobuf rpc: findRecursively(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
138
+ * @generated from protobuf rpc: routeFindRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
137
139
  */
138
- findRecursively(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck> {
139
- const method = this.methods[2], opt = this._transport.mergeOptions(options);
140
+ routeFindRequest(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck>;
141
+ }
142
+ /**
143
+ * @generated from protobuf service dht.FindRpc
144
+ */
145
+ export class FindRpcClient implements IFindRpcClient, ServiceInfo {
146
+ typeName = FindRpc.typeName;
147
+ methods = FindRpc.methods;
148
+ options = FindRpc.options;
149
+ constructor(private readonly _transport: RpcTransport) {
150
+ }
151
+ /**
152
+ * @generated from protobuf rpc: routeFindRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
153
+ */
154
+ routeFindRequest(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck> {
155
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
140
156
  return stackIntercept<RouteMessageWrapper, RouteMessageAck>("unary", this._transport, method, opt, input);
141
157
  }
142
158
  }
143
159
  /**
144
- * @generated from protobuf service dht.StoreService
160
+ * @generated from protobuf service dht.StoreRpc
145
161
  */
146
- export interface IStoreServiceClient {
162
+ export interface IStoreRpcClient {
147
163
  /**
148
164
  * @generated from protobuf rpc: storeData(dht.StoreDataRequest) returns (dht.StoreDataResponse);
149
165
  */
@@ -158,12 +174,12 @@ export interface IStoreServiceClient {
158
174
  deleteData(input: DeleteDataRequest, options?: RpcOptions): UnaryCall<DeleteDataRequest, DeleteDataResponse>;
159
175
  }
160
176
  /**
161
- * @generated from protobuf service dht.StoreService
177
+ * @generated from protobuf service dht.StoreRpc
162
178
  */
163
- export class StoreServiceClient implements IStoreServiceClient, ServiceInfo {
164
- typeName = StoreService.typeName;
165
- methods = StoreService.methods;
166
- options = StoreService.options;
179
+ export class StoreRpcClient implements IStoreRpcClient, ServiceInfo {
180
+ typeName = StoreRpc.typeName;
181
+ methods = StoreRpc.methods;
182
+ options = StoreRpc.options;
167
183
  constructor(private readonly _transport: RpcTransport) {
168
184
  }
169
185
  /**
@@ -189,65 +205,65 @@ export class StoreServiceClient implements IStoreServiceClient, ServiceInfo {
189
205
  }
190
206
  }
191
207
  /**
192
- * @generated from protobuf service dht.RecursiveFindSessionService
208
+ * @generated from protobuf service dht.FindSessionRpc
193
209
  */
194
- export interface IRecursiveFindSessionServiceClient {
210
+ export interface IFindSessionRpcClient {
195
211
  /**
196
- * @generated from protobuf rpc: reportRecursiveFindResult(dht.RecursiveFindReport) returns (google.protobuf.Empty);
212
+ * @generated from protobuf rpc: sendFindResponse(dht.FindResponse) returns (google.protobuf.Empty);
197
213
  */
198
- reportRecursiveFindResult(input: RecursiveFindReport, options?: RpcOptions): UnaryCall<RecursiveFindReport, Empty>;
214
+ sendFindResponse(input: FindResponse, options?: RpcOptions): UnaryCall<FindResponse, Empty>;
199
215
  }
200
216
  /**
201
- * @generated from protobuf service dht.RecursiveFindSessionService
217
+ * @generated from protobuf service dht.FindSessionRpc
202
218
  */
203
- export class RecursiveFindSessionServiceClient implements IRecursiveFindSessionServiceClient, ServiceInfo {
204
- typeName = RecursiveFindSessionService.typeName;
205
- methods = RecursiveFindSessionService.methods;
206
- options = RecursiveFindSessionService.options;
219
+ export class FindSessionRpcClient implements IFindSessionRpcClient, ServiceInfo {
220
+ typeName = FindSessionRpc.typeName;
221
+ methods = FindSessionRpc.methods;
222
+ options = FindSessionRpc.options;
207
223
  constructor(private readonly _transport: RpcTransport) {
208
224
  }
209
225
  /**
210
- * @generated from protobuf rpc: reportRecursiveFindResult(dht.RecursiveFindReport) returns (google.protobuf.Empty);
226
+ * @generated from protobuf rpc: sendFindResponse(dht.FindResponse) returns (google.protobuf.Empty);
211
227
  */
212
- reportRecursiveFindResult(input: RecursiveFindReport, options?: RpcOptions): UnaryCall<RecursiveFindReport, Empty> {
228
+ sendFindResponse(input: FindResponse, options?: RpcOptions): UnaryCall<FindResponse, Empty> {
213
229
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
214
- return stackIntercept<RecursiveFindReport, Empty>("unary", this._transport, method, opt, input);
230
+ return stackIntercept<FindResponse, Empty>("unary", this._transport, method, opt, input);
215
231
  }
216
232
  }
217
233
  /**
218
- * @generated from protobuf service dht.WebSocketConnectorService
234
+ * @generated from protobuf service dht.WebsocketConnectorRpc
219
235
  */
220
- export interface IWebSocketConnectorServiceClient {
236
+ export interface IWebsocketConnectorRpcClient {
221
237
  /**
222
- * @generated from protobuf rpc: requestConnection(dht.WebSocketConnectionRequest) returns (dht.WebSocketConnectionResponse);
238
+ * @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (dht.WebsocketConnectionResponse);
223
239
  */
224
- requestConnection(input: WebSocketConnectionRequest, options?: RpcOptions): UnaryCall<WebSocketConnectionRequest, WebSocketConnectionResponse>;
240
+ requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest, WebsocketConnectionResponse>;
225
241
  }
226
242
  /**
227
- * @generated from protobuf service dht.WebSocketConnectorService
243
+ * @generated from protobuf service dht.WebsocketConnectorRpc
228
244
  */
229
- export class WebSocketConnectorServiceClient implements IWebSocketConnectorServiceClient, ServiceInfo {
230
- typeName = WebSocketConnectorService.typeName;
231
- methods = WebSocketConnectorService.methods;
232
- options = WebSocketConnectorService.options;
245
+ export class WebsocketConnectorRpcClient implements IWebsocketConnectorRpcClient, ServiceInfo {
246
+ typeName = WebsocketConnectorRpc.typeName;
247
+ methods = WebsocketConnectorRpc.methods;
248
+ options = WebsocketConnectorRpc.options;
233
249
  constructor(private readonly _transport: RpcTransport) {
234
250
  }
235
251
  /**
236
- * @generated from protobuf rpc: requestConnection(dht.WebSocketConnectionRequest) returns (dht.WebSocketConnectionResponse);
252
+ * @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (dht.WebsocketConnectionResponse);
237
253
  */
238
- requestConnection(input: WebSocketConnectionRequest, options?: RpcOptions): UnaryCall<WebSocketConnectionRequest, WebSocketConnectionResponse> {
254
+ requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest, WebsocketConnectionResponse> {
239
255
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
240
- return stackIntercept<WebSocketConnectionRequest, WebSocketConnectionResponse>("unary", this._transport, method, opt, input);
256
+ return stackIntercept<WebsocketConnectionRequest, WebsocketConnectionResponse>("unary", this._transport, method, opt, input);
241
257
  }
242
258
  }
243
259
  /**
244
- * @generated from protobuf service dht.WebRtcConnectorService
260
+ * @generated from protobuf service dht.WebrtcConnectorRpc
245
261
  */
246
- export interface IWebRtcConnectorServiceClient {
262
+ export interface IWebrtcConnectorRpcClient {
247
263
  /**
248
- * @generated from protobuf rpc: requestConnection(dht.WebRtcConnectionRequest) returns (google.protobuf.Empty);
264
+ * @generated from protobuf rpc: requestConnection(dht.WebrtcConnectionRequest) returns (google.protobuf.Empty);
249
265
  */
250
- requestConnection(input: WebRtcConnectionRequest, options?: RpcOptions): UnaryCall<WebRtcConnectionRequest, Empty>;
266
+ requestConnection(input: WebrtcConnectionRequest, options?: RpcOptions): UnaryCall<WebrtcConnectionRequest, Empty>;
251
267
  /**
252
268
  * @generated from protobuf rpc: rtcOffer(dht.RtcOffer) returns (google.protobuf.Empty);
253
269
  */
@@ -262,20 +278,20 @@ export interface IWebRtcConnectorServiceClient {
262
278
  iceCandidate(input: IceCandidate, options?: RpcOptions): UnaryCall<IceCandidate, Empty>;
263
279
  }
264
280
  /**
265
- * @generated from protobuf service dht.WebRtcConnectorService
281
+ * @generated from protobuf service dht.WebrtcConnectorRpc
266
282
  */
267
- export class WebRtcConnectorServiceClient implements IWebRtcConnectorServiceClient, ServiceInfo {
268
- typeName = WebRtcConnectorService.typeName;
269
- methods = WebRtcConnectorService.methods;
270
- options = WebRtcConnectorService.options;
283
+ export class WebrtcConnectorRpcClient implements IWebrtcConnectorRpcClient, ServiceInfo {
284
+ typeName = WebrtcConnectorRpc.typeName;
285
+ methods = WebrtcConnectorRpc.methods;
286
+ options = WebrtcConnectorRpc.options;
271
287
  constructor(private readonly _transport: RpcTransport) {
272
288
  }
273
289
  /**
274
- * @generated from protobuf rpc: requestConnection(dht.WebRtcConnectionRequest) returns (google.protobuf.Empty);
290
+ * @generated from protobuf rpc: requestConnection(dht.WebrtcConnectionRequest) returns (google.protobuf.Empty);
275
291
  */
276
- requestConnection(input: WebRtcConnectionRequest, options?: RpcOptions): UnaryCall<WebRtcConnectionRequest, Empty> {
292
+ requestConnection(input: WebrtcConnectionRequest, options?: RpcOptions): UnaryCall<WebrtcConnectionRequest, Empty> {
277
293
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
278
- return stackIntercept<WebRtcConnectionRequest, Empty>("unary", this._transport, method, opt, input);
294
+ return stackIntercept<WebrtcConnectionRequest, Empty>("unary", this._transport, method, opt, input);
279
295
  }
280
296
  /**
281
297
  * @generated from protobuf rpc: rtcOffer(dht.RtcOffer) returns (google.protobuf.Empty);
@@ -300,9 +316,9 @@ export class WebRtcConnectorServiceClient implements IWebRtcConnectorServiceClie
300
316
  }
301
317
  }
302
318
  /**
303
- * @generated from protobuf service dht.ConnectionLocker
319
+ * @generated from protobuf service dht.ConnectionLockRpc
304
320
  */
305
- export interface IConnectionLockerClient {
321
+ export interface IConnectionLockRpcClient {
306
322
  /**
307
323
  * @generated from protobuf rpc: lockRequest(dht.LockRequest) returns (dht.LockResponse);
308
324
  */
@@ -317,12 +333,12 @@ export interface IConnectionLockerClient {
317
333
  gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, DisconnectNoticeResponse>;
318
334
  }
319
335
  /**
320
- * @generated from protobuf service dht.ConnectionLocker
336
+ * @generated from protobuf service dht.ConnectionLockRpc
321
337
  */
322
- export class ConnectionLockerClient implements IConnectionLockerClient, ServiceInfo {
323
- typeName = ConnectionLocker.typeName;
324
- methods = ConnectionLocker.methods;
325
- options = ConnectionLocker.options;
338
+ export class ConnectionLockRpcClient implements IConnectionLockRpcClient, ServiceInfo {
339
+ typeName = ConnectionLockRpc.typeName;
340
+ methods = ConnectionLockRpc.methods;
341
+ options = ConnectionLockRpc.options;
326
342
  constructor(private readonly _transport: RpcTransport) {
327
343
  }
328
344
  /**
@@ -348,33 +364,33 @@ export class ConnectionLockerClient implements IConnectionLockerClient, ServiceI
348
364
  }
349
365
  }
350
366
  /**
351
- * @generated from protobuf service dht.ExternalApiService
367
+ * @generated from protobuf service dht.ExternalApiRpc
352
368
  */
353
- export interface IExternalApiServiceClient {
369
+ export interface IExternalApiRpcClient {
354
370
  /**
355
- * @generated from protobuf rpc: findData(dht.FindDataRequest) returns (dht.FindDataResponse);
371
+ * @generated from protobuf rpc: externalFindData(dht.ExternalFindDataRequest) returns (dht.ExternalFindDataResponse);
356
372
  */
357
- findData(input: FindDataRequest, options?: RpcOptions): UnaryCall<FindDataRequest, FindDataResponse>;
373
+ externalFindData(input: ExternalFindDataRequest, options?: RpcOptions): UnaryCall<ExternalFindDataRequest, ExternalFindDataResponse>;
358
374
  /**
359
375
  * @generated from protobuf rpc: externalStoreData(dht.ExternalStoreDataRequest) returns (dht.ExternalStoreDataResponse);
360
376
  */
361
377
  externalStoreData(input: ExternalStoreDataRequest, options?: RpcOptions): UnaryCall<ExternalStoreDataRequest, ExternalStoreDataResponse>;
362
378
  }
363
379
  /**
364
- * @generated from protobuf service dht.ExternalApiService
380
+ * @generated from protobuf service dht.ExternalApiRpc
365
381
  */
366
- export class ExternalApiServiceClient implements IExternalApiServiceClient, ServiceInfo {
367
- typeName = ExternalApiService.typeName;
368
- methods = ExternalApiService.methods;
369
- options = ExternalApiService.options;
382
+ export class ExternalApiRpcClient implements IExternalApiRpcClient, ServiceInfo {
383
+ typeName = ExternalApiRpc.typeName;
384
+ methods = ExternalApiRpc.methods;
385
+ options = ExternalApiRpc.options;
370
386
  constructor(private readonly _transport: RpcTransport) {
371
387
  }
372
388
  /**
373
- * @generated from protobuf rpc: findData(dht.FindDataRequest) returns (dht.FindDataResponse);
389
+ * @generated from protobuf rpc: externalFindData(dht.ExternalFindDataRequest) returns (dht.ExternalFindDataResponse);
374
390
  */
375
- findData(input: FindDataRequest, options?: RpcOptions): UnaryCall<FindDataRequest, FindDataResponse> {
391
+ externalFindData(input: ExternalFindDataRequest, options?: RpcOptions): UnaryCall<ExternalFindDataRequest, ExternalFindDataResponse> {
376
392
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
377
- return stackIntercept<FindDataRequest, FindDataResponse>("unary", this._transport, method, opt, input);
393
+ return stackIntercept<ExternalFindDataRequest, ExternalFindDataResponse>("unary", this._transport, method, opt, input);
378
394
  }
379
395
  /**
380
396
  * @generated from protobuf rpc: externalStoreData(dht.ExternalStoreDataRequest) returns (dht.ExternalStoreDataResponse);
@@ -3,8 +3,8 @@
3
3
  // tslint:disable
4
4
  import { ExternalStoreDataResponse } from "./DhtRpc";
5
5
  import { ExternalStoreDataRequest } from "./DhtRpc";
6
- import { FindDataResponse } from "./DhtRpc";
7
- import { FindDataRequest } from "./DhtRpc";
6
+ import { ExternalFindDataResponse } from "./DhtRpc";
7
+ import { ExternalFindDataRequest } from "./DhtRpc";
8
8
  import { DisconnectNoticeResponse } from "./DhtRpc";
9
9
  import { DisconnectNotice } from "./DhtRpc";
10
10
  import { UnlockRequest } from "./DhtRpc";
@@ -13,10 +13,10 @@ import { LockRequest } from "./DhtRpc";
13
13
  import { IceCandidate } from "./DhtRpc";
14
14
  import { RtcAnswer } from "./DhtRpc";
15
15
  import { RtcOffer } from "./DhtRpc";
16
- import { WebRtcConnectionRequest } from "./DhtRpc";
17
- import { WebSocketConnectionResponse } from "./DhtRpc";
18
- import { WebSocketConnectionRequest } from "./DhtRpc";
19
- import { RecursiveFindReport } from "./DhtRpc";
16
+ import { WebrtcConnectionRequest } from "./DhtRpc";
17
+ import { WebsocketConnectionResponse } from "./DhtRpc";
18
+ import { WebsocketConnectionRequest } from "./DhtRpc";
19
+ import { FindResponse } from "./DhtRpc";
20
20
  import { DeleteDataResponse } from "./DhtRpc";
21
21
  import { DeleteDataRequest } from "./DhtRpc";
22
22
  import { MigrateDataResponse } from "./DhtRpc";
@@ -33,9 +33,9 @@ import { ClosestPeersResponse } from "./DhtRpc";
33
33
  import { ClosestPeersRequest } from "./DhtRpc";
34
34
  import { ServerCallContext } from "@protobuf-ts/runtime-rpc";
35
35
  /**
36
- * @generated from protobuf service dht.DhtRpcService
36
+ * @generated from protobuf service dht.DhtNodeRpc
37
37
  */
38
- export interface IDhtRpcService<T = ServerCallContext> {
38
+ export interface IDhtNodeRpc<T = ServerCallContext> {
39
39
  /**
40
40
  * @generated from protobuf rpc: getClosestPeers(dht.ClosestPeersRequest) returns (dht.ClosestPeersResponse);
41
41
  */
@@ -50,9 +50,9 @@ export interface IDhtRpcService<T = ServerCallContext> {
50
50
  leaveNotice(request: LeaveNotice, context: T): Promise<Empty>;
51
51
  }
52
52
  /**
53
- * @generated from protobuf service dht.RoutingService
53
+ * @generated from protobuf service dht.RouterRpc
54
54
  */
55
- export interface IRoutingService<T = ServerCallContext> {
55
+ export interface IRouterRpc<T = ServerCallContext> {
56
56
  /**
57
57
  * @generated from protobuf rpc: routeMessage(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
58
58
  */
@@ -61,15 +61,20 @@ export interface IRoutingService<T = ServerCallContext> {
61
61
  * @generated from protobuf rpc: forwardMessage(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
62
62
  */
63
63
  forwardMessage(request: RouteMessageWrapper, context: T): Promise<RouteMessageAck>;
64
+ }
65
+ /**
66
+ * @generated from protobuf service dht.FindRpc
67
+ */
68
+ export interface IFindRpc<T = ServerCallContext> {
64
69
  /**
65
- * @generated from protobuf rpc: findRecursively(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
70
+ * @generated from protobuf rpc: routeFindRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
66
71
  */
67
- findRecursively(request: RouteMessageWrapper, context: T): Promise<RouteMessageAck>;
72
+ routeFindRequest(request: RouteMessageWrapper, context: T): Promise<RouteMessageAck>;
68
73
  }
69
74
  /**
70
- * @generated from protobuf service dht.StoreService
75
+ * @generated from protobuf service dht.StoreRpc
71
76
  */
72
- export interface IStoreService<T = ServerCallContext> {
77
+ export interface IStoreRpc<T = ServerCallContext> {
73
78
  /**
74
79
  * @generated from protobuf rpc: storeData(dht.StoreDataRequest) returns (dht.StoreDataResponse);
75
80
  */
@@ -84,31 +89,31 @@ export interface IStoreService<T = ServerCallContext> {
84
89
  deleteData(request: DeleteDataRequest, context: T): Promise<DeleteDataResponse>;
85
90
  }
86
91
  /**
87
- * @generated from protobuf service dht.RecursiveFindSessionService
92
+ * @generated from protobuf service dht.FindSessionRpc
88
93
  */
89
- export interface IRecursiveFindSessionService<T = ServerCallContext> {
94
+ export interface IFindSessionRpc<T = ServerCallContext> {
90
95
  /**
91
- * @generated from protobuf rpc: reportRecursiveFindResult(dht.RecursiveFindReport) returns (google.protobuf.Empty);
96
+ * @generated from protobuf rpc: sendFindResponse(dht.FindResponse) returns (google.protobuf.Empty);
92
97
  */
93
- reportRecursiveFindResult(request: RecursiveFindReport, context: T): Promise<Empty>;
98
+ sendFindResponse(request: FindResponse, context: T): Promise<Empty>;
94
99
  }
95
100
  /**
96
- * @generated from protobuf service dht.WebSocketConnectorService
101
+ * @generated from protobuf service dht.WebsocketConnectorRpc
97
102
  */
98
- export interface IWebSocketConnectorService<T = ServerCallContext> {
103
+ export interface IWebsocketConnectorRpc<T = ServerCallContext> {
99
104
  /**
100
- * @generated from protobuf rpc: requestConnection(dht.WebSocketConnectionRequest) returns (dht.WebSocketConnectionResponse);
105
+ * @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (dht.WebsocketConnectionResponse);
101
106
  */
102
- requestConnection(request: WebSocketConnectionRequest, context: T): Promise<WebSocketConnectionResponse>;
107
+ requestConnection(request: WebsocketConnectionRequest, context: T): Promise<WebsocketConnectionResponse>;
103
108
  }
104
109
  /**
105
- * @generated from protobuf service dht.WebRtcConnectorService
110
+ * @generated from protobuf service dht.WebrtcConnectorRpc
106
111
  */
107
- export interface IWebRtcConnectorService<T = ServerCallContext> {
112
+ export interface IWebrtcConnectorRpc<T = ServerCallContext> {
108
113
  /**
109
- * @generated from protobuf rpc: requestConnection(dht.WebRtcConnectionRequest) returns (google.protobuf.Empty);
114
+ * @generated from protobuf rpc: requestConnection(dht.WebrtcConnectionRequest) returns (google.protobuf.Empty);
110
115
  */
111
- requestConnection(request: WebRtcConnectionRequest, context: T): Promise<Empty>;
116
+ requestConnection(request: WebrtcConnectionRequest, context: T): Promise<Empty>;
112
117
  /**
113
118
  * @generated from protobuf rpc: rtcOffer(dht.RtcOffer) returns (google.protobuf.Empty);
114
119
  */
@@ -123,9 +128,9 @@ export interface IWebRtcConnectorService<T = ServerCallContext> {
123
128
  iceCandidate(request: IceCandidate, context: T): Promise<Empty>;
124
129
  }
125
130
  /**
126
- * @generated from protobuf service dht.ConnectionLocker
131
+ * @generated from protobuf service dht.ConnectionLockRpc
127
132
  */
128
- export interface IConnectionLocker<T = ServerCallContext> {
133
+ export interface IConnectionLockRpc<T = ServerCallContext> {
129
134
  /**
130
135
  * @generated from protobuf rpc: lockRequest(dht.LockRequest) returns (dht.LockResponse);
131
136
  */
@@ -140,13 +145,13 @@ export interface IConnectionLocker<T = ServerCallContext> {
140
145
  gracefulDisconnect(request: DisconnectNotice, context: T): Promise<DisconnectNoticeResponse>;
141
146
  }
142
147
  /**
143
- * @generated from protobuf service dht.ExternalApiService
148
+ * @generated from protobuf service dht.ExternalApiRpc
144
149
  */
145
- export interface IExternalApiService<T = ServerCallContext> {
150
+ export interface IExternalApiRpc<T = ServerCallContext> {
146
151
  /**
147
- * @generated from protobuf rpc: findData(dht.FindDataRequest) returns (dht.FindDataResponse);
152
+ * @generated from protobuf rpc: externalFindData(dht.ExternalFindDataRequest) returns (dht.ExternalFindDataResponse);
148
153
  */
149
- findData(request: FindDataRequest, context: T): Promise<FindDataResponse>;
154
+ externalFindData(request: ExternalFindDataRequest, context: T): Promise<ExternalFindDataResponse>;
150
155
  /**
151
156
  * @generated from protobuf rpc: externalStoreData(dht.ExternalStoreDataRequest) returns (dht.ExternalStoreDataResponse);
152
157
  */