@streamr/dht 100.0.0-testnet-one.3 → 100.0.0-testnet-two.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/connection/ConnectionLockHandler.d.ts +11 -11
- package/dist/src/connection/ConnectionLockHandler.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcLocal.d.ts +3 -3
- package/dist/src/connection/ConnectionLockRpcLocal.js +4 -4
- package/dist/src/connection/ConnectionLockRpcLocal.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcRemote.d.ts +3 -5
- package/dist/src/connection/ConnectionLockRpcRemote.js +4 -7
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -1
- package/dist/src/connection/ConnectionManager.d.ts +4 -6
- package/dist/src/connection/ConnectionManager.js +48 -46
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +2 -2
- package/dist/src/connection/ConnectorFacade.js +2 -1
- package/dist/src/connection/ConnectorFacade.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +3 -6
- package/dist/src/connection/ManagedConnection.js +6 -10
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/connectivityChecker.js +1 -0
- package/dist/src/connection/connectivityChecker.js.map +1 -1
- package/dist/src/connection/simulator/Simulator.d.ts +0 -3
- package/dist/src/connection/simulator/Simulator.js +3 -51
- package/dist/src/connection/simulator/Simulator.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnector.js +5 -5
- package/dist/src/connection/simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js +2 -2
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnector.d.ts +0 -1
- package/dist/src/connection/webrtc/WebrtcConnector.js +7 -9
- package/dist/src/connection/webrtc/WebrtcConnector.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.d.ts +2 -2
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js +11 -12
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.d.ts +2 -5
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.js +1 -4
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/AutoCertifierClientFacade.d.ts +1 -2
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js +3 -4
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js.map +1 -1
- package/dist/src/connection/websocket/ClientWebsocket.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnector.d.ts +2 -7
- package/dist/src/connection/websocket/WebsocketConnector.js +32 -38
- package/dist/src/connection/websocket/WebsocketConnector.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.d.ts +3 -2
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js +8 -10
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.d.ts +3 -6
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js +0 -3
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketServer.d.ts +1 -4
- package/dist/src/connection/websocket/WebsocketServer.js +11 -12
- package/dist/src/connection/websocket/WebsocketServer.js.map +1 -1
- package/dist/src/dht/DhtNode.d.ts +10 -13
- package/dist/src/dht/DhtNode.js +39 -52
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.d.ts +0 -1
- package/dist/src/dht/DhtNodeRpcLocal.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcRemote.d.ts +7 -7
- package/dist/src/dht/DhtNodeRpcRemote.js +8 -7
- package/dist/src/dht/DhtNodeRpcRemote.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcLocal.d.ts +5 -4
- package/dist/src/dht/ExternalApiRpcLocal.js +3 -2
- package/dist/src/dht/ExternalApiRpcLocal.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcRemote.d.ts +2 -2
- package/dist/src/dht/ExternalApiRpcRemote.js +2 -0
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -1
- package/dist/src/dht/PeerManager.d.ts +13 -14
- package/dist/src/dht/PeerManager.js +45 -60
- package/dist/src/dht/PeerManager.js.map +1 -1
- package/dist/src/dht/contact/Contact.d.ts +2 -2
- package/dist/src/dht/contact/Contact.js +2 -2
- package/dist/src/dht/contact/Contact.js.map +1 -1
- package/dist/src/dht/contact/ContactList.d.ts +7 -7
- package/dist/src/dht/contact/ContactList.js +3 -3
- package/dist/src/dht/contact/ContactList.js.map +1 -1
- package/dist/src/dht/contact/RandomContactList.d.ts +4 -4
- package/dist/src/dht/contact/RandomContactList.js +12 -11
- package/dist/src/dht/contact/RandomContactList.js.map +1 -1
- package/dist/src/dht/contact/RpcRemote.d.ts +7 -4
- package/dist/src/dht/contact/RpcRemote.js +5 -2
- package/dist/src/dht/contact/RpcRemote.js.map +1 -1
- package/dist/src/dht/contact/SortedContactList.d.ts +13 -13
- package/dist/src/dht/contact/SortedContactList.js +33 -29
- package/dist/src/dht/contact/SortedContactList.js.map +1 -1
- package/dist/src/dht/discovery/DiscoverySession.d.ts +2 -4
- package/dist/src/dht/discovery/DiscoverySession.js +19 -20
- package/dist/src/dht/discovery/DiscoverySession.js.map +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +2 -5
- package/dist/src/dht/discovery/PeerDiscovery.js +12 -20
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.d.ts +36 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js +165 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.d.ts +14 -0
- package/dist/src/dht/{find/FindRpcLocal.js → recursive-operation/RecursiveOperationRpcLocal.js} +7 -7
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.d.ts +6 -0
- package/dist/src/dht/{routing/FindRpcRemote.js → recursive-operation/RecursiveOperationRpcRemote.js} +11 -11
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.d.ts +42 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js +182 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.d.ts +12 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js +17 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js.map +1 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.d.ts +6 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.js +21 -0
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.js.map +1 -0
- package/dist/src/dht/routing/Router.d.ts +4 -19
- package/dist/src/dht/routing/Router.js +41 -33
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcLocal.js +6 -5
- package/dist/src/dht/routing/RouterRpcLocal.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcRemote.d.ts +2 -2
- package/dist/src/dht/routing/RouterRpcRemote.js +7 -7
- package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -1
- package/dist/src/dht/routing/RoutingSession.d.ts +20 -16
- package/dist/src/dht/routing/RoutingSession.js +37 -45
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/store/LocalDataStore.d.ts +11 -13
- package/dist/src/dht/store/LocalDataStore.js +36 -56
- package/dist/src/dht/store/LocalDataStore.js.map +1 -1
- package/dist/src/dht/store/StoreManager.d.ts +33 -0
- package/dist/src/dht/store/StoreManager.js +186 -0
- package/dist/src/dht/store/StoreManager.js.map +1 -0
- package/dist/src/dht/store/StoreRpcLocal.d.ts +8 -40
- package/dist/src/dht/store/StoreRpcLocal.js +13 -229
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -1
- package/dist/src/dht/store/StoreRpcRemote.d.ts +5 -5
- package/dist/src/dht/store/StoreRpcRemote.js +4 -5
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -1
- package/dist/src/exports.d.ts +2 -0
- package/dist/src/exports.js.map +1 -1
- package/dist/src/helpers/MapWithTtl.d.ts +14 -0
- package/dist/src/helpers/MapWithTtl.js +59 -0
- package/dist/src/helpers/MapWithTtl.js.map +1 -0
- package/dist/src/helpers/PeerID.d.ts +2 -0
- package/dist/src/helpers/PeerID.js +4 -0
- package/dist/src/helpers/PeerID.js.map +1 -1
- package/dist/src/helpers/nodeId.d.ts +5 -0
- package/dist/src/helpers/nodeId.js +18 -1
- package/dist/src/helpers/nodeId.js.map +1 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.d.ts +2 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.js +2 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.js.map +1 -1
- package/dist/src/helpers/protoClasses.js +2 -3
- package/dist/src/helpers/protoClasses.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +21 -22
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +18 -18
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +36 -60
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +34 -53
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +11 -12
- package/dist/src/rpc-protocol/DhtCallContext.d.ts +2 -1
- package/dist/src/rpc-protocol/DhtCallContext.js.map +1 -1
- package/dist/src/rpc-protocol/DhtRpcOptions.d.ts +2 -1
- package/dist/src/transport/ITransport.d.ts +9 -1
- package/dist/src/transport/ITransport.js +5 -0
- package/dist/src/transport/ITransport.js.map +1 -1
- package/dist/src/transport/ListeningRpcCommunicator.js +1 -1
- package/dist/src/transport/ListeningRpcCommunicator.js.map +1 -1
- package/dist/src/transport/RoutingRpcCommunicator.d.ts +2 -1
- package/dist/src/transport/RoutingRpcCommunicator.js +16 -11
- package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
- package/jest.config.js +4 -1
- package/karma-setup.js +2 -0
- package/karma.config.js +11 -7
- package/package.json +6 -7
- package/protos/DhtRpc.proto +17 -23
- package/src/connection/ConnectionLockHandler.ts +15 -15
- package/src/connection/ConnectionLockRpcLocal.ts +8 -9
- package/src/connection/ConnectionLockRpcRemote.ts +7 -16
- package/src/connection/ConnectionManager.ts +58 -55
- package/src/connection/ConnectorFacade.ts +3 -0
- package/src/connection/ManagedConnection.ts +12 -30
- package/src/connection/connectivityChecker.ts +1 -0
- package/src/connection/simulator/Simulator.ts +5 -36
- package/src/connection/simulator/SimulatorConnector.ts +8 -8
- package/src/connection/webrtc/BrowserWebrtcConnection.ts +0 -3
- package/src/connection/webrtc/NodeWebrtcConnection.ts +3 -4
- package/src/connection/webrtc/WebrtcConnector.ts +11 -13
- package/src/connection/webrtc/WebrtcConnectorRpcLocal.ts +16 -16
- package/src/connection/webrtc/WebrtcConnectorRpcRemote.ts +3 -13
- package/src/connection/websocket/AutoCertifierClientFacade.ts +4 -6
- package/src/connection/websocket/ClientWebsocket.ts +1 -0
- package/src/connection/websocket/WebsocketConnector.ts +43 -56
- package/src/connection/websocket/WebsocketConnectorRpcLocal.ts +11 -13
- package/src/connection/websocket/WebsocketConnectorRpcRemote.ts +4 -15
- package/src/connection/websocket/WebsocketServer.ts +14 -17
- package/src/dht/DhtNode.ts +67 -69
- package/src/dht/DhtNodeRpcLocal.ts +0 -1
- package/src/dht/DhtNodeRpcRemote.ts +13 -13
- package/src/dht/ExternalApiRpcLocal.ts +16 -6
- package/src/dht/ExternalApiRpcRemote.ts +5 -3
- package/src/dht/PeerManager.ts +73 -90
- package/src/dht/contact/Contact.ts +5 -4
- package/src/dht/contact/ContactList.ts +9 -9
- package/src/dht/contact/RandomContactList.ts +14 -14
- package/src/dht/contact/RpcRemote.ts +10 -7
- package/src/dht/contact/SortedContactList.ts +48 -45
- package/src/dht/discovery/DiscoverySession.ts +25 -25
- package/src/dht/discovery/PeerDiscovery.ts +16 -37
- package/src/dht/recursive-operation/RecursiveOperationManager.ts +240 -0
- package/src/dht/{find/FindRpcLocal.ts → recursive-operation/RecursiveOperationRpcLocal.ts} +9 -9
- package/src/dht/{routing/FindRpcRemote.ts → recursive-operation/RecursiveOperationRpcRemote.ts} +10 -10
- package/src/dht/recursive-operation/RecursiveOperationSession.ts +224 -0
- package/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.ts +25 -0
- package/src/dht/{find/FindSessionRpcRemote.ts → recursive-operation/RecursiveOperationSessionRpcRemote.ts} +8 -8
- package/src/dht/routing/Router.ts +45 -64
- package/src/dht/routing/RouterRpcLocal.ts +7 -6
- package/src/dht/routing/RouterRpcRemote.ts +9 -10
- package/src/dht/routing/RoutingSession.ts +59 -68
- package/src/dht/store/LocalDataStore.ts +47 -66
- package/src/dht/store/StoreManager.ts +217 -0
- package/src/dht/store/StoreRpcLocal.ts +26 -302
- package/src/dht/store/StoreRpcRemote.ts +9 -11
- package/src/exports.ts +2 -0
- package/src/helpers/MapWithTtl.ts +71 -0
- package/src/helpers/PeerID.ts +5 -0
- package/src/helpers/nodeId.ts +20 -0
- package/src/helpers/peerIdFromPeerDescriptor.ts +5 -3
- package/src/helpers/protoClasses.ts +4 -6
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +31 -32
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +11 -12
- package/src/proto/packages/dht/protos/DhtRpc.ts +49 -80
- package/src/rpc-protocol/DhtCallContext.ts +2 -1
- package/src/rpc-protocol/DhtRpcOptions.ts +2 -1
- package/src/transport/ITransport.ts +10 -1
- package/src/transport/ListeningRpcCommunicator.ts +1 -1
- package/src/transport/RoutingRpcCommunicator.ts +18 -12
- package/test/benchmark/Find.test.ts +8 -21
- package/test/benchmark/KademliaCorrectness.test.ts +11 -20
- package/test/benchmark/SortedContactListBenchmark.test.ts +9 -9
- package/test/benchmark/kademlia-simulation/Contact.ts +9 -8
- package/test/benchmark/kademlia-simulation/KademliaSimulation.ts +2 -2
- package/test/benchmark/kademlia-simulation/SimulationNode.ts +17 -17
- package/test/end-to-end/Layer0-Layer1.test.ts +10 -14
- package/test/end-to-end/Layer0.test.ts +15 -18
- package/test/end-to-end/Layer0MixedConnectionTypes.test.ts +7 -9
- package/test/end-to-end/Layer0Webrtc-Layer1.test.ts +4 -10
- package/test/end-to-end/Layer0Webrtc.test.ts +5 -6
- package/test/end-to-end/Layer1-Scale-WebSocket.test.ts +8 -16
- package/test/end-to-end/Layer1-Scale-Webrtc.test.ts +6 -13
- package/test/end-to-end/WebsocketConnectionRequest.test.ts +5 -6
- package/test/end-to-end/memory-leak.test.ts +6 -8
- package/test/integration/ConnectionLocking.test.ts +6 -13
- package/test/integration/ConnectionManager.test.ts +26 -43
- package/test/integration/DhtJoinPeerDiscovery.test.ts +5 -10
- package/test/integration/DhtNodeExternalAPI.test.ts +16 -22
- package/test/integration/DhtNodeRpcRemote.test.ts +13 -22
- package/test/integration/DhtRpc.test.ts +13 -18
- package/test/integration/Find.test.ts +10 -10
- package/test/integration/Layer1-scale.test.ts +17 -28
- package/test/integration/Mock-Layer1-Layer0.test.ts +25 -43
- package/test/integration/MultipleEntryPointJoining.test.ts +7 -7
- package/test/integration/ReplicateData.test.ts +28 -30
- package/test/integration/RouteMessage.test.ts +30 -27
- package/test/integration/RouterRpcRemote.test.ts +12 -18
- package/test/integration/RpcErrors.test.ts +8 -21
- package/test/integration/ScaleDownDht.test.ts +11 -10
- package/test/integration/SimultaneousConnections.test.ts +43 -67
- package/test/integration/Store.test.ts +23 -36
- package/test/integration/StoreAndDelete.test.ts +30 -50
- package/test/integration/StoreOnDhtWithTwoNodes.test.ts +16 -37
- package/test/integration/StoreRpcRemote.test.ts +20 -30
- package/test/integration/WebrtcConnectionManagement.test.ts +3 -13
- package/test/integration/WebrtcConnectorRpc.test.ts +3 -9
- package/test/integration/WebsocketConnectionManagement.test.ts +7 -10
- package/test/integration/WebsocketConnectorRpc.test.ts +8 -17
- package/test/unit/ConnectivityHelpers.test.ts +9 -17
- package/test/unit/DuplicateDetector.test.ts +7 -4
- package/test/unit/LocalDataStore.test.ts +66 -77
- package/test/unit/PeerManager.test.ts +31 -0
- package/test/unit/RandomContactList.test.ts +13 -8
- package/test/unit/{Finder.test.ts → RecursiveOperationManager.test.ts} +38 -43
- package/test/unit/RecursiveOperationSession.test.ts +68 -0
- package/test/unit/Router.test.ts +15 -22
- package/test/unit/RoutingSession.test.ts +23 -25
- package/test/unit/SortedContactList.test.ts +41 -26
- package/test/unit/StoreManager.test.ts +132 -0
- package/test/unit/WebsocketConnector.test.ts +27 -35
- package/test/unit/customMatchers.test.ts +16 -0
- package/test/utils/FakeTransport.ts +44 -0
- package/test/utils/customMatchers.ts +70 -0
- package/test/utils/mock/MockRpcCommunicator.ts +7 -0
- package/test/utils/mock/Router.ts +3 -2
- package/test/utils/mock/mockDataEntry.ts +36 -0
- package/test/utils/utils.ts +49 -87
- package/dist/src/dht/find/FindRpcLocal.d.ts +0 -14
- package/dist/src/dht/find/FindRpcLocal.js.map +0 -1
- package/dist/src/dht/find/FindSession.d.ts +0 -44
- package/dist/src/dht/find/FindSession.js +0 -150
- package/dist/src/dht/find/FindSession.js.map +0 -1
- package/dist/src/dht/find/FindSessionRpcLocal.d.ts +0 -12
- package/dist/src/dht/find/FindSessionRpcLocal.js +0 -17
- package/dist/src/dht/find/FindSessionRpcLocal.js.map +0 -1
- package/dist/src/dht/find/FindSessionRpcRemote.d.ts +0 -6
- package/dist/src/dht/find/FindSessionRpcRemote.js +0 -21
- package/dist/src/dht/find/FindSessionRpcRemote.js.map +0 -1
- package/dist/src/dht/find/Finder.d.ts +0 -49
- package/dist/src/dht/find/Finder.js +0 -197
- package/dist/src/dht/find/Finder.js.map +0 -1
- package/dist/src/dht/routing/FindRpcRemote.d.ts +0 -6
- package/dist/src/dht/routing/FindRpcRemote.js.map +0 -1
- package/src/dht/find/FindSession.ts +0 -183
- package/src/dht/find/FindSessionRpcLocal.ts +0 -25
- package/src/dht/find/Finder.ts +0 -295
|
@@ -18,15 +18,14 @@ import type { RtcAnswer } from "./DhtRpc";
|
|
|
18
18
|
import type { RtcOffer } from "./DhtRpc";
|
|
19
19
|
import type { WebrtcConnectionRequest } from "./DhtRpc";
|
|
20
20
|
import { WebsocketConnectorRpc } from "./DhtRpc";
|
|
21
|
-
import type { WebsocketConnectionResponse } from "./DhtRpc";
|
|
22
21
|
import type { WebsocketConnectionRequest } from "./DhtRpc";
|
|
23
|
-
import {
|
|
24
|
-
import type {
|
|
22
|
+
import { RecursiveOperationSessionRpc } from "./DhtRpc";
|
|
23
|
+
import type { RecursiveOperationResponse } from "./DhtRpc";
|
|
25
24
|
import { StoreRpc } from "./DhtRpc";
|
|
26
25
|
import type { ReplicateDataRequest } from "./DhtRpc";
|
|
27
26
|
import type { StoreDataResponse } from "./DhtRpc";
|
|
28
27
|
import type { StoreDataRequest } from "./DhtRpc";
|
|
29
|
-
import {
|
|
28
|
+
import { RecursiveOperationRpc } from "./DhtRpc";
|
|
30
29
|
import { RouterRpc } from "./DhtRpc";
|
|
31
30
|
import type { RouteMessageAck } from "./DhtRpc";
|
|
32
31
|
import type { RouteMessageWrapper } from "./DhtRpc";
|
|
@@ -128,27 +127,27 @@ export class RouterRpcClient implements IRouterRpcClient, ServiceInfo {
|
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
129
|
/**
|
|
131
|
-
* @generated from protobuf service dht.
|
|
130
|
+
* @generated from protobuf service dht.RecursiveOperationRpc
|
|
132
131
|
*/
|
|
133
|
-
export interface
|
|
132
|
+
export interface IRecursiveOperationRpcClient {
|
|
134
133
|
/**
|
|
135
|
-
* @generated from protobuf rpc:
|
|
134
|
+
* @generated from protobuf rpc: routeRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
|
|
136
135
|
*/
|
|
137
|
-
|
|
136
|
+
routeRequest(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck>;
|
|
138
137
|
}
|
|
139
138
|
/**
|
|
140
|
-
* @generated from protobuf service dht.
|
|
139
|
+
* @generated from protobuf service dht.RecursiveOperationRpc
|
|
141
140
|
*/
|
|
142
|
-
export class
|
|
143
|
-
typeName =
|
|
144
|
-
methods =
|
|
145
|
-
options =
|
|
141
|
+
export class RecursiveOperationRpcClient implements IRecursiveOperationRpcClient, ServiceInfo {
|
|
142
|
+
typeName = RecursiveOperationRpc.typeName;
|
|
143
|
+
methods = RecursiveOperationRpc.methods;
|
|
144
|
+
options = RecursiveOperationRpc.options;
|
|
146
145
|
constructor(private readonly _transport: RpcTransport) {
|
|
147
146
|
}
|
|
148
147
|
/**
|
|
149
|
-
* @generated from protobuf rpc:
|
|
148
|
+
* @generated from protobuf rpc: routeRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
|
|
150
149
|
*/
|
|
151
|
-
|
|
150
|
+
routeRequest(input: RouteMessageWrapper, options?: RpcOptions): UnaryCall<RouteMessageWrapper, RouteMessageAck> {
|
|
152
151
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
|
153
152
|
return stackIntercept<RouteMessageWrapper, RouteMessageAck>("unary", this._transport, method, opt, input);
|
|
154
153
|
}
|
|
@@ -191,29 +190,29 @@ export class StoreRpcClient implements IStoreRpcClient, ServiceInfo {
|
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
/**
|
|
194
|
-
* @generated from protobuf service dht.
|
|
193
|
+
* @generated from protobuf service dht.RecursiveOperationSessionRpc
|
|
195
194
|
*/
|
|
196
|
-
export interface
|
|
195
|
+
export interface IRecursiveOperationSessionRpcClient {
|
|
197
196
|
/**
|
|
198
|
-
* @generated from protobuf rpc:
|
|
197
|
+
* @generated from protobuf rpc: sendResponse(dht.RecursiveOperationResponse) returns (google.protobuf.Empty);
|
|
199
198
|
*/
|
|
200
|
-
|
|
199
|
+
sendResponse(input: RecursiveOperationResponse, options?: RpcOptions): UnaryCall<RecursiveOperationResponse, Empty>;
|
|
201
200
|
}
|
|
202
201
|
/**
|
|
203
|
-
* @generated from protobuf service dht.
|
|
202
|
+
* @generated from protobuf service dht.RecursiveOperationSessionRpc
|
|
204
203
|
*/
|
|
205
|
-
export class
|
|
206
|
-
typeName =
|
|
207
|
-
methods =
|
|
208
|
-
options =
|
|
204
|
+
export class RecursiveOperationSessionRpcClient implements IRecursiveOperationSessionRpcClient, ServiceInfo {
|
|
205
|
+
typeName = RecursiveOperationSessionRpc.typeName;
|
|
206
|
+
methods = RecursiveOperationSessionRpc.methods;
|
|
207
|
+
options = RecursiveOperationSessionRpc.options;
|
|
209
208
|
constructor(private readonly _transport: RpcTransport) {
|
|
210
209
|
}
|
|
211
210
|
/**
|
|
212
|
-
* @generated from protobuf rpc:
|
|
211
|
+
* @generated from protobuf rpc: sendResponse(dht.RecursiveOperationResponse) returns (google.protobuf.Empty);
|
|
213
212
|
*/
|
|
214
|
-
|
|
213
|
+
sendResponse(input: RecursiveOperationResponse, options?: RpcOptions): UnaryCall<RecursiveOperationResponse, Empty> {
|
|
215
214
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
|
216
|
-
return stackIntercept<
|
|
215
|
+
return stackIntercept<RecursiveOperationResponse, Empty>("unary", this._transport, method, opt, input);
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
218
|
/**
|
|
@@ -221,9 +220,9 @@ export class FindSessionRpcClient implements IFindSessionRpcClient, ServiceInfo
|
|
|
221
220
|
*/
|
|
222
221
|
export interface IWebsocketConnectorRpcClient {
|
|
223
222
|
/**
|
|
224
|
-
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (
|
|
223
|
+
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (google.protobuf.Empty);
|
|
225
224
|
*/
|
|
226
|
-
requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest,
|
|
225
|
+
requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest, Empty>;
|
|
227
226
|
}
|
|
228
227
|
/**
|
|
229
228
|
* @generated from protobuf service dht.WebsocketConnectorRpc
|
|
@@ -235,11 +234,11 @@ export class WebsocketConnectorRpcClient implements IWebsocketConnectorRpcClient
|
|
|
235
234
|
constructor(private readonly _transport: RpcTransport) {
|
|
236
235
|
}
|
|
237
236
|
/**
|
|
238
|
-
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (
|
|
237
|
+
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (google.protobuf.Empty);
|
|
239
238
|
*/
|
|
240
|
-
requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest,
|
|
239
|
+
requestConnection(input: WebsocketConnectionRequest, options?: RpcOptions): UnaryCall<WebsocketConnectionRequest, Empty> {
|
|
241
240
|
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
|
242
|
-
return stackIntercept<WebsocketConnectionRequest,
|
|
241
|
+
return stackIntercept<WebsocketConnectionRequest, Empty>("unary", this._transport, method, opt, input);
|
|
243
242
|
}
|
|
244
243
|
}
|
|
245
244
|
/**
|
|
@@ -14,9 +14,8 @@ import { IceCandidate } from "./DhtRpc";
|
|
|
14
14
|
import { RtcAnswer } from "./DhtRpc";
|
|
15
15
|
import { RtcOffer } from "./DhtRpc";
|
|
16
16
|
import { WebrtcConnectionRequest } from "./DhtRpc";
|
|
17
|
-
import { WebsocketConnectionResponse } from "./DhtRpc";
|
|
18
17
|
import { WebsocketConnectionRequest } from "./DhtRpc";
|
|
19
|
-
import {
|
|
18
|
+
import { RecursiveOperationResponse } from "./DhtRpc";
|
|
20
19
|
import { ReplicateDataRequest } from "./DhtRpc";
|
|
21
20
|
import { StoreDataResponse } from "./DhtRpc";
|
|
22
21
|
import { StoreDataRequest } from "./DhtRpc";
|
|
@@ -60,13 +59,13 @@ export interface IRouterRpc<T = ServerCallContext> {
|
|
|
60
59
|
forwardMessage(request: RouteMessageWrapper, context: T): Promise<RouteMessageAck>;
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
|
-
* @generated from protobuf service dht.
|
|
62
|
+
* @generated from protobuf service dht.RecursiveOperationRpc
|
|
64
63
|
*/
|
|
65
|
-
export interface
|
|
64
|
+
export interface IRecursiveOperationRpc<T = ServerCallContext> {
|
|
66
65
|
/**
|
|
67
|
-
* @generated from protobuf rpc:
|
|
66
|
+
* @generated from protobuf rpc: routeRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
|
|
68
67
|
*/
|
|
69
|
-
|
|
68
|
+
routeRequest(request: RouteMessageWrapper, context: T): Promise<RouteMessageAck>;
|
|
70
69
|
}
|
|
71
70
|
/**
|
|
72
71
|
* @generated from protobuf service dht.StoreRpc
|
|
@@ -82,22 +81,22 @@ export interface IStoreRpc<T = ServerCallContext> {
|
|
|
82
81
|
replicateData(request: ReplicateDataRequest, context: T): Promise<Empty>;
|
|
83
82
|
}
|
|
84
83
|
/**
|
|
85
|
-
* @generated from protobuf service dht.
|
|
84
|
+
* @generated from protobuf service dht.RecursiveOperationSessionRpc
|
|
86
85
|
*/
|
|
87
|
-
export interface
|
|
86
|
+
export interface IRecursiveOperationSessionRpc<T = ServerCallContext> {
|
|
88
87
|
/**
|
|
89
|
-
* @generated from protobuf rpc:
|
|
88
|
+
* @generated from protobuf rpc: sendResponse(dht.RecursiveOperationResponse) returns (google.protobuf.Empty);
|
|
90
89
|
*/
|
|
91
|
-
|
|
90
|
+
sendResponse(request: RecursiveOperationResponse, context: T): Promise<Empty>;
|
|
92
91
|
}
|
|
93
92
|
/**
|
|
94
93
|
* @generated from protobuf service dht.WebsocketConnectorRpc
|
|
95
94
|
*/
|
|
96
95
|
export interface IWebsocketConnectorRpc<T = ServerCallContext> {
|
|
97
96
|
/**
|
|
98
|
-
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (
|
|
97
|
+
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (google.protobuf.Empty);
|
|
99
98
|
*/
|
|
100
|
-
requestConnection(request: WebsocketConnectionRequest, context: T): Promise<
|
|
99
|
+
requestConnection(request: WebsocketConnectionRequest, context: T): Promise<Empty>;
|
|
101
100
|
}
|
|
102
101
|
/**
|
|
103
102
|
* @generated from protobuf service dht.WebrtcConnectorRpc
|
|
@@ -22,9 +22,9 @@ export interface StoreDataRequest {
|
|
|
22
22
|
*/
|
|
23
23
|
data?: Any;
|
|
24
24
|
/**
|
|
25
|
-
* @generated from protobuf field:
|
|
25
|
+
* @generated from protobuf field: bytes creator = 3;
|
|
26
26
|
*/
|
|
27
|
-
creator
|
|
27
|
+
creator: Uint8Array;
|
|
28
28
|
/**
|
|
29
29
|
* @generated from protobuf field: google.protobuf.Timestamp createdAt = 4;
|
|
30
30
|
*/
|
|
@@ -38,10 +38,6 @@ export interface StoreDataRequest {
|
|
|
38
38
|
* @generated from protobuf message dht.StoreDataResponse
|
|
39
39
|
*/
|
|
40
40
|
export interface StoreDataResponse {
|
|
41
|
-
/**
|
|
42
|
-
* @generated from protobuf field: string error = 1;
|
|
43
|
-
*/
|
|
44
|
-
error: string;
|
|
45
41
|
}
|
|
46
42
|
/**
|
|
47
43
|
* @generated from protobuf message dht.ExternalStoreDataRequest
|
|
@@ -87,9 +83,9 @@ export interface DataEntry {
|
|
|
87
83
|
*/
|
|
88
84
|
data?: Any;
|
|
89
85
|
/**
|
|
90
|
-
* @generated from protobuf field:
|
|
86
|
+
* @generated from protobuf field: bytes creator = 3;
|
|
91
87
|
*/
|
|
92
|
-
creator
|
|
88
|
+
creator: Uint8Array;
|
|
93
89
|
/**
|
|
94
90
|
* @generated from protobuf field: google.protobuf.Timestamp createdAt = 4;
|
|
95
91
|
*/
|
|
@@ -138,22 +134,22 @@ export interface ClosestPeersResponse {
|
|
|
138
134
|
requestId: string;
|
|
139
135
|
}
|
|
140
136
|
/**
|
|
141
|
-
* @generated from protobuf message dht.
|
|
137
|
+
* @generated from protobuf message dht.RecursiveOperationRequest
|
|
142
138
|
*/
|
|
143
|
-
export interface
|
|
139
|
+
export interface RecursiveOperationRequest {
|
|
144
140
|
/**
|
|
145
141
|
* @generated from protobuf field: string sessionId = 1;
|
|
146
142
|
*/
|
|
147
143
|
sessionId: string;
|
|
148
144
|
/**
|
|
149
|
-
* @generated from protobuf field: dht.
|
|
145
|
+
* @generated from protobuf field: dht.RecursiveOperation operation = 2;
|
|
150
146
|
*/
|
|
151
|
-
|
|
147
|
+
operation: RecursiveOperation;
|
|
152
148
|
}
|
|
153
149
|
/**
|
|
154
|
-
* @generated from protobuf message dht.
|
|
150
|
+
* @generated from protobuf message dht.RecursiveOperationResponse
|
|
155
151
|
*/
|
|
156
|
-
export interface
|
|
152
|
+
export interface RecursiveOperationResponse {
|
|
157
153
|
/**
|
|
158
154
|
* @generated from protobuf field: repeated dht.PeerDescriptor closestConnectedPeers = 1;
|
|
159
155
|
*/
|
|
@@ -249,17 +245,17 @@ export interface ConnectivityMethod {
|
|
|
249
245
|
*/
|
|
250
246
|
export interface RouteMessageWrapper {
|
|
251
247
|
/**
|
|
252
|
-
* @generated from protobuf field:
|
|
248
|
+
* @generated from protobuf field: string requestId = 1;
|
|
253
249
|
*/
|
|
254
|
-
|
|
250
|
+
requestId: string;
|
|
255
251
|
/**
|
|
256
|
-
* @generated from protobuf field:
|
|
252
|
+
* @generated from protobuf field: dht.PeerDescriptor sourcePeer = 2;
|
|
257
253
|
*/
|
|
258
|
-
|
|
254
|
+
sourcePeer?: PeerDescriptor;
|
|
259
255
|
/**
|
|
260
|
-
* @generated from protobuf field:
|
|
256
|
+
* @generated from protobuf field: bytes target = 3;
|
|
261
257
|
*/
|
|
262
|
-
|
|
258
|
+
target: Uint8Array;
|
|
263
259
|
/**
|
|
264
260
|
* @generated from protobuf field: dht.Message message = 4;
|
|
265
261
|
*/
|
|
@@ -410,11 +406,11 @@ export interface Message {
|
|
|
410
406
|
*/
|
|
411
407
|
rpcMessage: RpcMessage;
|
|
412
408
|
} | {
|
|
413
|
-
oneofKind: "
|
|
409
|
+
oneofKind: "recursiveOperationRequest";
|
|
414
410
|
/**
|
|
415
|
-
* @generated from protobuf field: dht.
|
|
411
|
+
* @generated from protobuf field: dht.RecursiveOperationRequest recursiveOperationRequest = 11;
|
|
416
412
|
*/
|
|
417
|
-
|
|
413
|
+
recursiveOperationRequest: RecursiveOperationRequest;
|
|
418
414
|
} | {
|
|
419
415
|
oneofKind: undefined;
|
|
420
416
|
};
|
|
@@ -428,15 +424,6 @@ export interface Message {
|
|
|
428
424
|
*/
|
|
429
425
|
export interface WebsocketConnectionRequest {
|
|
430
426
|
}
|
|
431
|
-
/**
|
|
432
|
-
* @generated from protobuf message dht.WebsocketConnectionResponse
|
|
433
|
-
*/
|
|
434
|
-
export interface WebsocketConnectionResponse {
|
|
435
|
-
/**
|
|
436
|
-
* @generated from protobuf field: bool accepted = 1;
|
|
437
|
-
*/
|
|
438
|
-
accepted: boolean;
|
|
439
|
-
}
|
|
440
427
|
/**
|
|
441
428
|
* WebRTC
|
|
442
429
|
*
|
|
@@ -547,13 +534,13 @@ export interface ExternalFindDataResponse {
|
|
|
547
534
|
entries: DataEntry[];
|
|
548
535
|
}
|
|
549
536
|
/**
|
|
550
|
-
* @generated from protobuf enum dht.
|
|
537
|
+
* @generated from protobuf enum dht.RecursiveOperation
|
|
551
538
|
*/
|
|
552
|
-
export enum
|
|
539
|
+
export enum RecursiveOperation {
|
|
553
540
|
/**
|
|
554
|
-
* @generated from protobuf enum value:
|
|
541
|
+
* @generated from protobuf enum value: FIND_NODE = 0;
|
|
555
542
|
*/
|
|
556
|
-
|
|
543
|
+
FIND_NODE = 0,
|
|
557
544
|
/**
|
|
558
545
|
* @generated from protobuf enum value: FETCH_DATA = 1;
|
|
559
546
|
*/
|
|
@@ -574,11 +561,7 @@ export enum NodeType {
|
|
|
574
561
|
/**
|
|
575
562
|
* @generated from protobuf enum value: BROWSER = 1;
|
|
576
563
|
*/
|
|
577
|
-
BROWSER = 1
|
|
578
|
-
/**
|
|
579
|
-
* @generated from protobuf enum value: VIRTUAL = 3;
|
|
580
|
-
*/
|
|
581
|
-
VIRTUAL = 3
|
|
564
|
+
BROWSER = 1
|
|
582
565
|
}
|
|
583
566
|
/**
|
|
584
567
|
* @generated from protobuf enum dht.RpcResponseError
|
|
@@ -661,9 +644,9 @@ export enum MessageType {
|
|
|
661
644
|
*/
|
|
662
645
|
HANDSHAKE_RESPONSE = 4,
|
|
663
646
|
/**
|
|
664
|
-
* @generated from protobuf enum value:
|
|
647
|
+
* @generated from protobuf enum value: RECURSIVE_OPERATION_REQUEST = 5;
|
|
665
648
|
*/
|
|
666
|
-
|
|
649
|
+
RECURSIVE_OPERATION_REQUEST = 5
|
|
667
650
|
}
|
|
668
651
|
/**
|
|
669
652
|
* @generated from protobuf enum dht.DisconnectMode
|
|
@@ -684,7 +667,7 @@ class StoreDataRequest$Type extends MessageType$<StoreDataRequest> {
|
|
|
684
667
|
super("dht.StoreDataRequest", [
|
|
685
668
|
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
686
669
|
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
687
|
-
{ no: 3, name: "creator", kind: "
|
|
670
|
+
{ no: 3, name: "creator", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
688
671
|
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
689
672
|
{ no: 5, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
690
673
|
]);
|
|
@@ -697,9 +680,7 @@ export const StoreDataRequest = new StoreDataRequest$Type();
|
|
|
697
680
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
698
681
|
class StoreDataResponse$Type extends MessageType$<StoreDataResponse> {
|
|
699
682
|
constructor() {
|
|
700
|
-
super("dht.StoreDataResponse", [
|
|
701
|
-
{ no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
702
|
-
]);
|
|
683
|
+
super("dht.StoreDataResponse", []);
|
|
703
684
|
}
|
|
704
685
|
}
|
|
705
686
|
/**
|
|
@@ -749,7 +730,7 @@ class DataEntry$Type extends MessageType$<DataEntry> {
|
|
|
749
730
|
super("dht.DataEntry", [
|
|
750
731
|
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
751
732
|
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
752
|
-
{ no: 3, name: "creator", kind: "
|
|
733
|
+
{ no: 3, name: "creator", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
753
734
|
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
754
735
|
{ no: 5, name: "storedAt", kind: "message", T: () => Timestamp },
|
|
755
736
|
{ no: 6, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
@@ -789,22 +770,22 @@ class ClosestPeersResponse$Type extends MessageType$<ClosestPeersResponse> {
|
|
|
789
770
|
*/
|
|
790
771
|
export const ClosestPeersResponse = new ClosestPeersResponse$Type();
|
|
791
772
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
792
|
-
class
|
|
773
|
+
class RecursiveOperationRequest$Type extends MessageType$<RecursiveOperationRequest> {
|
|
793
774
|
constructor() {
|
|
794
|
-
super("dht.
|
|
775
|
+
super("dht.RecursiveOperationRequest", [
|
|
795
776
|
{ no: 1, name: "sessionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
796
|
-
{ no: 2, name: "
|
|
777
|
+
{ no: 2, name: "operation", kind: "enum", T: () => ["dht.RecursiveOperation", RecursiveOperation] }
|
|
797
778
|
]);
|
|
798
779
|
}
|
|
799
780
|
}
|
|
800
781
|
/**
|
|
801
|
-
* @generated MessageType for protobuf message dht.
|
|
782
|
+
* @generated MessageType for protobuf message dht.RecursiveOperationRequest
|
|
802
783
|
*/
|
|
803
|
-
export const
|
|
784
|
+
export const RecursiveOperationRequest = new RecursiveOperationRequest$Type();
|
|
804
785
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
805
|
-
class
|
|
786
|
+
class RecursiveOperationResponse$Type extends MessageType$<RecursiveOperationResponse> {
|
|
806
787
|
constructor() {
|
|
807
|
-
super("dht.
|
|
788
|
+
super("dht.RecursiveOperationResponse", [
|
|
808
789
|
{ no: 1, name: "closestConnectedPeers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
809
790
|
{ no: 2, name: "dataEntries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataEntry },
|
|
810
791
|
{ no: 3, name: "noCloserNodesFound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
@@ -813,9 +794,9 @@ class FindResponse$Type extends MessageType$<FindResponse> {
|
|
|
813
794
|
}
|
|
814
795
|
}
|
|
815
796
|
/**
|
|
816
|
-
* @generated MessageType for protobuf message dht.
|
|
797
|
+
* @generated MessageType for protobuf message dht.RecursiveOperationResponse
|
|
817
798
|
*/
|
|
818
|
-
export const
|
|
799
|
+
export const RecursiveOperationResponse = new RecursiveOperationResponse$Type();
|
|
819
800
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
820
801
|
class PingRequest$Type extends MessageType$<PingRequest> {
|
|
821
802
|
constructor() {
|
|
@@ -887,9 +868,9 @@ export const ConnectivityMethod = new ConnectivityMethod$Type();
|
|
|
887
868
|
class RouteMessageWrapper$Type extends MessageType$<RouteMessageWrapper> {
|
|
888
869
|
constructor() {
|
|
889
870
|
super("dht.RouteMessageWrapper", [
|
|
890
|
-
{ no: 1, name: "
|
|
891
|
-
{ no: 2, name: "
|
|
892
|
-
{ no: 3, name: "
|
|
871
|
+
{ no: 1, name: "requestId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
872
|
+
{ no: 2, name: "sourcePeer", kind: "message", T: () => PeerDescriptor },
|
|
873
|
+
{ no: 3, name: "target", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
893
874
|
{ no: 4, name: "message", kind: "message", T: () => Message },
|
|
894
875
|
{ no: 5, name: "reachableThrough", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
895
876
|
{ no: 6, name: "routingPath", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor }
|
|
@@ -982,7 +963,7 @@ class Message$Type extends MessageType$<Message> {
|
|
|
982
963
|
{ no: 8, name: "handshakeRequest", kind: "message", oneof: "body", T: () => HandshakeRequest },
|
|
983
964
|
{ no: 9, name: "handshakeResponse", kind: "message", oneof: "body", T: () => HandshakeResponse },
|
|
984
965
|
{ no: 10, name: "rpcMessage", kind: "message", oneof: "body", T: () => RpcMessage },
|
|
985
|
-
{ no: 11, name: "
|
|
966
|
+
{ no: 11, name: "recursiveOperationRequest", kind: "message", oneof: "body", T: () => RecursiveOperationRequest }
|
|
986
967
|
]);
|
|
987
968
|
}
|
|
988
969
|
}
|
|
@@ -1001,18 +982,6 @@ class WebsocketConnectionRequest$Type extends MessageType$<WebsocketConnectionRe
|
|
|
1001
982
|
*/
|
|
1002
983
|
export const WebsocketConnectionRequest = new WebsocketConnectionRequest$Type();
|
|
1003
984
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
1004
|
-
class WebsocketConnectionResponse$Type extends MessageType$<WebsocketConnectionResponse> {
|
|
1005
|
-
constructor() {
|
|
1006
|
-
super("dht.WebsocketConnectionResponse", [
|
|
1007
|
-
{ no: 1, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
1008
|
-
]);
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* @generated MessageType for protobuf message dht.WebsocketConnectionResponse
|
|
1013
|
-
*/
|
|
1014
|
-
export const WebsocketConnectionResponse = new WebsocketConnectionResponse$Type();
|
|
1015
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
1016
985
|
class WebrtcConnectionRequest$Type extends MessageType$<WebrtcConnectionRequest> {
|
|
1017
986
|
constructor() {
|
|
1018
987
|
super("dht.WebrtcConnectionRequest", []);
|
|
@@ -1160,10 +1129,10 @@ export const RouterRpc = new ServiceType("dht.RouterRpc", [
|
|
|
1160
1129
|
{ name: "forwardMessage", options: {}, I: RouteMessageWrapper, O: RouteMessageAck }
|
|
1161
1130
|
]);
|
|
1162
1131
|
/**
|
|
1163
|
-
* @generated ServiceType for protobuf service dht.
|
|
1132
|
+
* @generated ServiceType for protobuf service dht.RecursiveOperationRpc
|
|
1164
1133
|
*/
|
|
1165
|
-
export const
|
|
1166
|
-
{ name: "
|
|
1134
|
+
export const RecursiveOperationRpc = new ServiceType("dht.RecursiveOperationRpc", [
|
|
1135
|
+
{ name: "routeRequest", options: {}, I: RouteMessageWrapper, O: RouteMessageAck }
|
|
1167
1136
|
]);
|
|
1168
1137
|
/**
|
|
1169
1138
|
* @generated ServiceType for protobuf service dht.StoreRpc
|
|
@@ -1173,16 +1142,16 @@ export const StoreRpc = new ServiceType("dht.StoreRpc", [
|
|
|
1173
1142
|
{ name: "replicateData", options: {}, I: ReplicateDataRequest, O: Empty }
|
|
1174
1143
|
]);
|
|
1175
1144
|
/**
|
|
1176
|
-
* @generated ServiceType for protobuf service dht.
|
|
1145
|
+
* @generated ServiceType for protobuf service dht.RecursiveOperationSessionRpc
|
|
1177
1146
|
*/
|
|
1178
|
-
export const
|
|
1179
|
-
{ name: "
|
|
1147
|
+
export const RecursiveOperationSessionRpc = new ServiceType("dht.RecursiveOperationSessionRpc", [
|
|
1148
|
+
{ name: "sendResponse", options: {}, I: RecursiveOperationResponse, O: Empty }
|
|
1180
1149
|
]);
|
|
1181
1150
|
/**
|
|
1182
1151
|
* @generated ServiceType for protobuf service dht.WebsocketConnectorRpc
|
|
1183
1152
|
*/
|
|
1184
1153
|
export const WebsocketConnectorRpc = new ServiceType("dht.WebsocketConnectorRpc", [
|
|
1185
|
-
{ name: "requestConnection", options: {}, I: WebsocketConnectionRequest, O:
|
|
1154
|
+
{ name: "requestConnection", options: {}, I: WebsocketConnectionRequest, O: Empty }
|
|
1186
1155
|
]);
|
|
1187
1156
|
/**
|
|
1188
1157
|
* @generated ServiceType for protobuf service dht.WebrtcConnectorRpc
|
|
@@ -8,7 +8,8 @@ export class DhtCallContext extends ProtoCallContext implements DhtRpcOptions {
|
|
|
8
8
|
sourceDescriptor?: PeerDescriptor
|
|
9
9
|
notification?: boolean
|
|
10
10
|
clientId?: number
|
|
11
|
-
|
|
11
|
+
connect?: boolean
|
|
12
|
+
sendIfStopped?: boolean
|
|
12
13
|
//used in incoming calls
|
|
13
14
|
incomingSourceDescriptor?: PeerDescriptor
|
|
14
15
|
}
|
|
@@ -4,7 +4,16 @@ export interface TransportEvents {
|
|
|
4
4
|
disconnected: (peerDescriptor: PeerDescriptor, gracefulLeave: boolean) => void
|
|
5
5
|
message: (message: Message) => void
|
|
6
6
|
connected: (peerDescriptor: PeerDescriptor) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SendOptions {
|
|
10
|
+
connect: boolean
|
|
11
|
+
sendIfStopped: boolean
|
|
12
|
+
}
|
|
7
13
|
|
|
14
|
+
export const DEFAULT_SEND_OPTIONS = {
|
|
15
|
+
connect: true,
|
|
16
|
+
sendIfStopped: false
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
export interface ITransport {
|
|
@@ -21,7 +30,7 @@ export interface ITransport {
|
|
|
21
30
|
off<T extends keyof TransportEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor) => void): void
|
|
22
31
|
off<T extends keyof TransportEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor, gracefulLeave: boolean) => void): void
|
|
23
32
|
|
|
24
|
-
send(msg: Message,
|
|
33
|
+
send(msg: Message, opts?: SendOptions): Promise<void>
|
|
25
34
|
getLocalPeerDescriptor(): PeerDescriptor
|
|
26
35
|
getAllConnectionPeerDescriptors(): PeerDescriptor[]
|
|
27
36
|
stop(): void | Promise<void>
|
|
@@ -9,7 +9,7 @@ export class ListeningRpcCommunicator extends RoutingRpcCommunicator {
|
|
|
9
9
|
private readonly listener: (msg: Message) => void
|
|
10
10
|
|
|
11
11
|
constructor(ownServiceId: ServiceID, transport: ITransport, config?: RpcCommunicatorConfig) {
|
|
12
|
-
super(ownServiceId, transport.send, config)
|
|
12
|
+
super(ownServiceId, (msg, opts) => transport.send(msg, opts), config)
|
|
13
13
|
this.listener = (msg: Message) => {
|
|
14
14
|
this.handleMessageFromPeer(msg)
|
|
15
15
|
}
|
|
@@ -4,14 +4,15 @@ import { RpcCommunicator, RpcCommunicatorConfig } from '@streamr/proto-rpc'
|
|
|
4
4
|
import { DhtCallContext } from '../rpc-protocol/DhtCallContext'
|
|
5
5
|
import { RpcMessage } from '../proto/packages/proto-rpc/protos/ProtoRpc'
|
|
6
6
|
import { ServiceID } from '../types/ServiceID'
|
|
7
|
+
import { DEFAULT_SEND_OPTIONS, SendOptions } from './ITransport'
|
|
7
8
|
|
|
8
9
|
export class RoutingRpcCommunicator extends RpcCommunicator {
|
|
9
10
|
private ownServiceId: ServiceID
|
|
10
|
-
private sendFn: (msg: Message,
|
|
11
|
+
private sendFn: (msg: Message, opts: SendOptions) => Promise<void>
|
|
11
12
|
|
|
12
13
|
constructor(
|
|
13
14
|
ownServiceId: ServiceID,
|
|
14
|
-
sendFn: (msg: Message,
|
|
15
|
+
sendFn: (msg: Message, opts: SendOptions) => Promise<void>,
|
|
15
16
|
config?: RpcCommunicatorConfig
|
|
16
17
|
) {
|
|
17
18
|
super(config)
|
|
@@ -38,20 +39,25 @@ export class RoutingRpcCommunicator extends RpcCommunicator {
|
|
|
38
39
|
targetDescriptor
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
// TODO
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
// TODO maybe sendOptions could be a separate block inside callContext
|
|
43
|
+
const sendOpts = (msg.header.response !== undefined)
|
|
44
|
+
? {
|
|
45
|
+
// typically we already have a connection, but if it has disconnected for some reason
|
|
46
|
+
// the receiver could have gone offline (or it is no longer a neighbor) and therefore there
|
|
47
|
+
// is no point in trying form a new connection
|
|
48
|
+
connect: false,
|
|
49
|
+
// TODO maybe this options could be removed?
|
|
50
|
+
sendIfStopped: true
|
|
51
|
+
} : {
|
|
52
|
+
connect: callContext?.connect ?? DEFAULT_SEND_OPTIONS.connect,
|
|
53
|
+
sendIfStopped: callContext?.sendIfStopped ?? DEFAULT_SEND_OPTIONS.sendIfStopped
|
|
54
|
+
}
|
|
55
|
+
return this.sendFn(message, sendOpts)
|
|
50
56
|
})
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
public handleMessageFromPeer(message: Message): void {
|
|
54
|
-
if (message.serviceId
|
|
60
|
+
if (message.serviceId === this.ownServiceId && message.body.oneofKind === 'rpcMessage') {
|
|
55
61
|
const context = new DhtCallContext()
|
|
56
62
|
context.incomingSourceDescriptor = message.sourceDescriptor
|
|
57
63
|
// TODO should we have some handling for this floating promise?
|