@streamr/dht 0.0.1-tatum.7 → 0.0.1-tatum.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/connection/ConnectionLockRpcRemote.d.ts +10 -0
- package/dist/src/connection/{RemoteConnectionLocker.js → ConnectionLockRpcRemote.js} +20 -35
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -0
- package/dist/src/connection/ConnectionManager.d.ts +0 -1
- package/dist/src/connection/ConnectionManager.js +27 -25
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectivityChecker.js +4 -4
- package/dist/src/connection/ConnectivityChecker.js.map +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +1 -1
- package/dist/src/connection/ConnectorFacade.js +5 -8
- package/dist/src/connection/ConnectorFacade.js.map +1 -1
- package/dist/src/connection/Handshaker.d.ts +1 -2
- package/dist/src/connection/Handshaker.js +1 -4
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +1 -2
- package/dist/src/connection/ManagedConnection.js +4 -5
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/ManagedWebRtcConnection.d.ts +1 -1
- package/dist/src/connection/ManagedWebRtcConnection.js +2 -2
- package/dist/src/connection/ManagedWebRtcConnection.js.map +1 -1
- package/dist/src/connection/Simulator/SimulatorConnector.d.ts +1 -2
- package/dist/src/connection/Simulator/SimulatorConnector.js +3 -4
- package/dist/src/connection/Simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/WebRTC/NodeWebRtcConnection.d.ts +1 -1
- package/dist/src/connection/WebRTC/{WebRtcConnector.d.ts → WebRtcConnectorRpcLocal.d.ts} +9 -9
- package/dist/src/connection/WebRTC/{WebRtcConnector.js → WebRtcConnectorRpcLocal.js} +38 -30
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcLocal.js.map +1 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.d.ts +11 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.js +55 -0
- package/dist/src/connection/WebRTC/WebRtcConnectorRpcRemote.js.map +1 -0
- package/dist/src/connection/WebRTC/iceServerAsString.d.ts +1 -1
- package/dist/src/connection/WebSocket/{WebSocketConnector.d.ts → WebSocketConnectorRpcLocal.d.ts} +6 -7
- package/dist/src/connection/WebSocket/{WebSocketConnector.js → WebSocketConnectorRpcLocal.js} +20 -20
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcLocal.js.map +1 -0
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcRemote.d.ts +8 -0
- package/dist/src/connection/WebSocket/{RemoteWebSocketConnector.js → WebSocketConnectorRpcRemote.js} +11 -16
- package/dist/src/connection/WebSocket/WebSocketConnectorRpcRemote.js.map +1 -0
- package/dist/src/dht/DhtNode.d.ts +6 -7
- package/dist/src/dht/DhtNode.js +22 -23
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/{RemoteExternalApi.d.ts → ExternalApiRpcRemote.d.ts} +2 -2
- package/dist/src/dht/{RemoteExternalApi.js → ExternalApiRpcRemote.js} +5 -6
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -0
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.js +3 -2
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/find/RecursiveFindSession.d.ts +5 -5
- package/dist/src/dht/find/RecursiveFindSession.js +7 -7
- package/dist/src/dht/find/RecursiveFindSession.js.map +1 -1
- package/dist/src/dht/find/RecursiveFinder.d.ts +7 -7
- package/dist/src/dht/find/RecursiveFinder.js +24 -24
- package/dist/src/dht/find/RecursiveFinder.js.map +1 -1
- package/dist/src/dht/find/RemoteRecursiveFindSession.d.ts +1 -1
- package/dist/src/dht/find/RemoteRecursiveFindSession.js +4 -4
- package/dist/src/dht/find/RemoteRecursiveFindSession.js.map +1 -1
- package/dist/src/dht/registerExternalApiRpcMethods.js +4 -3
- package/dist/src/dht/registerExternalApiRpcMethods.js.map +1 -1
- package/dist/src/dht/routing/Router.d.ts +2 -2
- package/dist/src/dht/routing/Router.js +2 -4
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/{RemoteRouter.d.ts → RouterRpcRemote.d.ts} +2 -2
- package/dist/src/dht/routing/{RemoteRouter.js → RouterRpcRemote.js} +4 -4
- package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -0
- package/dist/src/dht/routing/RoutingSession.js +2 -2
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/store/{DataStore.d.ts → StoreRpcLocal.d.ts} +4 -4
- package/dist/src/dht/store/{DataStore.js → StoreRpcLocal.js} +27 -27
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -0
- package/dist/src/dht/store/{RemoteStore.d.ts → StoreRpcRemote.d.ts} +2 -2
- package/dist/src/dht/store/{RemoteStore.js → StoreRpcRemote.js} +4 -4
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -0
- package/dist/src/exports.d.ts +1 -1
- package/dist/src/helpers/protoClasses.js +2 -2
- package/dist/src/helpers/protoClasses.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +29 -29
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +39 -39
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +49 -158
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +46 -86
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +15 -15
- package/dist/src/transport/RoutingRpcCommunicator.js +1 -0
- package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
- package/package.json +4 -4
- package/protos/DhtRpc.proto +30 -59
- package/src/connection/ConnectionLockRpcRemote.ts +62 -0
- package/src/connection/ConnectionManager.ts +33 -32
- package/src/connection/ConnectivityChecker.ts +1 -1
- package/src/connection/ConnectorFacade.ts +7 -10
- package/src/connection/Handshaker.ts +0 -5
- package/src/connection/ManagedConnection.ts +3 -6
- package/src/connection/ManagedWebRtcConnection.ts +0 -2
- package/src/connection/Simulator/SimulatorConnector.ts +2 -7
- package/src/connection/WebRTC/NodeWebRtcConnection.ts +1 -1
- package/src/connection/WebRTC/{WebRtcConnector.ts → WebRtcConnectorRpcLocal.ts} +46 -34
- package/src/connection/WebRTC/WebRtcConnectorRpcRemote.ts +71 -0
- package/src/connection/WebRTC/iceServerAsString.ts +1 -1
- package/src/connection/WebSocket/{WebSocketConnector.ts → WebSocketConnectorRpcLocal.ts} +26 -26
- package/src/connection/WebSocket/{RemoteWebSocketConnector.ts → WebSocketConnectorRpcRemote.ts} +13 -18
- package/src/dht/DhtNode.ts +32 -33
- package/src/dht/{RemoteExternalApi.ts → ExternalApiRpcRemote.ts} +3 -4
- package/src/dht/discovery/PeerDiscovery.ts +4 -3
- package/src/dht/find/RecursiveFindSession.ts +11 -11
- package/src/dht/find/RecursiveFinder.ts +29 -30
- package/src/dht/find/RemoteRecursiveFindSession.ts +6 -6
- package/src/dht/registerExternalApiRpcMethods.ts +7 -4
- package/src/dht/routing/Router.ts +4 -6
- package/src/dht/routing/{RemoteRouter.ts → RouterRpcRemote.ts} +2 -2
- package/src/dht/routing/RoutingSession.ts +6 -6
- package/src/dht/store/{DataStore.ts → StoreRpcLocal.ts} +31 -31
- package/src/dht/store/{RemoteStore.ts → StoreRpcRemote.ts} +2 -2
- package/src/exports.ts +1 -1
- package/src/helpers/protoClasses.ts +4 -4
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +54 -54
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +15 -15
- package/src/proto/packages/dht/protos/DhtRpc.ts +76 -210
- package/src/transport/RoutingRpcCommunicator.ts +1 -0
- package/test/integration/{RemoteRouter.test.ts → RouterRpcRemote.test.ts} +8 -8
- package/test/integration/{RemoteStore.test.ts → StoreRpcRemote.test.ts} +13 -13
- package/test/integration/WebRtcConnectorRpc.test.ts +11 -24
- package/test/integration/WebSocketConnectorRpc.test.ts +8 -12
- package/test/unit/RecursiveFinder.test.ts +5 -6
- package/test/unit/{WebSocketConnector.test.ts → WebSocketConnectorRpcLocal.test.ts} +3 -3
- package/test/unit/webrtcReplaceInternalIpWithExternalIp.test.ts +1 -1
- package/test/utils/utils.ts +16 -26
- package/dist/src/connection/RemoteConnectionLocker.d.ts +0 -13
- package/dist/src/connection/RemoteConnectionLocker.js.map +0 -1
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.d.ts +0 -12
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.js +0 -74
- package/dist/src/connection/WebRTC/RemoteWebrtcConnector.js.map +0 -1
- package/dist/src/connection/WebRTC/WebRtcConnector.js.map +0 -1
- package/dist/src/connection/WebSocket/RemoteWebSocketConnector.d.ts +0 -9
- package/dist/src/connection/WebSocket/RemoteWebSocketConnector.js.map +0 -1
- package/dist/src/connection/WebSocket/WebSocketConnector.js.map +0 -1
- package/dist/src/dht/RemoteExternalApi.js.map +0 -1
- package/dist/src/dht/routing/RemoteRouter.js.map +0 -1
- package/dist/src/dht/store/DataStore.js.map +0 -1
- package/dist/src/dht/store/RemoteStore.js.map +0 -1
- package/src/connection/RemoteConnectionLocker.ts +0 -85
- package/src/connection/WebRTC/RemoteWebrtcConnector.ts +0 -93
|
@@ -161,26 +161,26 @@ export interface ClosestPeersResponse {
|
|
|
161
161
|
requestId: string;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* @generated from protobuf message dht.
|
|
164
|
+
* @generated from protobuf message dht.FindRequest
|
|
165
165
|
*/
|
|
166
|
-
export interface
|
|
166
|
+
export interface FindRequest {
|
|
167
167
|
/**
|
|
168
|
-
* @generated from protobuf field: string
|
|
168
|
+
* @generated from protobuf field: string sessionId = 1;
|
|
169
169
|
*/
|
|
170
|
-
|
|
170
|
+
sessionId: string;
|
|
171
171
|
/**
|
|
172
|
-
* @generated from protobuf field:
|
|
172
|
+
* @generated from protobuf field: bool fetchData = 2;
|
|
173
173
|
*/
|
|
174
|
-
|
|
174
|
+
fetchData: boolean;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* @generated from protobuf message dht.
|
|
177
|
+
* @generated from protobuf message dht.FindResponse
|
|
178
178
|
*/
|
|
179
|
-
export interface
|
|
179
|
+
export interface FindResponse {
|
|
180
180
|
/**
|
|
181
|
-
* @generated from protobuf field: repeated dht.PeerDescriptor
|
|
181
|
+
* @generated from protobuf field: repeated dht.PeerDescriptor closestConnectedPeers = 1;
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
closestConnectedPeers: PeerDescriptor[];
|
|
184
184
|
/**
|
|
185
185
|
* @generated from protobuf field: repeated dht.DataEntry dataEntries = 2;
|
|
186
186
|
*/
|
|
@@ -309,19 +309,11 @@ export interface RouteMessageWrapper {
|
|
|
309
309
|
*/
|
|
310
310
|
export interface RouteMessageAck {
|
|
311
311
|
/**
|
|
312
|
-
* @generated from protobuf field:
|
|
313
|
-
*/
|
|
314
|
-
sourcePeer?: PeerDescriptor;
|
|
315
|
-
/**
|
|
316
|
-
* @generated from protobuf field: string requestId = 2;
|
|
312
|
+
* @generated from protobuf field: string requestId = 1;
|
|
317
313
|
*/
|
|
318
314
|
requestId: string;
|
|
319
315
|
/**
|
|
320
|
-
* @generated from protobuf field:
|
|
321
|
-
*/
|
|
322
|
-
destinationPeer?: PeerDescriptor;
|
|
323
|
-
/**
|
|
324
|
-
* @generated from protobuf field: string error = 4;
|
|
316
|
+
* @generated from protobuf field: string error = 2;
|
|
325
317
|
*/
|
|
326
318
|
error: string;
|
|
327
319
|
}
|
|
@@ -374,11 +366,7 @@ export interface HandshakeRequest {
|
|
|
374
366
|
*/
|
|
375
367
|
sourceId: Uint8Array;
|
|
376
368
|
/**
|
|
377
|
-
* @generated from protobuf field:
|
|
378
|
-
*/
|
|
379
|
-
protocolVersion: string;
|
|
380
|
-
/**
|
|
381
|
-
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 3;
|
|
369
|
+
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 2;
|
|
382
370
|
*/
|
|
383
371
|
peerDescriptor?: PeerDescriptor;
|
|
384
372
|
}
|
|
@@ -391,15 +379,11 @@ export interface HandshakeResponse {
|
|
|
391
379
|
*/
|
|
392
380
|
sourceId: Uint8Array;
|
|
393
381
|
/**
|
|
394
|
-
* @generated from protobuf field:
|
|
395
|
-
*/
|
|
396
|
-
protocolVersion: string;
|
|
397
|
-
/**
|
|
398
|
-
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 3;
|
|
382
|
+
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 2;
|
|
399
383
|
*/
|
|
400
384
|
peerDescriptor?: PeerDescriptor;
|
|
401
385
|
/**
|
|
402
|
-
* @generated from protobuf field: optional string responseError =
|
|
386
|
+
* @generated from protobuf field: optional string responseError = 3;
|
|
403
387
|
*/
|
|
404
388
|
responseError?: string;
|
|
405
389
|
}
|
|
@@ -461,11 +445,11 @@ export interface Message {
|
|
|
461
445
|
*/
|
|
462
446
|
rpcMessage: RpcMessage;
|
|
463
447
|
} | {
|
|
464
|
-
oneofKind: "
|
|
448
|
+
oneofKind: "findRequest";
|
|
465
449
|
/**
|
|
466
|
-
* @generated from protobuf field: dht.
|
|
450
|
+
* @generated from protobuf field: dht.FindRequest findRequest = 11;
|
|
467
451
|
*/
|
|
468
|
-
|
|
452
|
+
findRequest: FindRequest;
|
|
469
453
|
} | {
|
|
470
454
|
oneofKind: undefined;
|
|
471
455
|
};
|
|
@@ -479,19 +463,11 @@ export interface Message {
|
|
|
479
463
|
*/
|
|
480
464
|
export interface WebSocketConnectionRequest {
|
|
481
465
|
/**
|
|
482
|
-
* @generated from protobuf field:
|
|
483
|
-
*/
|
|
484
|
-
requester?: PeerDescriptor;
|
|
485
|
-
/**
|
|
486
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 2;
|
|
487
|
-
*/
|
|
488
|
-
target?: PeerDescriptor;
|
|
489
|
-
/**
|
|
490
|
-
* @generated from protobuf field: string ip = 3;
|
|
466
|
+
* @generated from protobuf field: string ip = 1;
|
|
491
467
|
*/
|
|
492
468
|
ip: string;
|
|
493
469
|
/**
|
|
494
|
-
* @generated from protobuf field: uint32 port =
|
|
470
|
+
* @generated from protobuf field: uint32 port = 2;
|
|
495
471
|
*/
|
|
496
472
|
port: number;
|
|
497
473
|
}
|
|
@@ -500,19 +476,11 @@ export interface WebSocketConnectionRequest {
|
|
|
500
476
|
*/
|
|
501
477
|
export interface WebSocketConnectionResponse {
|
|
502
478
|
/**
|
|
503
|
-
* @generated from protobuf field:
|
|
504
|
-
*/
|
|
505
|
-
requester?: PeerDescriptor;
|
|
506
|
-
/**
|
|
507
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 2;
|
|
508
|
-
*/
|
|
509
|
-
target?: PeerDescriptor;
|
|
510
|
-
/**
|
|
511
|
-
* @generated from protobuf field: bool accepted = 3;
|
|
479
|
+
* @generated from protobuf field: bool accepted = 1;
|
|
512
480
|
*/
|
|
513
481
|
accepted: boolean;
|
|
514
482
|
/**
|
|
515
|
-
* @generated from protobuf field: optional string reason =
|
|
483
|
+
* @generated from protobuf field: optional string reason = 2;
|
|
516
484
|
*/
|
|
517
485
|
reason?: string;
|
|
518
486
|
}
|
|
@@ -523,15 +491,7 @@ export interface WebSocketConnectionResponse {
|
|
|
523
491
|
*/
|
|
524
492
|
export interface WebRtcConnectionRequest {
|
|
525
493
|
/**
|
|
526
|
-
* @generated from protobuf field:
|
|
527
|
-
*/
|
|
528
|
-
requester?: PeerDescriptor;
|
|
529
|
-
/**
|
|
530
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 2;
|
|
531
|
-
*/
|
|
532
|
-
target?: PeerDescriptor;
|
|
533
|
-
/**
|
|
534
|
-
* @generated from protobuf field: string connectionId = 3;
|
|
494
|
+
* @generated from protobuf field: string connectionId = 1;
|
|
535
495
|
*/
|
|
536
496
|
connectionId: string;
|
|
537
497
|
}
|
|
@@ -540,19 +500,11 @@ export interface WebRtcConnectionRequest {
|
|
|
540
500
|
*/
|
|
541
501
|
export interface RtcOffer {
|
|
542
502
|
/**
|
|
543
|
-
* @generated from protobuf field:
|
|
544
|
-
*/
|
|
545
|
-
requester?: PeerDescriptor;
|
|
546
|
-
/**
|
|
547
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 2;
|
|
548
|
-
*/
|
|
549
|
-
target?: PeerDescriptor;
|
|
550
|
-
/**
|
|
551
|
-
* @generated from protobuf field: string description = 3;
|
|
503
|
+
* @generated from protobuf field: string description = 1;
|
|
552
504
|
*/
|
|
553
505
|
description: string;
|
|
554
506
|
/**
|
|
555
|
-
* @generated from protobuf field: string connectionId =
|
|
507
|
+
* @generated from protobuf field: string connectionId = 2;
|
|
556
508
|
*/
|
|
557
509
|
connectionId: string;
|
|
558
510
|
}
|
|
@@ -561,19 +513,11 @@ export interface RtcOffer {
|
|
|
561
513
|
*/
|
|
562
514
|
export interface RtcAnswer {
|
|
563
515
|
/**
|
|
564
|
-
* @generated from protobuf field:
|
|
565
|
-
*/
|
|
566
|
-
requester?: PeerDescriptor;
|
|
567
|
-
/**
|
|
568
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 2;
|
|
569
|
-
*/
|
|
570
|
-
target?: PeerDescriptor;
|
|
571
|
-
/**
|
|
572
|
-
* @generated from protobuf field: string description = 3;
|
|
516
|
+
* @generated from protobuf field: string description = 1;
|
|
573
517
|
*/
|
|
574
518
|
description: string;
|
|
575
519
|
/**
|
|
576
|
-
* @generated from protobuf field: string connectionId =
|
|
520
|
+
* @generated from protobuf field: string connectionId = 2;
|
|
577
521
|
*/
|
|
578
522
|
connectionId: string;
|
|
579
523
|
}
|
|
@@ -593,29 +537,13 @@ export interface IceCandidate {
|
|
|
593
537
|
* @generated from protobuf field: string connectionId = 3;
|
|
594
538
|
*/
|
|
595
539
|
connectionId: string;
|
|
596
|
-
/**
|
|
597
|
-
* @generated from protobuf field: dht.PeerDescriptor requester = 4;
|
|
598
|
-
*/
|
|
599
|
-
requester?: PeerDescriptor;
|
|
600
|
-
/**
|
|
601
|
-
* @generated from protobuf field: dht.PeerDescriptor target = 5;
|
|
602
|
-
*/
|
|
603
|
-
target?: PeerDescriptor;
|
|
604
540
|
}
|
|
605
541
|
/**
|
|
606
542
|
* @generated from protobuf message dht.LockRequest
|
|
607
543
|
*/
|
|
608
544
|
export interface LockRequest {
|
|
609
545
|
/**
|
|
610
|
-
* @generated from protobuf field: string
|
|
611
|
-
*/
|
|
612
|
-
protocolVersion: string;
|
|
613
|
-
/**
|
|
614
|
-
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 2;
|
|
615
|
-
*/
|
|
616
|
-
peerDescriptor?: PeerDescriptor;
|
|
617
|
-
/**
|
|
618
|
-
* @generated from protobuf field: string serviceId = 3;
|
|
546
|
+
* @generated from protobuf field: string serviceId = 1;
|
|
619
547
|
*/
|
|
620
548
|
serviceId: string;
|
|
621
549
|
}
|
|
@@ -624,15 +552,7 @@ export interface LockRequest {
|
|
|
624
552
|
*/
|
|
625
553
|
export interface UnlockRequest {
|
|
626
554
|
/**
|
|
627
|
-
* @generated from protobuf field: string
|
|
628
|
-
*/
|
|
629
|
-
protocolVersion: string;
|
|
630
|
-
/**
|
|
631
|
-
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 2;
|
|
632
|
-
*/
|
|
633
|
-
peerDescriptor?: PeerDescriptor;
|
|
634
|
-
/**
|
|
635
|
-
* @generated from protobuf field: string serviceId = 3;
|
|
555
|
+
* @generated from protobuf field: string serviceId = 1;
|
|
636
556
|
*/
|
|
637
557
|
serviceId: string;
|
|
638
558
|
}
|
|
@@ -654,26 +574,14 @@ export interface LockResponse {
|
|
|
654
574
|
*/
|
|
655
575
|
export interface DisconnectNotice {
|
|
656
576
|
/**
|
|
657
|
-
* @generated from protobuf field:
|
|
658
|
-
*/
|
|
659
|
-
protocolVersion: string;
|
|
660
|
-
/**
|
|
661
|
-
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 2;
|
|
577
|
+
* @generated from protobuf field: dht.DisconnectMode disconnectMode = 1;
|
|
662
578
|
*/
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* @generated from protobuf field: dht.DisconnectMode disconnecMode = 3;
|
|
666
|
-
*/
|
|
667
|
-
disconnecMode: DisconnectMode;
|
|
579
|
+
disconnectMode: DisconnectMode;
|
|
668
580
|
}
|
|
669
581
|
/**
|
|
670
582
|
* @generated from protobuf message dht.DisconnectNoticeResponse
|
|
671
583
|
*/
|
|
672
584
|
export interface DisconnectNoticeResponse {
|
|
673
|
-
/**
|
|
674
|
-
* @generated from protobuf field: string protocolVersion = 1;
|
|
675
|
-
*/
|
|
676
|
-
protocolVersion: string;
|
|
677
585
|
}
|
|
678
586
|
/**
|
|
679
587
|
* @generated from protobuf message dht.FindDataRequest
|
|
@@ -683,10 +591,6 @@ export interface FindDataRequest {
|
|
|
683
591
|
* @generated from protobuf field: bytes kademliaId = 1;
|
|
684
592
|
*/
|
|
685
593
|
kademliaId: Uint8Array;
|
|
686
|
-
/**
|
|
687
|
-
* @generated from protobuf field: dht.PeerDescriptor requestor = 2;
|
|
688
|
-
*/
|
|
689
|
-
requestor?: PeerDescriptor;
|
|
690
594
|
}
|
|
691
595
|
/**
|
|
692
596
|
* @generated from protobuf message dht.FindDataResponse
|
|
@@ -701,19 +605,6 @@ export interface FindDataResponse {
|
|
|
701
605
|
*/
|
|
702
606
|
error?: string;
|
|
703
607
|
}
|
|
704
|
-
/**
|
|
705
|
-
* @generated from protobuf enum dht.FindMode
|
|
706
|
-
*/
|
|
707
|
-
export enum FindMode {
|
|
708
|
-
/**
|
|
709
|
-
* @generated from protobuf enum value: NODE = 0;
|
|
710
|
-
*/
|
|
711
|
-
NODE = 0,
|
|
712
|
-
/**
|
|
713
|
-
* @generated from protobuf enum value: DATA = 1;
|
|
714
|
-
*/
|
|
715
|
-
DATA = 1
|
|
716
|
-
}
|
|
717
608
|
/**
|
|
718
609
|
* @generated from protobuf enum dht.NodeType
|
|
719
610
|
*/
|
|
@@ -942,23 +833,23 @@ class ClosestPeersResponse$Type extends MessageType$<ClosestPeersResponse> {
|
|
|
942
833
|
*/
|
|
943
834
|
export const ClosestPeersResponse = new ClosestPeersResponse$Type();
|
|
944
835
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
945
|
-
class
|
|
836
|
+
class FindRequest$Type extends MessageType$<FindRequest> {
|
|
946
837
|
constructor() {
|
|
947
|
-
super("dht.
|
|
948
|
-
{ no: 1, name: "
|
|
949
|
-
{ no: 2, name: "
|
|
838
|
+
super("dht.FindRequest", [
|
|
839
|
+
{ no: 1, name: "sessionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
840
|
+
{ no: 2, name: "fetchData", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
950
841
|
]);
|
|
951
842
|
}
|
|
952
843
|
}
|
|
953
844
|
/**
|
|
954
|
-
* @generated MessageType for protobuf message dht.
|
|
845
|
+
* @generated MessageType for protobuf message dht.FindRequest
|
|
955
846
|
*/
|
|
956
|
-
export const
|
|
847
|
+
export const FindRequest = new FindRequest$Type();
|
|
957
848
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
958
|
-
class
|
|
849
|
+
class FindResponse$Type extends MessageType$<FindResponse> {
|
|
959
850
|
constructor() {
|
|
960
|
-
super("dht.
|
|
961
|
-
{ no: 1, name: "
|
|
851
|
+
super("dht.FindResponse", [
|
|
852
|
+
{ no: 1, name: "closestConnectedPeers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
962
853
|
{ no: 2, name: "dataEntries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataEntry },
|
|
963
854
|
{ no: 3, name: "noCloserNodesFound", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
|
|
964
855
|
{ no: 4, name: "routingPath", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor }
|
|
@@ -966,9 +857,9 @@ class RecursiveFindReport$Type extends MessageType$<RecursiveFindReport> {
|
|
|
966
857
|
}
|
|
967
858
|
}
|
|
968
859
|
/**
|
|
969
|
-
* @generated MessageType for protobuf message dht.
|
|
860
|
+
* @generated MessageType for protobuf message dht.FindResponse
|
|
970
861
|
*/
|
|
971
|
-
export const
|
|
862
|
+
export const FindResponse = new FindResponse$Type();
|
|
972
863
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
973
864
|
class PingRequest$Type extends MessageType$<PingRequest> {
|
|
974
865
|
constructor() {
|
|
@@ -1059,10 +950,8 @@ export const RouteMessageWrapper = new RouteMessageWrapper$Type();
|
|
|
1059
950
|
class RouteMessageAck$Type extends MessageType$<RouteMessageAck> {
|
|
1060
951
|
constructor() {
|
|
1061
952
|
super("dht.RouteMessageAck", [
|
|
1062
|
-
{ no: 1, name: "
|
|
1063
|
-
{ no: 2, name: "
|
|
1064
|
-
{ no: 3, name: "destinationPeer", kind: "message", T: () => PeerDescriptor },
|
|
1065
|
-
{ no: 4, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
953
|
+
{ no: 1, name: "requestId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
954
|
+
{ no: 2, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1066
955
|
]);
|
|
1067
956
|
}
|
|
1068
957
|
}
|
|
@@ -1104,8 +993,7 @@ class HandshakeRequest$Type extends MessageType$<HandshakeRequest> {
|
|
|
1104
993
|
constructor() {
|
|
1105
994
|
super("dht.HandshakeRequest", [
|
|
1106
995
|
{ no: 1, name: "sourceId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
1107
|
-
{ no: 2, name: "
|
|
1108
|
-
{ no: 3, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor }
|
|
996
|
+
{ no: 2, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor }
|
|
1109
997
|
]);
|
|
1110
998
|
}
|
|
1111
999
|
}
|
|
@@ -1118,9 +1006,8 @@ class HandshakeResponse$Type extends MessageType$<HandshakeResponse> {
|
|
|
1118
1006
|
constructor() {
|
|
1119
1007
|
super("dht.HandshakeResponse", [
|
|
1120
1008
|
{ no: 1, name: "sourceId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
1121
|
-
{ no: 2, name: "
|
|
1122
|
-
{ no: 3, name: "
|
|
1123
|
-
{ no: 4, name: "responseError", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
1009
|
+
{ no: 2, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
1010
|
+
{ no: 3, name: "responseError", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
1124
1011
|
]);
|
|
1125
1012
|
}
|
|
1126
1013
|
}
|
|
@@ -1142,7 +1029,7 @@ class Message$Type extends MessageType$<Message> {
|
|
|
1142
1029
|
{ no: 8, name: "handshakeRequest", kind: "message", oneof: "body", T: () => HandshakeRequest },
|
|
1143
1030
|
{ no: 9, name: "handshakeResponse", kind: "message", oneof: "body", T: () => HandshakeResponse },
|
|
1144
1031
|
{ no: 10, name: "rpcMessage", kind: "message", oneof: "body", T: () => RpcMessage },
|
|
1145
|
-
{ no: 11, name: "
|
|
1032
|
+
{ no: 11, name: "findRequest", kind: "message", oneof: "body", T: () => FindRequest }
|
|
1146
1033
|
]);
|
|
1147
1034
|
}
|
|
1148
1035
|
}
|
|
@@ -1154,10 +1041,8 @@ export const Message = new Message$Type();
|
|
|
1154
1041
|
class WebSocketConnectionRequest$Type extends MessageType$<WebSocketConnectionRequest> {
|
|
1155
1042
|
constructor() {
|
|
1156
1043
|
super("dht.WebSocketConnectionRequest", [
|
|
1157
|
-
{ no: 1, name: "
|
|
1158
|
-
{ no: 2, name: "
|
|
1159
|
-
{ no: 3, name: "ip", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1160
|
-
{ no: 4, name: "port", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
1044
|
+
{ no: 1, name: "ip", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1045
|
+
{ no: 2, name: "port", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
1161
1046
|
]);
|
|
1162
1047
|
}
|
|
1163
1048
|
}
|
|
@@ -1169,10 +1054,8 @@ export const WebSocketConnectionRequest = new WebSocketConnectionRequest$Type();
|
|
|
1169
1054
|
class WebSocketConnectionResponse$Type extends MessageType$<WebSocketConnectionResponse> {
|
|
1170
1055
|
constructor() {
|
|
1171
1056
|
super("dht.WebSocketConnectionResponse", [
|
|
1172
|
-
{ no: 1, name: "
|
|
1173
|
-
{ no: 2, name: "
|
|
1174
|
-
{ no: 3, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
1175
|
-
{ no: 4, name: "reason", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
1057
|
+
{ no: 1, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
1058
|
+
{ no: 2, name: "reason", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
1176
1059
|
]);
|
|
1177
1060
|
}
|
|
1178
1061
|
}
|
|
@@ -1184,9 +1067,7 @@ export const WebSocketConnectionResponse = new WebSocketConnectionResponse$Type(
|
|
|
1184
1067
|
class WebRtcConnectionRequest$Type extends MessageType$<WebRtcConnectionRequest> {
|
|
1185
1068
|
constructor() {
|
|
1186
1069
|
super("dht.WebRtcConnectionRequest", [
|
|
1187
|
-
{ no: 1, name: "
|
|
1188
|
-
{ no: 2, name: "target", kind: "message", T: () => PeerDescriptor },
|
|
1189
|
-
{ no: 3, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1070
|
+
{ no: 1, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1190
1071
|
]);
|
|
1191
1072
|
}
|
|
1192
1073
|
}
|
|
@@ -1198,10 +1079,8 @@ export const WebRtcConnectionRequest = new WebRtcConnectionRequest$Type();
|
|
|
1198
1079
|
class RtcOffer$Type extends MessageType$<RtcOffer> {
|
|
1199
1080
|
constructor() {
|
|
1200
1081
|
super("dht.RtcOffer", [
|
|
1201
|
-
{ no: 1, name: "
|
|
1202
|
-
{ no: 2, name: "
|
|
1203
|
-
{ no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1204
|
-
{ no: 4, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1082
|
+
{ no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1083
|
+
{ no: 2, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1205
1084
|
]);
|
|
1206
1085
|
}
|
|
1207
1086
|
}
|
|
@@ -1213,10 +1092,8 @@ export const RtcOffer = new RtcOffer$Type();
|
|
|
1213
1092
|
class RtcAnswer$Type extends MessageType$<RtcAnswer> {
|
|
1214
1093
|
constructor() {
|
|
1215
1094
|
super("dht.RtcAnswer", [
|
|
1216
|
-
{ no: 1, name: "
|
|
1217
|
-
{ no: 2, name: "
|
|
1218
|
-
{ no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1219
|
-
{ no: 4, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1095
|
+
{ no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1096
|
+
{ no: 2, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1220
1097
|
]);
|
|
1221
1098
|
}
|
|
1222
1099
|
}
|
|
@@ -1230,9 +1107,7 @@ class IceCandidate$Type extends MessageType$<IceCandidate> {
|
|
|
1230
1107
|
super("dht.IceCandidate", [
|
|
1231
1108
|
{ no: 1, name: "candidate", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1232
1109
|
{ no: 2, name: "mid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
1233
|
-
{ no: 3, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1234
|
-
{ no: 4, name: "requester", kind: "message", T: () => PeerDescriptor },
|
|
1235
|
-
{ no: 5, name: "target", kind: "message", T: () => PeerDescriptor }
|
|
1110
|
+
{ no: 3, name: "connectionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1236
1111
|
]);
|
|
1237
1112
|
}
|
|
1238
1113
|
}
|
|
@@ -1244,9 +1119,7 @@ export const IceCandidate = new IceCandidate$Type();
|
|
|
1244
1119
|
class LockRequest$Type extends MessageType$<LockRequest> {
|
|
1245
1120
|
constructor() {
|
|
1246
1121
|
super("dht.LockRequest", [
|
|
1247
|
-
{ no: 1, name: "
|
|
1248
|
-
{ no: 2, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
1249
|
-
{ no: 3, name: "serviceId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1122
|
+
{ no: 1, name: "serviceId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1250
1123
|
]);
|
|
1251
1124
|
}
|
|
1252
1125
|
}
|
|
@@ -1258,9 +1131,7 @@ export const LockRequest = new LockRequest$Type();
|
|
|
1258
1131
|
class UnlockRequest$Type extends MessageType$<UnlockRequest> {
|
|
1259
1132
|
constructor() {
|
|
1260
1133
|
super("dht.UnlockRequest", [
|
|
1261
|
-
{ no: 1, name: "
|
|
1262
|
-
{ no: 2, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
1263
|
-
{ no: 3, name: "serviceId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1134
|
+
{ no: 1, name: "serviceId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1264
1135
|
]);
|
|
1265
1136
|
}
|
|
1266
1137
|
}
|
|
@@ -1285,9 +1156,7 @@ export const LockResponse = new LockResponse$Type();
|
|
|
1285
1156
|
class DisconnectNotice$Type extends MessageType$<DisconnectNotice> {
|
|
1286
1157
|
constructor() {
|
|
1287
1158
|
super("dht.DisconnectNotice", [
|
|
1288
|
-
{ no: 1, name: "
|
|
1289
|
-
{ no: 2, name: "peerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
1290
|
-
{ no: 3, name: "disconnecMode", kind: "enum", T: () => ["dht.DisconnectMode", DisconnectMode] }
|
|
1159
|
+
{ no: 1, name: "disconnectMode", kind: "enum", T: () => ["dht.DisconnectMode", DisconnectMode] }
|
|
1291
1160
|
]);
|
|
1292
1161
|
}
|
|
1293
1162
|
}
|
|
@@ -1298,9 +1167,7 @@ export const DisconnectNotice = new DisconnectNotice$Type();
|
|
|
1298
1167
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
1299
1168
|
class DisconnectNoticeResponse$Type extends MessageType$<DisconnectNoticeResponse> {
|
|
1300
1169
|
constructor() {
|
|
1301
|
-
super("dht.DisconnectNoticeResponse", [
|
|
1302
|
-
{ no: 1, name: "protocolVersion", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
1303
|
-
]);
|
|
1170
|
+
super("dht.DisconnectNoticeResponse", []);
|
|
1304
1171
|
}
|
|
1305
1172
|
}
|
|
1306
1173
|
/**
|
|
@@ -1311,8 +1178,7 @@ export const DisconnectNoticeResponse = new DisconnectNoticeResponse$Type();
|
|
|
1311
1178
|
class FindDataRequest$Type extends MessageType$<FindDataRequest> {
|
|
1312
1179
|
constructor() {
|
|
1313
1180
|
super("dht.FindDataRequest", [
|
|
1314
|
-
{ no: 1, name: "kademliaId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
1315
|
-
{ no: 2, name: "requestor", kind: "message", T: () => PeerDescriptor }
|
|
1181
|
+
{ no: 1, name: "kademliaId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
1316
1182
|
]);
|
|
1317
1183
|
}
|
|
1318
1184
|
}
|
|
@@ -1342,17 +1208,17 @@ export const DhtRpcService = new ServiceType("dht.DhtRpcService", [
|
|
|
1342
1208
|
{ name: "leaveNotice", options: {}, I: LeaveNotice, O: Empty }
|
|
1343
1209
|
]);
|
|
1344
1210
|
/**
|
|
1345
|
-
* @generated ServiceType for protobuf service dht.
|
|
1211
|
+
* @generated ServiceType for protobuf service dht.RouterRpc
|
|
1346
1212
|
*/
|
|
1347
|
-
export const
|
|
1213
|
+
export const RouterRpc = new ServiceType("dht.RouterRpc", [
|
|
1348
1214
|
{ name: "routeMessage", options: {}, I: RouteMessageWrapper, O: RouteMessageAck },
|
|
1349
1215
|
{ name: "forwardMessage", options: {}, I: RouteMessageWrapper, O: RouteMessageAck },
|
|
1350
1216
|
{ name: "findRecursively", options: {}, I: RouteMessageWrapper, O: RouteMessageAck }
|
|
1351
1217
|
]);
|
|
1352
1218
|
/**
|
|
1353
|
-
* @generated ServiceType for protobuf service dht.
|
|
1219
|
+
* @generated ServiceType for protobuf service dht.StoreRpc
|
|
1354
1220
|
*/
|
|
1355
|
-
export const
|
|
1221
|
+
export const StoreRpc = new ServiceType("dht.StoreRpc", [
|
|
1356
1222
|
{ name: "storeData", options: {}, I: StoreDataRequest, O: StoreDataResponse },
|
|
1357
1223
|
{ name: "migrateData", options: {}, I: MigrateDataRequest, O: MigrateDataResponse },
|
|
1358
1224
|
{ name: "deleteData", options: {}, I: DeleteDataRequest, O: DeleteDataResponse }
|
|
@@ -1361,35 +1227,35 @@ export const StoreService = new ServiceType("dht.StoreService", [
|
|
|
1361
1227
|
* @generated ServiceType for protobuf service dht.RecursiveFindSessionService
|
|
1362
1228
|
*/
|
|
1363
1229
|
export const RecursiveFindSessionService = new ServiceType("dht.RecursiveFindSessionService", [
|
|
1364
|
-
{ name: "
|
|
1230
|
+
{ name: "sendFindResponse", options: {}, I: FindResponse, O: Empty }
|
|
1365
1231
|
]);
|
|
1366
1232
|
/**
|
|
1367
|
-
* @generated ServiceType for protobuf service dht.
|
|
1233
|
+
* @generated ServiceType for protobuf service dht.WebSocketConnectorRpc
|
|
1368
1234
|
*/
|
|
1369
|
-
export const
|
|
1235
|
+
export const WebSocketConnectorRpc = new ServiceType("dht.WebSocketConnectorRpc", [
|
|
1370
1236
|
{ name: "requestConnection", options: {}, I: WebSocketConnectionRequest, O: WebSocketConnectionResponse }
|
|
1371
1237
|
]);
|
|
1372
1238
|
/**
|
|
1373
|
-
* @generated ServiceType for protobuf service dht.
|
|
1239
|
+
* @generated ServiceType for protobuf service dht.WebRtcConnectorRpc
|
|
1374
1240
|
*/
|
|
1375
|
-
export const
|
|
1241
|
+
export const WebRtcConnectorRpc = new ServiceType("dht.WebRtcConnectorRpc", [
|
|
1376
1242
|
{ name: "requestConnection", options: {}, I: WebRtcConnectionRequest, O: Empty },
|
|
1377
1243
|
{ name: "rtcOffer", options: {}, I: RtcOffer, O: Empty },
|
|
1378
1244
|
{ name: "rtcAnswer", options: {}, I: RtcAnswer, O: Empty },
|
|
1379
1245
|
{ name: "iceCandidate", options: {}, I: IceCandidate, O: Empty }
|
|
1380
1246
|
]);
|
|
1381
1247
|
/**
|
|
1382
|
-
* @generated ServiceType for protobuf service dht.
|
|
1248
|
+
* @generated ServiceType for protobuf service dht.ConnectionLockRpc
|
|
1383
1249
|
*/
|
|
1384
|
-
export const
|
|
1250
|
+
export const ConnectionLockRpc = new ServiceType("dht.ConnectionLockRpc", [
|
|
1385
1251
|
{ name: "lockRequest", options: {}, I: LockRequest, O: LockResponse },
|
|
1386
1252
|
{ name: "unlockRequest", options: {}, I: UnlockRequest, O: Empty },
|
|
1387
1253
|
{ name: "gracefulDisconnect", options: {}, I: DisconnectNotice, O: DisconnectNoticeResponse }
|
|
1388
1254
|
]);
|
|
1389
1255
|
/**
|
|
1390
|
-
* @generated ServiceType for protobuf service dht.
|
|
1256
|
+
* @generated ServiceType for protobuf service dht.ExternalApiRpc
|
|
1391
1257
|
*/
|
|
1392
|
-
export const
|
|
1258
|
+
export const ExternalApiRpc = new ServiceType("dht.ExternalApiRpc", [
|
|
1393
1259
|
{ name: "findData", options: {}, I: FindDataRequest, O: FindDataResponse },
|
|
1394
1260
|
{ name: "externalStoreData", options: {}, I: ExternalStoreDataRequest, O: ExternalStoreDataResponse }
|
|
1395
1261
|
]);
|
|
@@ -53,6 +53,7 @@ export class RoutingRpcCommunicator extends RpcCommunicator {
|
|
|
53
53
|
if (message.serviceId == this.ownServiceId && message.body.oneofKind === 'rpcMessage') {
|
|
54
54
|
const context = new DhtCallContext()
|
|
55
55
|
context.incomingSourceDescriptor = message.sourceDescriptor
|
|
56
|
+
context.incomingTargetDescriptor = message.targetDescriptor
|
|
56
57
|
this.handleIncomingMessage(message.body.rpcMessage, context)
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RpcCommunicator, toProtoRpcClient } from '@streamr/proto-rpc'
|
|
2
|
-
import {
|
|
2
|
+
import { RouterRpcRemote } from '../../src/dht/routing/RouterRpcRemote'
|
|
3
3
|
import { Message, MessageType, NodeType, PeerDescriptor, RouteMessageAck, RouteMessageWrapper } from '../../src/proto/packages/dht/protos/DhtRpc'
|
|
4
|
-
import {
|
|
4
|
+
import { RouterRpcClient } from '../../src/proto/packages/dht/protos/DhtRpc.client'
|
|
5
5
|
import { RpcMessage } from '../../src/proto/packages/proto-rpc/protos/ProtoRpc'
|
|
6
|
-
import { createWrappedClosestPeersRequest, generateId,
|
|
6
|
+
import { createWrappedClosestPeersRequest, generateId, mockRouterRpc } from '../utils/utils'
|
|
7
7
|
|
|
8
8
|
describe('RemoteRouter', () => {
|
|
9
9
|
|
|
10
|
-
let remoteRouter:
|
|
10
|
+
let remoteRouter: RouterRpcRemote
|
|
11
11
|
let clientRpcCommunicator: RpcCommunicator
|
|
12
12
|
let serverRpcCommunicator: RpcCommunicator
|
|
13
13
|
const serviceId = 'test'
|
|
@@ -23,15 +23,15 @@ describe('RemoteRouter', () => {
|
|
|
23
23
|
beforeEach(() => {
|
|
24
24
|
clientRpcCommunicator = new RpcCommunicator()
|
|
25
25
|
serverRpcCommunicator = new RpcCommunicator()
|
|
26
|
-
serverRpcCommunicator.registerRpcMethod(RouteMessageWrapper, RouteMessageAck, 'routeMessage',
|
|
26
|
+
serverRpcCommunicator.registerRpcMethod(RouteMessageWrapper, RouteMessageAck, 'routeMessage', mockRouterRpc.routeMessage)
|
|
27
27
|
clientRpcCommunicator.on('outgoingMessage', (message: RpcMessage) => {
|
|
28
28
|
serverRpcCommunicator.handleIncomingMessage(message)
|
|
29
29
|
})
|
|
30
30
|
serverRpcCommunicator.on('outgoingMessage', (message: RpcMessage) => {
|
|
31
31
|
clientRpcCommunicator.handleIncomingMessage(message)
|
|
32
32
|
})
|
|
33
|
-
const client = toProtoRpcClient(new
|
|
34
|
-
remoteRouter = new
|
|
33
|
+
const client = toProtoRpcClient(new RouterRpcClient(clientRpcCommunicator.getRpcClientTransport()))
|
|
34
|
+
remoteRouter = new RouterRpcRemote(clientPeerDescriptor, serverPeerDescriptor, serviceId, client)
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
it('routeMessage happy path', async () => {
|
|
@@ -57,7 +57,7 @@ describe('RemoteRouter', () => {
|
|
|
57
57
|
})
|
|
58
58
|
|
|
59
59
|
it('routeMessage error path', async () => {
|
|
60
|
-
serverRpcCommunicator.registerRpcMethod(RouteMessageWrapper, RouteMessageAck, 'routeMessage',
|
|
60
|
+
serverRpcCommunicator.registerRpcMethod(RouteMessageWrapper, RouteMessageAck, 'routeMessage', mockRouterRpc.throwRouteMessageError)
|
|
61
61
|
const rpcWrapper = createWrappedClosestPeersRequest(clientPeerDescriptor)
|
|
62
62
|
const routed: Message = {
|
|
63
63
|
serviceId,
|