@streamr/dht 100.0.0-testnet-one.4 → 100.0.0-testnet-two.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +66 -0
- 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/Handshaker.d.ts +1 -1
- package/dist/src/connection/Handshaker.js +14 -5
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +4 -7
- package/dist/src/connection/ManagedConnection.js +9 -13
- 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 +21 -14
- 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 +48 -44
- 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 +41 -54
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.d.ts +2 -3
- package/dist/src/dht/DhtNodeRpcLocal.js +1 -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 +9 -11
- 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 -23
- 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/helpers/versionCompatibility.d.ts +2 -0
- package/dist/src/helpers/versionCompatibility.js +18 -0
- package/dist/src/helpers/versionCompatibility.js.map +1 -0
- 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 +49 -65
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +43 -58
- 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 +20 -24
- 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/Handshaker.ts +21 -6
- package/src/connection/ManagedConnection.ts +20 -34
- 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 +25 -18
- 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 +57 -61
- 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 +69 -71
- package/src/dht/DhtNodeRpcLocal.ts +1 -3
- package/src/dht/DhtNodeRpcRemote.ts +14 -18
- 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 -27
- 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/helpers/versionCompatibility.ts +13 -0
- 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 +67 -90
- 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/unit/versionCompatibility.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/tsconfig.browser.json +2 -1
- package/tsconfig.jest.json +2 -1
- package/tsconfig.node.json +2 -1
- 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
|
*/
|
|
@@ -193,10 +189,6 @@ export interface PingResponse {
|
|
|
193
189
|
* @generated from protobuf message dht.LeaveNotice
|
|
194
190
|
*/
|
|
195
191
|
export interface LeaveNotice {
|
|
196
|
-
/**
|
|
197
|
-
* @generated from protobuf field: string serviceId = 1;
|
|
198
|
-
*/
|
|
199
|
-
serviceId: string;
|
|
200
192
|
}
|
|
201
193
|
/**
|
|
202
194
|
* @generated from protobuf message dht.PeerDescriptor
|
|
@@ -249,17 +241,17 @@ export interface ConnectivityMethod {
|
|
|
249
241
|
*/
|
|
250
242
|
export interface RouteMessageWrapper {
|
|
251
243
|
/**
|
|
252
|
-
* @generated from protobuf field:
|
|
244
|
+
* @generated from protobuf field: string requestId = 1;
|
|
253
245
|
*/
|
|
254
|
-
|
|
246
|
+
requestId: string;
|
|
255
247
|
/**
|
|
256
|
-
* @generated from protobuf field:
|
|
248
|
+
* @generated from protobuf field: dht.PeerDescriptor sourcePeer = 2;
|
|
257
249
|
*/
|
|
258
|
-
|
|
250
|
+
sourcePeer?: PeerDescriptor;
|
|
259
251
|
/**
|
|
260
|
-
* @generated from protobuf field:
|
|
252
|
+
* @generated from protobuf field: bytes target = 3;
|
|
261
253
|
*/
|
|
262
|
-
|
|
254
|
+
target: Uint8Array;
|
|
263
255
|
/**
|
|
264
256
|
* @generated from protobuf field: dht.Message message = 4;
|
|
265
257
|
*/
|
|
@@ -338,6 +330,10 @@ export interface HandshakeRequest {
|
|
|
338
330
|
* @generated from protobuf field: optional dht.PeerDescriptor targetPeerDescriptor = 2;
|
|
339
331
|
*/
|
|
340
332
|
targetPeerDescriptor?: PeerDescriptor;
|
|
333
|
+
/**
|
|
334
|
+
* @generated from protobuf field: string version = 3;
|
|
335
|
+
*/
|
|
336
|
+
version: string;
|
|
341
337
|
}
|
|
342
338
|
/**
|
|
343
339
|
* @generated from protobuf message dht.HandshakeResponse
|
|
@@ -351,6 +347,10 @@ export interface HandshakeResponse {
|
|
|
351
347
|
* @generated from protobuf field: optional dht.HandshakeError error = 2;
|
|
352
348
|
*/
|
|
353
349
|
error?: HandshakeError;
|
|
350
|
+
/**
|
|
351
|
+
* @generated from protobuf field: string version = 3;
|
|
352
|
+
*/
|
|
353
|
+
version: string;
|
|
354
354
|
}
|
|
355
355
|
/**
|
|
356
356
|
* @generated from protobuf message dht.Message
|
|
@@ -410,11 +410,11 @@ export interface Message {
|
|
|
410
410
|
*/
|
|
411
411
|
rpcMessage: RpcMessage;
|
|
412
412
|
} | {
|
|
413
|
-
oneofKind: "
|
|
413
|
+
oneofKind: "recursiveOperationRequest";
|
|
414
414
|
/**
|
|
415
|
-
* @generated from protobuf field: dht.
|
|
415
|
+
* @generated from protobuf field: dht.RecursiveOperationRequest recursiveOperationRequest = 11;
|
|
416
416
|
*/
|
|
417
|
-
|
|
417
|
+
recursiveOperationRequest: RecursiveOperationRequest;
|
|
418
418
|
} | {
|
|
419
419
|
oneofKind: undefined;
|
|
420
420
|
};
|
|
@@ -428,15 +428,6 @@ export interface Message {
|
|
|
428
428
|
*/
|
|
429
429
|
export interface WebsocketConnectionRequest {
|
|
430
430
|
}
|
|
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
431
|
/**
|
|
441
432
|
* WebRTC
|
|
442
433
|
*
|
|
@@ -547,13 +538,13 @@ export interface ExternalFindDataResponse {
|
|
|
547
538
|
entries: DataEntry[];
|
|
548
539
|
}
|
|
549
540
|
/**
|
|
550
|
-
* @generated from protobuf enum dht.
|
|
541
|
+
* @generated from protobuf enum dht.RecursiveOperation
|
|
551
542
|
*/
|
|
552
|
-
export enum
|
|
543
|
+
export enum RecursiveOperation {
|
|
553
544
|
/**
|
|
554
|
-
* @generated from protobuf enum value:
|
|
545
|
+
* @generated from protobuf enum value: FIND_NODE = 0;
|
|
555
546
|
*/
|
|
556
|
-
|
|
547
|
+
FIND_NODE = 0,
|
|
557
548
|
/**
|
|
558
549
|
* @generated from protobuf enum value: FETCH_DATA = 1;
|
|
559
550
|
*/
|
|
@@ -574,11 +565,7 @@ export enum NodeType {
|
|
|
574
565
|
/**
|
|
575
566
|
* @generated from protobuf enum value: BROWSER = 1;
|
|
576
567
|
*/
|
|
577
|
-
BROWSER = 1
|
|
578
|
-
/**
|
|
579
|
-
* @generated from protobuf enum value: VIRTUAL = 3;
|
|
580
|
-
*/
|
|
581
|
-
VIRTUAL = 3
|
|
568
|
+
BROWSER = 1
|
|
582
569
|
}
|
|
583
570
|
/**
|
|
584
571
|
* @generated from protobuf enum dht.RpcResponseError
|
|
@@ -632,7 +619,11 @@ export enum HandshakeError {
|
|
|
632
619
|
/**
|
|
633
620
|
* @generated from protobuf enum value: INVALID_TARGET_PEER_DESCRIPTOR = 1;
|
|
634
621
|
*/
|
|
635
|
-
INVALID_TARGET_PEER_DESCRIPTOR = 1
|
|
622
|
+
INVALID_TARGET_PEER_DESCRIPTOR = 1,
|
|
623
|
+
/**
|
|
624
|
+
* @generated from protobuf enum value: UNSUPPORTED_VERSION = 2;
|
|
625
|
+
*/
|
|
626
|
+
UNSUPPORTED_VERSION = 2
|
|
636
627
|
}
|
|
637
628
|
// Wraps all messages
|
|
638
629
|
|
|
@@ -661,9 +652,9 @@ export enum MessageType {
|
|
|
661
652
|
*/
|
|
662
653
|
HANDSHAKE_RESPONSE = 4,
|
|
663
654
|
/**
|
|
664
|
-
* @generated from protobuf enum value:
|
|
655
|
+
* @generated from protobuf enum value: RECURSIVE_OPERATION_REQUEST = 5;
|
|
665
656
|
*/
|
|
666
|
-
|
|
657
|
+
RECURSIVE_OPERATION_REQUEST = 5
|
|
667
658
|
}
|
|
668
659
|
/**
|
|
669
660
|
* @generated from protobuf enum dht.DisconnectMode
|
|
@@ -684,7 +675,7 @@ class StoreDataRequest$Type extends MessageType$<StoreDataRequest> {
|
|
|
684
675
|
super("dht.StoreDataRequest", [
|
|
685
676
|
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
686
677
|
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
687
|
-
{ no: 3, name: "creator", kind: "
|
|
678
|
+
{ no: 3, name: "creator", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
688
679
|
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
689
680
|
{ no: 5, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
690
681
|
]);
|
|
@@ -697,9 +688,7 @@ export const StoreDataRequest = new StoreDataRequest$Type();
|
|
|
697
688
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
698
689
|
class StoreDataResponse$Type extends MessageType$<StoreDataResponse> {
|
|
699
690
|
constructor() {
|
|
700
|
-
super("dht.StoreDataResponse", [
|
|
701
|
-
{ no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
702
|
-
]);
|
|
691
|
+
super("dht.StoreDataResponse", []);
|
|
703
692
|
}
|
|
704
693
|
}
|
|
705
694
|
/**
|
|
@@ -749,7 +738,7 @@ class DataEntry$Type extends MessageType$<DataEntry> {
|
|
|
749
738
|
super("dht.DataEntry", [
|
|
750
739
|
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
751
740
|
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
752
|
-
{ no: 3, name: "creator", kind: "
|
|
741
|
+
{ no: 3, name: "creator", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
753
742
|
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
754
743
|
{ no: 5, name: "storedAt", kind: "message", T: () => Timestamp },
|
|
755
744
|
{ no: 6, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
@@ -789,22 +778,22 @@ class ClosestPeersResponse$Type extends MessageType$<ClosestPeersResponse> {
|
|
|
789
778
|
*/
|
|
790
779
|
export const ClosestPeersResponse = new ClosestPeersResponse$Type();
|
|
791
780
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
792
|
-
class
|
|
781
|
+
class RecursiveOperationRequest$Type extends MessageType$<RecursiveOperationRequest> {
|
|
793
782
|
constructor() {
|
|
794
|
-
super("dht.
|
|
783
|
+
super("dht.RecursiveOperationRequest", [
|
|
795
784
|
{ no: 1, name: "sessionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
796
|
-
{ no: 2, name: "
|
|
785
|
+
{ no: 2, name: "operation", kind: "enum", T: () => ["dht.RecursiveOperation", RecursiveOperation] }
|
|
797
786
|
]);
|
|
798
787
|
}
|
|
799
788
|
}
|
|
800
789
|
/**
|
|
801
|
-
* @generated MessageType for protobuf message dht.
|
|
790
|
+
* @generated MessageType for protobuf message dht.RecursiveOperationRequest
|
|
802
791
|
*/
|
|
803
|
-
export const
|
|
792
|
+
export const RecursiveOperationRequest = new RecursiveOperationRequest$Type();
|
|
804
793
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
805
|
-
class
|
|
794
|
+
class RecursiveOperationResponse$Type extends MessageType$<RecursiveOperationResponse> {
|
|
806
795
|
constructor() {
|
|
807
|
-
super("dht.
|
|
796
|
+
super("dht.RecursiveOperationResponse", [
|
|
808
797
|
{ no: 1, name: "closestConnectedPeers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
809
798
|
{ no: 2, name: "dataEntries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataEntry },
|
|
810
799
|
{ no: 3, name: "noCloserNodesFound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
@@ -813,9 +802,9 @@ class FindResponse$Type extends MessageType$<FindResponse> {
|
|
|
813
802
|
}
|
|
814
803
|
}
|
|
815
804
|
/**
|
|
816
|
-
* @generated MessageType for protobuf message dht.
|
|
805
|
+
* @generated MessageType for protobuf message dht.RecursiveOperationResponse
|
|
817
806
|
*/
|
|
818
|
-
export const
|
|
807
|
+
export const RecursiveOperationResponse = new RecursiveOperationResponse$Type();
|
|
819
808
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
820
809
|
class PingRequest$Type extends MessageType$<PingRequest> {
|
|
821
810
|
constructor() {
|
|
@@ -843,9 +832,7 @@ export const PingResponse = new PingResponse$Type();
|
|
|
843
832
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
844
833
|
class LeaveNotice$Type extends MessageType$<LeaveNotice> {
|
|
845
834
|
constructor() {
|
|
846
|
-
super("dht.LeaveNotice", [
|
|
847
|
-
{ no: 1, name: "serviceId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
848
|
-
]);
|
|
835
|
+
super("dht.LeaveNotice", []);
|
|
849
836
|
}
|
|
850
837
|
}
|
|
851
838
|
/**
|
|
@@ -887,9 +874,9 @@ export const ConnectivityMethod = new ConnectivityMethod$Type();
|
|
|
887
874
|
class RouteMessageWrapper$Type extends MessageType$<RouteMessageWrapper> {
|
|
888
875
|
constructor() {
|
|
889
876
|
super("dht.RouteMessageWrapper", [
|
|
890
|
-
{ no: 1, name: "
|
|
891
|
-
{ no: 2, name: "
|
|
892
|
-
{ no: 3, name: "
|
|
877
|
+
{ no: 1, name: "requestId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
878
|
+
{ no: 2, name: "sourcePeer", kind: "message", T: () => PeerDescriptor },
|
|
879
|
+
{ no: 3, name: "target", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
893
880
|
{ no: 4, name: "message", kind: "message", T: () => Message },
|
|
894
881
|
{ no: 5, name: "reachableThrough", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
895
882
|
{ no: 6, name: "routingPath", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor }
|
|
@@ -947,7 +934,8 @@ class HandshakeRequest$Type extends MessageType$<HandshakeRequest> {
|
|
|
947
934
|
constructor() {
|
|
948
935
|
super("dht.HandshakeRequest", [
|
|
949
936
|
{ no: 1, name: "sourcePeerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
950
|
-
{ no: 2, name: "targetPeerDescriptor", kind: "message", T: () => PeerDescriptor }
|
|
937
|
+
{ no: 2, name: "targetPeerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
938
|
+
{ no: 3, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
951
939
|
]);
|
|
952
940
|
}
|
|
953
941
|
}
|
|
@@ -960,7 +948,8 @@ class HandshakeResponse$Type extends MessageType$<HandshakeResponse> {
|
|
|
960
948
|
constructor() {
|
|
961
949
|
super("dht.HandshakeResponse", [
|
|
962
950
|
{ no: 1, name: "sourcePeerDescriptor", kind: "message", T: () => PeerDescriptor },
|
|
963
|
-
{ no: 2, name: "error", kind: "enum", opt: true, T: () => ["dht.HandshakeError", HandshakeError] }
|
|
951
|
+
{ no: 2, name: "error", kind: "enum", opt: true, T: () => ["dht.HandshakeError", HandshakeError] },
|
|
952
|
+
{ no: 3, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
964
953
|
]);
|
|
965
954
|
}
|
|
966
955
|
}
|
|
@@ -982,7 +971,7 @@ class Message$Type extends MessageType$<Message> {
|
|
|
982
971
|
{ no: 8, name: "handshakeRequest", kind: "message", oneof: "body", T: () => HandshakeRequest },
|
|
983
972
|
{ no: 9, name: "handshakeResponse", kind: "message", oneof: "body", T: () => HandshakeResponse },
|
|
984
973
|
{ no: 10, name: "rpcMessage", kind: "message", oneof: "body", T: () => RpcMessage },
|
|
985
|
-
{ no: 11, name: "
|
|
974
|
+
{ no: 11, name: "recursiveOperationRequest", kind: "message", oneof: "body", T: () => RecursiveOperationRequest }
|
|
986
975
|
]);
|
|
987
976
|
}
|
|
988
977
|
}
|
|
@@ -1001,18 +990,6 @@ class WebsocketConnectionRequest$Type extends MessageType$<WebsocketConnectionRe
|
|
|
1001
990
|
*/
|
|
1002
991
|
export const WebsocketConnectionRequest = new WebsocketConnectionRequest$Type();
|
|
1003
992
|
// @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
993
|
class WebrtcConnectionRequest$Type extends MessageType$<WebrtcConnectionRequest> {
|
|
1017
994
|
constructor() {
|
|
1018
995
|
super("dht.WebrtcConnectionRequest", []);
|
|
@@ -1160,10 +1137,10 @@ export const RouterRpc = new ServiceType("dht.RouterRpc", [
|
|
|
1160
1137
|
{ name: "forwardMessage", options: {}, I: RouteMessageWrapper, O: RouteMessageAck }
|
|
1161
1138
|
]);
|
|
1162
1139
|
/**
|
|
1163
|
-
* @generated ServiceType for protobuf service dht.
|
|
1140
|
+
* @generated ServiceType for protobuf service dht.RecursiveOperationRpc
|
|
1164
1141
|
*/
|
|
1165
|
-
export const
|
|
1166
|
-
{ name: "
|
|
1142
|
+
export const RecursiveOperationRpc = new ServiceType("dht.RecursiveOperationRpc", [
|
|
1143
|
+
{ name: "routeRequest", options: {}, I: RouteMessageWrapper, O: RouteMessageAck }
|
|
1167
1144
|
]);
|
|
1168
1145
|
/**
|
|
1169
1146
|
* @generated ServiceType for protobuf service dht.StoreRpc
|
|
@@ -1173,16 +1150,16 @@ export const StoreRpc = new ServiceType("dht.StoreRpc", [
|
|
|
1173
1150
|
{ name: "replicateData", options: {}, I: ReplicateDataRequest, O: Empty }
|
|
1174
1151
|
]);
|
|
1175
1152
|
/**
|
|
1176
|
-
* @generated ServiceType for protobuf service dht.
|
|
1153
|
+
* @generated ServiceType for protobuf service dht.RecursiveOperationSessionRpc
|
|
1177
1154
|
*/
|
|
1178
|
-
export const
|
|
1179
|
-
{ name: "
|
|
1155
|
+
export const RecursiveOperationSessionRpc = new ServiceType("dht.RecursiveOperationSessionRpc", [
|
|
1156
|
+
{ name: "sendResponse", options: {}, I: RecursiveOperationResponse, O: Empty }
|
|
1180
1157
|
]);
|
|
1181
1158
|
/**
|
|
1182
1159
|
* @generated ServiceType for protobuf service dht.WebsocketConnectorRpc
|
|
1183
1160
|
*/
|
|
1184
1161
|
export const WebsocketConnectorRpc = new ServiceType("dht.WebsocketConnectorRpc", [
|
|
1185
|
-
{ name: "requestConnection", options: {}, I: WebsocketConnectionRequest, O:
|
|
1162
|
+
{ name: "requestConnection", options: {}, I: WebsocketConnectionRequest, O: Empty }
|
|
1186
1163
|
]);
|
|
1187
1164
|
/**
|
|
1188
1165
|
* @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
|
}
|