@streamr/dht 100.0.0-testnet-two.4 → 100.0.0-testnet-three.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 +8 -9
- package/dist/src/connection/Connection.d.ts +1 -0
- package/dist/src/connection/Connection.js +10 -3
- package/dist/src/connection/Connection.js.map +1 -1
- package/dist/src/connection/ConnectionLockHandler.d.ts +3 -3
- package/dist/src/connection/ConnectionLockHandler.js +8 -10
- package/dist/src/connection/ConnectionLockHandler.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcLocal.js +5 -4
- package/dist/src/connection/ConnectionLockRpcLocal.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcRemote.js +4 -4
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -1
- package/dist/src/connection/ConnectionManager.d.ts +8 -8
- package/dist/src/connection/ConnectionManager.js +54 -55
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +3 -2
- package/dist/src/connection/ConnectorFacade.js +7 -0
- package/dist/src/connection/ConnectorFacade.js.map +1 -1
- package/dist/src/connection/Handshaker.js +3 -1
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/IConnection.d.ts +2 -7
- package/dist/src/connection/IConnection.js +1 -8
- package/dist/src/connection/IConnection.js.map +1 -1
- package/dist/src/connection/ManagedConnection.js +23 -15
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/ManagedWebrtcConnection.js.map +1 -1
- package/dist/src/connection/connectivityChecker.d.ts +1 -1
- package/dist/src/connection/connectivityChecker.js +9 -2
- package/dist/src/connection/connectivityChecker.js.map +1 -1
- package/dist/src/connection/connectivityRequestHandler.js +8 -2
- package/dist/src/connection/connectivityRequestHandler.js.map +1 -1
- package/dist/src/connection/simulator/Simulator.js +32 -20
- package/dist/src/connection/simulator/Simulator.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnection.js +13 -10
- package/dist/src/connection/simulator/SimulatorConnection.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnector.js +9 -6
- package/dist/src/connection/simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/simulator/pings.js.map +1 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.d.ts +1 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js +26 -14
- 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 +18 -17
- package/dist/src/connection/webrtc/WebrtcConnector.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js +10 -9
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/webrtc/iceServerAsString.js.map +1 -1
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js +3 -0
- package/dist/src/connection/websocket/AutoCertifierClientFacade.js.map +1 -1
- package/dist/src/connection/websocket/ClientWebsocket.js +7 -4
- package/dist/src/connection/websocket/ClientWebsocket.js.map +1 -1
- package/dist/src/connection/websocket/ServerWebsocket.d.ts +1 -0
- package/dist/src/connection/websocket/ServerWebsocket.js +22 -3
- package/dist/src/connection/websocket/ServerWebsocket.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnector.d.ts +2 -1
- package/dist/src/connection/websocket/WebsocketConnector.js +27 -16
- package/dist/src/connection/websocket/WebsocketConnector.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.d.ts +2 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js +3 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js +2 -2
- package/dist/src/connection/websocket/WebsocketConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketServer.js +6 -3
- package/dist/src/connection/websocket/WebsocketServer.js.map +1 -1
- package/dist/src/dht/DhtNode.d.ts +18 -19
- package/dist/src/dht/DhtNode.js +56 -65
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.d.ts +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.js +5 -4
- package/dist/src/dht/DhtNodeRpcLocal.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcRemote.d.ts +2 -1
- package/dist/src/dht/DhtNodeRpcRemote.js +5 -3
- package/dist/src/dht/DhtNodeRpcRemote.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcLocal.d.ts +1 -1
- package/dist/src/dht/ExternalApiRpcLocal.js +4 -3
- package/dist/src/dht/ExternalApiRpcLocal.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -1
- package/dist/src/dht/PeerManager.d.ts +5 -5
- package/dist/src/dht/PeerManager.js +31 -24
- package/dist/src/dht/PeerManager.js.map +1 -1
- package/dist/src/dht/contact/Contact.js +3 -2
- package/dist/src/dht/contact/Contact.js.map +1 -1
- package/dist/src/dht/contact/ContactList.js +9 -5
- package/dist/src/dht/contact/ContactList.js.map +1 -1
- package/dist/src/dht/contact/RandomContactList.js +1 -0
- package/dist/src/dht/contact/RandomContactList.js.map +1 -1
- package/dist/src/dht/contact/RpcRemote.d.ts +2 -1
- package/dist/src/dht/contact/RpcRemote.js +4 -0
- package/dist/src/dht/contact/RpcRemote.js.map +1 -1
- package/dist/src/dht/contact/SortedContactList.js +3 -2
- package/dist/src/dht/contact/SortedContactList.js.map +1 -1
- package/dist/src/dht/discovery/DiscoverySession.js +8 -8
- package/dist/src/dht/discovery/DiscoverySession.js.map +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +8 -2
- package/dist/src/dht/discovery/PeerDiscovery.js +26 -17
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.d.ts +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js +9 -9
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js +3 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js +6 -5
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.d.ts +2 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js +26 -20
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.d.ts +4 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js +5 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js.map +1 -1
- package/dist/src/dht/routing/DuplicateDetector.d.ts +2 -4
- package/dist/src/dht/routing/DuplicateDetector.js +10 -15
- package/dist/src/dht/routing/DuplicateDetector.js.map +1 -1
- package/dist/src/dht/routing/Router.d.ts +1 -1
- package/dist/src/dht/routing/Router.js +20 -15
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcLocal.js +4 -4
- package/dist/src/dht/routing/RouterRpcLocal.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcRemote.js +11 -9
- package/dist/src/dht/routing/RouterRpcRemote.js.map +1 -1
- package/dist/src/dht/routing/RoutingSession.d.ts +2 -0
- package/dist/src/dht/routing/RoutingSession.js +27 -9
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/store/LocalDataStore.js +5 -4
- package/dist/src/dht/store/LocalDataStore.js.map +1 -1
- package/dist/src/dht/store/StoreManager.js +8 -8
- package/dist/src/dht/store/StoreManager.js.map +1 -1
- package/dist/src/dht/store/StoreRpcLocal.js +1 -0
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -1
- package/dist/src/dht/store/StoreRpcRemote.js +3 -3
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -1
- package/dist/src/exports.d.ts +1 -4
- package/dist/src/exports.js +4 -7
- package/dist/src/exports.js.map +1 -1
- package/dist/src/helpers/AddressTools.js.map +1 -1
- package/dist/src/helpers/Connectivity.js.map +1 -1
- package/dist/src/helpers/MapWithTtl.js +2 -1
- package/dist/src/helpers/MapWithTtl.js.map +1 -1
- package/dist/src/helpers/createPeerDescriptor.d.ts +3 -0
- package/dist/src/helpers/createPeerDescriptor.js +56 -0
- package/dist/src/helpers/createPeerDescriptor.js.map +1 -0
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.d.ts +2 -0
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.js +30 -0
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.js.map +1 -0
- package/dist/src/helpers/debugHelpers.js.map +1 -1
- package/dist/src/helpers/errors.js +2 -0
- package/dist/src/helpers/errors.js.map +1 -1
- package/dist/src/helpers/offering.d.ts +4 -0
- package/dist/src/helpers/offering.js +18 -0
- package/dist/src/helpers/offering.js.map +1 -0
- package/dist/src/helpers/protoToString.js.map +1 -1
- package/dist/src/identifiers.d.ts +3 -0
- package/dist/src/identifiers.js +9 -1
- package/dist/src/identifiers.js.map +1 -1
- package/dist/src/proto/google/protobuf/any.js +8 -8
- package/dist/src/proto/google/protobuf/any.js.map +1 -1
- package/dist/src/proto/google/protobuf/empty.js +2 -4
- package/dist/src/proto/google/protobuf/empty.js.map +1 -1
- package/dist/src/proto/google/protobuf/timestamp.js +10 -10
- package/dist/src/proto/google/protobuf/timestamp.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +4 -5
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +38 -29
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +26 -12
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +12 -16
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +2 -3
- package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.js +1 -1
- package/dist/src/rpc-protocol/DhtCallContext.d.ts +0 -1
- package/dist/src/rpc-protocol/DhtCallContext.js +8 -0
- package/dist/src/rpc-protocol/DhtCallContext.js.map +1 -1
- package/dist/src/transport/ITransport.d.ts +1 -1
- package/dist/src/transport/ListeningRpcCommunicator.js +2 -0
- package/dist/src/transport/ListeningRpcCommunicator.js.map +1 -1
- package/dist/src/transport/RoutingRpcCommunicator.d.ts +2 -1
- package/dist/src/transport/RoutingRpcCommunicator.js +2 -0
- package/dist/src/transport/RoutingRpcCommunicator.js.map +1 -1
- package/package.json +8 -9
- package/protos/DhtRpc.proto +8 -4
- package/src/connection/Connection.ts +6 -1
- package/src/connection/ConnectionLockHandler.ts +3 -3
- package/src/connection/ConnectionLockRpcLocal.ts +1 -5
- package/src/connection/ConnectionLockRpcRemote.ts +1 -1
- package/src/connection/ConnectionManager.ts +24 -38
- package/src/connection/ConnectorFacade.ts +3 -2
- package/src/connection/Handshaker.ts +4 -4
- package/src/connection/IConnection.ts +2 -8
- package/src/connection/ManagedConnection.ts +3 -3
- package/src/connection/connectivityChecker.ts +9 -2
- package/src/connection/connectivityRequestHandler.ts +10 -3
- package/src/connection/simulator/Simulator.ts +1 -2
- package/src/connection/simulator/SimulatorConnection.ts +1 -1
- package/src/connection/simulator/SimulatorConnector.ts +1 -2
- package/src/connection/webrtc/BrowserWebrtcConnection.ts +4 -3
- package/src/connection/webrtc/NodeWebrtcConnection.ts +5 -4
- package/src/connection/webrtc/WebrtcConnector.ts +9 -17
- package/src/connection/webrtc/WebrtcConnectorRpcLocal.ts +9 -9
- package/src/connection/websocket/ClientWebsocket.ts +3 -2
- package/src/connection/websocket/ServerWebsocket.ts +17 -1
- package/src/connection/websocket/WebsocketConnector.ts +16 -13
- package/src/connection/websocket/WebsocketConnectorRpcLocal.ts +4 -2
- package/src/connection/websocket/WebsocketConnectorRpcRemote.ts +1 -1
- package/src/connection/websocket/WebsocketServer.ts +2 -2
- package/src/dht/DhtNode.ts +63 -86
- package/src/dht/DhtNodeRpcLocal.ts +5 -5
- package/src/dht/DhtNodeRpcRemote.ts +3 -3
- package/src/dht/ExternalApiRpcLocal.ts +3 -4
- package/src/dht/PeerManager.ts +14 -20
- package/src/dht/contact/Contact.ts +1 -2
- package/src/dht/contact/RpcRemote.ts +2 -1
- package/src/dht/discovery/DiscoverySession.ts +2 -3
- package/src/dht/discovery/PeerDiscovery.ts +16 -9
- package/src/dht/recursive-operation/RecursiveOperationManager.ts +12 -6
- package/src/dht/recursive-operation/RecursiveOperationRpcLocal.ts +1 -1
- package/src/dht/recursive-operation/RecursiveOperationRpcRemote.ts +3 -2
- package/src/dht/recursive-operation/RecursiveOperationSession.ts +19 -9
- package/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.ts +13 -3
- package/src/dht/routing/DuplicateDetector.ts +9 -21
- package/src/dht/routing/Router.ts +12 -11
- package/src/dht/routing/RouterRpcLocal.ts +1 -2
- package/src/dht/routing/RouterRpcRemote.ts +5 -5
- package/src/dht/routing/RoutingSession.ts +22 -2
- package/src/dht/store/StoreManager.ts +1 -2
- package/src/dht/store/StoreRpcRemote.ts +1 -1
- package/src/exports.ts +9 -4
- package/src/helpers/createPeerDescriptor.ts +56 -0
- package/src/helpers/createPeerDescriptorSignaturePayload.ts +28 -0
- package/src/helpers/offering.ts +15 -0
- package/src/identifiers.ts +10 -1
- package/src/proto/google/protobuf/any.ts +4 -4
- package/src/proto/google/protobuf/empty.ts +2 -4
- package/src/proto/google/protobuf/timestamp.ts +4 -4
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +6 -7
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +3 -4
- package/src/proto/packages/dht/protos/DhtRpc.ts +37 -20
- package/src/proto/packages/proto-rpc/protos/ProtoRpc.ts +1 -1
- package/src/rpc-protocol/DhtCallContext.ts +0 -1
- package/src/transport/ITransport.ts +1 -1
- package/src/transport/RoutingRpcCommunicator.ts +1 -1
- package/test/benchmark/Find.test.ts +6 -8
- package/test/benchmark/KademliaCorrectness.test.ts +2 -3
- package/test/benchmark/SortedContactListBenchmark.test.ts +16 -16
- package/test/benchmark/WebsocketServerMemoryLeak.test.ts +1 -1
- package/test/benchmark/kademlia-simulation/KademliaSimulation.ts +8 -8
- package/test/benchmark/kademlia-simulation/SimulationNode.ts +8 -8
- package/test/end-to-end/Layer0-Layer1.test.ts +1 -1
- package/test/end-to-end/Layer0.test.ts +4 -4
- package/test/end-to-end/Layer0MixedConnectionTypes.test.ts +12 -12
- package/test/end-to-end/Layer0Webrtc-Layer1.test.ts +18 -18
- package/test/end-to-end/Layer0Webrtc.test.ts +13 -10
- package/test/end-to-end/Layer1-Scale-WebSocket.test.ts +2 -2
- package/test/end-to-end/Layer1-Scale-Webrtc.test.ts +2 -2
- package/test/end-to-end/RecoveryFromFailedAutoCertification.test.ts +1 -1
- package/test/end-to-end/WebsocketConnectionRequest.test.ts +3 -3
- package/test/end-to-end/memory-leak.test.ts +2 -2
- package/test/integration/ConnectionLocking.test.ts +60 -47
- package/test/integration/ConnectionManager.test.ts +8 -7
- package/test/integration/ConnectivityChecking.test.ts +64 -0
- package/test/integration/DhtJoinPeerDiscovery.test.ts +2 -2
- package/test/integration/DhtNodeExternalAPI.test.ts +1 -2
- package/test/integration/DhtNodeRpcRemote.test.ts +4 -3
- package/test/integration/DhtRpc.test.ts +4 -3
- package/test/integration/Find.test.ts +4 -6
- package/test/integration/Layer1-scale.test.ts +7 -7
- package/test/integration/Mock-Layer1-Layer0.test.ts +21 -24
- package/test/integration/MultipleEntryPointJoining.test.ts +7 -7
- package/test/integration/ReplicateData.test.ts +52 -161
- package/test/integration/RouteMessage.test.ts +24 -47
- package/test/integration/RouterRpcRemote.test.ts +7 -4
- package/test/integration/ScaleDownDht.test.ts +2 -3
- package/test/integration/SimultaneousConnections.test.ts +9 -8
- package/test/integration/Store.test.ts +1 -2
- package/test/integration/StoreAndDelete.test.ts +5 -0
- package/test/integration/StoreOnDhtWithThreeNodes.test.ts +59 -0
- package/test/integration/StoreOnDhtWithTwoNodes.test.ts +1 -1
- package/test/integration/StoreRpcRemote.test.ts +4 -4
- package/test/integration/WebrtcConnectionManagement.test.ts +6 -5
- package/test/integration/WebrtcConnectorRpc.test.ts +3 -2
- package/test/integration/WebsocketConnectionManagement.test.ts +27 -15
- package/test/integration/WebsocketConnectorRpc.test.ts +3 -2
- package/test/integration/{RpcErrors.test.ts → rpc-connections-over-webrpc.test.ts} +6 -3
- package/test/unit/DuplicateDetector.test.ts +2 -2
- package/test/unit/LocalDataStore.test.ts +1 -4
- package/test/unit/RandomContactList.test.ts +2 -4
- package/test/unit/RecursiveOperationManager.test.ts +5 -6
- package/test/unit/RecursiveOperationSession.test.ts +5 -4
- package/test/unit/Router.test.ts +25 -8
- package/test/unit/RoutingSession.test.ts +3 -3
- package/test/unit/SortedContactList.test.ts +2 -4
- package/test/unit/connectivityRequestHandler.test.ts +7 -3
- package/test/unit/createPeerDescriptor.test.ts +63 -0
- package/test/utils/FakeTransport.ts +7 -4
- package/test/utils/mock/Transport.ts +1 -1
- package/test/utils/utils.ts +6 -6
- package/dist/src/helpers/PeerID.d.ts +0 -27
- package/dist/src/helpers/PeerID.js +0 -87
- package/dist/src/helpers/PeerID.js.map +0 -1
- package/dist/src/helpers/UUID.d.ts +0 -8
- package/dist/src/helpers/UUID.js +0 -36
- package/dist/src/helpers/UUID.js.map +0 -1
- package/dist/src/helpers/peerIdFromPeerDescriptor.d.ts +0 -7
- package/dist/src/helpers/peerIdFromPeerDescriptor.js +0 -23
- package/dist/src/helpers/peerIdFromPeerDescriptor.js.map +0 -1
- package/src/helpers/PeerID.ts +0 -97
- package/src/helpers/UUID.ts +0 -35
- package/src/helpers/peerIdFromPeerDescriptor.ts +0 -20
- package/test/unit/PeerID.test.ts +0 -22
- package/test/unit/UUID.test.ts +0 -55
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createPeerDescriptor = void 0;
|
|
7
|
+
const utils_1 = require("@streamr/utils");
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const isBrowserEnvironment_1 = require("../helpers/browser/isBrowserEnvironment");
|
|
10
|
+
const createPeerDescriptorSignaturePayload_1 = require("../helpers/createPeerDescriptorSignaturePayload");
|
|
11
|
+
const identifiers_1 = require("../identifiers");
|
|
12
|
+
const DhtRpc_1 = require("../proto/packages/dht/protos/DhtRpc");
|
|
13
|
+
const calculateNodeIdRaw = (ipAddress, privateKey) => {
|
|
14
|
+
// nodeId is calculated as
|
|
15
|
+
// concatenate(
|
|
16
|
+
// get104leastSignificatBits(hash(ipAddress)),
|
|
17
|
+
// get56leastSignificatBits(sign(ipAddress))
|
|
18
|
+
// )
|
|
19
|
+
const ipAsBuffer = Buffer.alloc(4);
|
|
20
|
+
ipAsBuffer.writeUInt32BE(ipAddress);
|
|
21
|
+
const ipHash = (0, utils_1.hash)(ipAsBuffer);
|
|
22
|
+
const signature = (0, utils_1.createSignature)(ipAsBuffer, privateKey);
|
|
23
|
+
const nodeIdRaw = Buffer.concat([
|
|
24
|
+
ipHash.subarray(ipHash.length - 13, ipHash.length),
|
|
25
|
+
signature.subarray(signature.length - 7, signature.length)
|
|
26
|
+
]);
|
|
27
|
+
return nodeIdRaw;
|
|
28
|
+
};
|
|
29
|
+
const createPeerDescriptor = (connectivityResponse, nodeId) => {
|
|
30
|
+
const privateKey = crypto_1.default.randomBytes(32);
|
|
31
|
+
const publicKey = crypto_1.default.randomBytes(20); // TODO calculate publicKey from privateKey
|
|
32
|
+
let nodeIdRaw;
|
|
33
|
+
if (nodeId !== undefined) {
|
|
34
|
+
nodeIdRaw = (0, identifiers_1.getRawFromDhtAddress)(nodeId);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
nodeIdRaw = calculateNodeIdRaw(connectivityResponse.ipAddress, privateKey);
|
|
38
|
+
}
|
|
39
|
+
const ret = {
|
|
40
|
+
nodeId: nodeIdRaw,
|
|
41
|
+
type: (0, isBrowserEnvironment_1.isBrowserEnvironment)() ? DhtRpc_1.NodeType.BROWSER : DhtRpc_1.NodeType.NODEJS,
|
|
42
|
+
ipAddress: connectivityResponse.ipAddress,
|
|
43
|
+
publicKey
|
|
44
|
+
};
|
|
45
|
+
if (connectivityResponse.websocket) {
|
|
46
|
+
ret.websocket = {
|
|
47
|
+
host: connectivityResponse.websocket.host,
|
|
48
|
+
port: connectivityResponse.websocket.port,
|
|
49
|
+
tls: connectivityResponse.websocket.tls
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
ret.signature = (0, utils_1.createSignature)((0, createPeerDescriptorSignaturePayload_1.createPeerDescriptorSignaturePayload)(ret), privateKey);
|
|
53
|
+
return ret;
|
|
54
|
+
};
|
|
55
|
+
exports.createPeerDescriptor = createPeerDescriptor;
|
|
56
|
+
//# sourceMappingURL=createPeerDescriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPeerDescriptor.js","sourceRoot":"","sources":["../../../src/helpers/createPeerDescriptor.ts"],"names":[],"mappings":";;;;;;AAAA,0CAGuB;AACvB,oDAA2B;AAC3B,kFAA8E;AAC9E,0GAAsG;AACtG,gDAAgF;AAChF,gEAI4C;AAE5C,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAE,UAAsB,EAAiB,EAAE;IACpF,2BAA2B;IAC3B,eAAe;IACf,iDAAiD;IACjD,8CAA8C;IAC9C,IAAI;IACJ,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC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,GAAG;YACZ,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,IAAI;YACzC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,IAAI;YACzC,GAAG,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG;SAC1C,CAAA;IACL,CAAC;IACD,GAAG,CAAC,SAAS,GAAG,IAAA,uBAAe,EAAC,IAAA,2EAAoC,EAAC,GAAG,CAAC,EAAE,UAAU,CAAC,CAAA;IACtF,OAAO,GAAG,CAAA;AACd,CAAC,CAAA;AAxBY,QAAA,oBAAoB,wBAwBhC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPeerDescriptorSignaturePayload = void 0;
|
|
4
|
+
const DhtRpc_1 = require("../proto/packages/dht/protos/DhtRpc");
|
|
5
|
+
function convertUnsignedIntegerToBuffer(number) {
|
|
6
|
+
const buffer = Buffer.alloc(4);
|
|
7
|
+
buffer.writeUInt32BE(number);
|
|
8
|
+
return buffer;
|
|
9
|
+
}
|
|
10
|
+
const createPeerDescriptorSignaturePayload = (peerDescriptor) => {
|
|
11
|
+
const separator = Buffer.from(',');
|
|
12
|
+
const buffers = [
|
|
13
|
+
peerDescriptor.type !== undefined ? convertUnsignedIntegerToBuffer(peerDescriptor.type) : new Uint8Array(0),
|
|
14
|
+
separator,
|
|
15
|
+
peerDescriptor.udp !== undefined ? DhtRpc_1.ConnectivityMethod.toBinary(peerDescriptor.udp) : new Uint8Array(0),
|
|
16
|
+
separator,
|
|
17
|
+
peerDescriptor.tcp !== undefined ? DhtRpc_1.ConnectivityMethod.toBinary(peerDescriptor.tcp) : new Uint8Array(0),
|
|
18
|
+
separator,
|
|
19
|
+
peerDescriptor.websocket !== undefined ? DhtRpc_1.ConnectivityMethod.toBinary(peerDescriptor.websocket) : new Uint8Array(0),
|
|
20
|
+
separator,
|
|
21
|
+
peerDescriptor.region !== undefined ? convertUnsignedIntegerToBuffer(peerDescriptor.region) : new Uint8Array(0),
|
|
22
|
+
separator,
|
|
23
|
+
peerDescriptor.ipAddress !== undefined ? convertUnsignedIntegerToBuffer(peerDescriptor.ipAddress) : new Uint8Array(0),
|
|
24
|
+
separator,
|
|
25
|
+
peerDescriptor.publicKey !== undefined ? Buffer.from(peerDescriptor.publicKey) : new Uint8Array(0)
|
|
26
|
+
];
|
|
27
|
+
return Buffer.concat(buffers);
|
|
28
|
+
};
|
|
29
|
+
exports.createPeerDescriptorSignaturePayload = createPeerDescriptorSignaturePayload;
|
|
30
|
+
//# sourceMappingURL=createPeerDescriptorSignaturePayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPeerDescriptorSignaturePayload.js","sourceRoot":"","sources":["../../../src/helpers/createPeerDescriptorSignaturePayload.ts"],"names":[],"mappings":";;;AAAA,gEAAwF;AAExF,SAAS,8BAA8B,CAAC,MAAc;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,OAAO,MAAM,CAAA;AACjB,CAAC;AAEM,MAAM,oCAAoC,GAAG,CAAC,cAA8B,EAAc,EAAE;IAC/F,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAClC,MAAM,OAAO,GAAG;QACZ,cAAc,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QAC3G,SAAS;QACT,cAAc,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,2BAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QACtG,SAAS;QACT,cAAc,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,2BAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QACtG,SAAS;QACT,cAAc,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,2BAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QAClH,SAAS;QACT,cAAc,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QAC/G,SAAS;QACT,cAAc,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;QACrH,SAAS;QACT,cAAc,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC;KACrG,CAAA;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC,CAAA;AAlBY,QAAA,oCAAoC,wCAkBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugHelpers.js","sourceRoot":"","sources":["../../../src/helpers/debugHelpers.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAwB,EAAE,CAAA;AAEhD,SAAgB,SAAS,CAAC,MAAc,EAAE,SAAkB,EAAE,GAAW;IACrE,IAAI,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"debugHelpers.js","sourceRoot":"","sources":["../../../src/helpers/debugHelpers.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAwB,EAAE,CAAA;AAEhD,SAAgB,SAAS,CAAC,MAAc,EAAE,SAAkB,EAAE,GAAW;IACrE,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;AACL,CAAC;AAJD,8BAIC"}
|
|
@@ -22,6 +22,8 @@ var ErrorCode;
|
|
|
22
22
|
ErrorCode["CONNECTION_NOT_OPEN"] = "CONNECTION_NOT_OPEN";
|
|
23
23
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
24
24
|
class Err extends Error {
|
|
25
|
+
code;
|
|
26
|
+
originalError;
|
|
25
27
|
constructor(code, message, originalError) {
|
|
26
28
|
super(message);
|
|
27
29
|
this.code = code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/helpers/errors.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACjB,oDAAuC,CAAA;IACvC,gDAAmC,CAAA;IACnC,kFAAqE,CAAA;IACrE,4FAA+E,CAAA;IAC/E,gDAAmC,CAAA;IACnC,8CAAiC,CAAA;IACjC,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,oFAAuE,CAAA;IACvE,oDAAuC,CAAA;IACvC,oHAAuG,CAAA;IACvG,oDAAuC,CAAA;IACvC,kDAAqC,CAAA;IACrC,wCAA2B,CAAA;IAC3B,wDAA2C,CAAA;IAC3C,wDAA2C,CAAA;AAC/C,CAAC,EAjBW,SAAS,yBAAT,SAAS,QAiBpB;AAED,MAAM,GAAI,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/helpers/errors.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACjB,oDAAuC,CAAA;IACvC,gDAAmC,CAAA;IACnC,kFAAqE,CAAA;IACrE,4FAA+E,CAAA;IA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AQ,GAAG;IAAG,YAAY,OAAgB,EAAE,aAA8B,IAAI,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA,CAAC,CAAC;CAAE;AAA1K,4CAA0K;AAC1K,MAAa,cAAe,SAAQ,GAAG;IAAG,YAAY,OAAgB,EAAE,aAA8B,IAAI,KAAK,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA,CAAC,CAAC;CAAE;AAAvK,wCAAuK;AACvK,MAAa,UAAW,SAAQ,GAAG;IAAG,YAAY,OAAgB,EAAE,aAA8B,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA,CAAC,CAAC;CAAE;AAA9J,gCAA8J;AAC9J,MAAa,iBAAkB,SAAQ,GAAG;IAAG,YAAY,OAAgB,EAAE,aAA8B,IAAI,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA,CAAC,CAAC;CAAE;AAA7K,8CAA6K;AAC7K,MAAa,iBAAkB,SAAQ,GAAG;IAAG,YAAa,OAAgB,EAAE,aAA8B,IAAI,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA,CAAC,CAAC;CAAE;AAA9K,8CAA8K"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getOfferer = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const getOfferer = (localNodeId, remoteNodeId) => {
|
|
9
|
+
return getOfferingHash(localNodeId + ',' + remoteNodeId) < getOfferingHash(remoteNodeId + ',' + localNodeId)
|
|
10
|
+
? 'local'
|
|
11
|
+
: 'remote';
|
|
12
|
+
};
|
|
13
|
+
exports.getOfferer = getOfferer;
|
|
14
|
+
const getOfferingHash = (idPair) => {
|
|
15
|
+
const buffer = crypto_1.default.createHash('md5').update(idPair).digest();
|
|
16
|
+
return buffer.readInt32LE(0);
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=offering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offering.js","sourceRoot":"","sources":["../../../src/helpers/offering.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA2B;AAKpB,MAAM,UAAU,GAAG,CAAC,WAAuB,EAAE,YAAwB,EAAW,EAAE;IACrF,OAAO,eAAe,CAAC,WAAW,GAAG,GAAG,GAAG,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,GAAG,GAAG,GAAG,WAAW,CAAC;QACxG,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,QAAQ,CAAA;AAClB,CAAC,CAAA;AAJY,QAAA,UAAU,cAItB;AAED,MAAM,eAAe,GAAG,CAAC,MAAc,EAAU,EAAE;IAC/C,MAAM,MAAM,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAA;IAC/D,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protoToString.js","sourceRoot":"","sources":["../../../src/helpers/protoToString.ts"],"names":[],"mappings":";;;AAEA,iDAA6C;AAC7C,kDAAoE;AAEpE,MAAM,YAAY,GAAG,2BAAY,CAAC,MAAM,CAAC,wBAAe,CAAC,CAAA;AAEzD,SAAgB,aAAa,CAAsD,QAAW,EAC1F,UAAqB;IAErB,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,IAAI;
|
|
1
|
+
{"version":3,"file":"protoToString.js","sourceRoot":"","sources":["../../../src/helpers/protoToString.ts"],"names":[],"mappings":";;;AAEA,iDAA6C;AAC7C,kDAAoE;AAEpE,MAAM,YAAY,GAAG,2BAAY,CAAC,MAAM,CAAC,wBAAe,CAAC,CAAA;AAEzD,SAAgB,aAAa,CAAsD,QAAW,EAC1F,UAAqB;IAErB,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,IAAI,CAAC;QACD,GAAG,GAAG,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE;YACpC,YAAY;SACf,CAAC,CAAA;IACN,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACV,GAAG,GAAG,6BAA6B,CAAA;IACvC,CAAC;IAED,OAAO,GAAG,CAAA;AACd,CAAC;AAbD,sCAaC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BrandedString } from '@streamr/utils';
|
|
2
|
+
import { PeerDescriptor } from './proto/packages/dht/protos/DhtRpc';
|
|
2
3
|
export type DhtAddress = BrandedString<'DhtAddress'>;
|
|
3
4
|
export type DhtAddressRaw = Uint8Array;
|
|
4
5
|
export declare const getDhtAddressFromRaw: (raw: DhtAddressRaw) => DhtAddress;
|
|
5
6
|
export declare const getRawFromDhtAddress: (address: DhtAddress) => DhtAddressRaw;
|
|
7
|
+
export declare const getNodeIdFromPeerDescriptor: (peerDescriptor: PeerDescriptor) => DhtAddress;
|
|
8
|
+
export declare const areEqualPeerDescriptors: (peerDescriptor1: PeerDescriptor, peerDescriptor2: PeerDescriptor) => boolean;
|
|
6
9
|
export declare const createRandomDhtAddress: () => DhtAddress;
|
package/dist/src/identifiers.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createRandomDhtAddress = exports.getRawFromDhtAddress = exports.getDhtAddressFromRaw = void 0;
|
|
6
|
+
exports.createRandomDhtAddress = exports.areEqualPeerDescriptors = exports.getNodeIdFromPeerDescriptor = exports.getRawFromDhtAddress = exports.getDhtAddressFromRaw = void 0;
|
|
7
7
|
const utils_1 = require("@streamr/utils");
|
|
8
8
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
9
|
// https://www.scs.stanford.edu/~dm/home/papers/kpos.pdf
|
|
@@ -16,6 +16,14 @@ const getRawFromDhtAddress = (address) => {
|
|
|
16
16
|
return (0, utils_1.hexToBinary)(address);
|
|
17
17
|
};
|
|
18
18
|
exports.getRawFromDhtAddress = getRawFromDhtAddress;
|
|
19
|
+
const getNodeIdFromPeerDescriptor = (peerDescriptor) => {
|
|
20
|
+
return (0, exports.getDhtAddressFromRaw)(peerDescriptor.nodeId);
|
|
21
|
+
};
|
|
22
|
+
exports.getNodeIdFromPeerDescriptor = getNodeIdFromPeerDescriptor;
|
|
23
|
+
const areEqualPeerDescriptors = (peerDescriptor1, peerDescriptor2) => {
|
|
24
|
+
return (0, utils_1.areEqualBinaries)(peerDescriptor1.nodeId, peerDescriptor2.nodeId);
|
|
25
|
+
};
|
|
26
|
+
exports.areEqualPeerDescriptors = areEqualPeerDescriptors;
|
|
19
27
|
const createRandomDhtAddress = () => {
|
|
20
28
|
return (0, exports.getDhtAddressFromRaw)(crypto_1.default.randomBytes(KADEMLIA_ID_LENGTH_IN_BYTES));
|
|
21
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../../src/identifiers.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../../src/identifiers.ts"],"names":[],"mappings":";;;;;;AAAA,0CAA0F;AAC1F,oDAA2B;AAG3B,wDAAwD;AACxD,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAK/B,MAAM,oBAAoB,GAAG,CAAC,GAAkB,EAAc,EAAE;IACnE,OAAO,IAAA,mBAAW,EAAC,GAAG,CAA0B,CAAA;AACpD,CAAC,CAAA;AAFY,QAAA,oBAAoB,wBAEhC;AAEM,MAAM,oBAAoB,GAAG,CAAC,OAAmB,EAAiB,EAAE;IACvE,OAAO,IAAA,mBAAW,EAAC,OAAO,CAA6B,CAAA;AAC3D,CAAC,CAAA;AAFY,QAAA,oBAAoB,wBAEhC;AAEM,MAAM,2BAA2B,GAAG,CAAC,cAA8B,EAAc,EAAE;IACtF,OAAO,IAAA,4BAAoB,EAAC,cAAc,CAAC,MAAM,CAAC,CAAA;AACtD,CAAC,CAAA;AAFY,QAAA,2BAA2B,+BAEvC;AAEM,MAAM,uBAAuB,GAAG,CAAC,eAA+B,EAAE,eAA+B,EAAW,EAAE;IACjH,OAAO,IAAA,wBAAgB,EAAC,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;AAC3E,CAAC,CAAA;AAFY,QAAA,uBAAuB,2BAEnC;AAEM,MAAM,sBAAsB,GAAG,GAAe,EAAE;IACnD,OAAO,IAAA,4BAAoB,EAAC,gBAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAA;AAChF,CAAC,CAAA;AAFY,QAAA,sBAAsB,0BAElC"}
|
|
@@ -8,9 +8,8 @@ const runtime_4 = require("@protobuf-ts/runtime");
|
|
|
8
8
|
const runtime_5 = require("@protobuf-ts/runtime");
|
|
9
9
|
const runtime_6 = require("@protobuf-ts/runtime");
|
|
10
10
|
const runtime_7 = require("@protobuf-ts/runtime");
|
|
11
|
-
const runtime_8 = require("@protobuf-ts/runtime");
|
|
12
11
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
13
|
-
class Any$Type extends
|
|
12
|
+
class Any$Type extends runtime_7.MessageType {
|
|
14
13
|
constructor() {
|
|
15
14
|
super("google.protobuf.Any", [
|
|
16
15
|
{ no: 1, name: "type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
@@ -58,20 +57,20 @@ class Any$Type extends runtime_8.MessageType {
|
|
|
58
57
|
if (any.typeUrl === "")
|
|
59
58
|
return {};
|
|
60
59
|
let typeName = this.typeUrlToName(any.typeUrl);
|
|
61
|
-
let opt = (0,
|
|
60
|
+
let opt = (0, runtime_6.jsonWriteOptions)(options);
|
|
62
61
|
let type = opt.typeRegistry?.find(t => t.typeName === typeName);
|
|
63
62
|
if (!type)
|
|
64
63
|
throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '" + any.typeUrl + "' to JSON. The specified type " + typeName + " is not available in the type registry.");
|
|
65
64
|
let value = type.fromBinary(any.value, { readUnknownField: false });
|
|
66
65
|
let json = type.internalJsonWrite(value, opt);
|
|
67
|
-
if (typeName.startsWith("google.protobuf.") || !(0,
|
|
66
|
+
if (typeName.startsWith("google.protobuf.") || !(0, runtime_4.isJsonObject)(json))
|
|
68
67
|
json = { value: json };
|
|
69
68
|
json["@type"] = any.typeUrl;
|
|
70
69
|
return json;
|
|
71
70
|
}
|
|
72
71
|
internalJsonRead(json, options, target) {
|
|
73
|
-
if (!(0,
|
|
74
|
-
throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON " + (0,
|
|
72
|
+
if (!(0, runtime_4.isJsonObject)(json))
|
|
73
|
+
throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON " + (0, runtime_5.typeofJsonValue)(json) + ".");
|
|
75
74
|
if (typeof json["@type"] != "string" || json["@type"] == "")
|
|
76
75
|
return this.create();
|
|
77
76
|
let typeName = this.typeUrlToName(json["@type"]);
|
|
@@ -107,8 +106,9 @@ class Any$Type extends runtime_8.MessageType {
|
|
|
107
106
|
return name;
|
|
108
107
|
}
|
|
109
108
|
create(value) {
|
|
110
|
-
const message =
|
|
111
|
-
|
|
109
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
110
|
+
message.typeUrl = "";
|
|
111
|
+
message.value = new Uint8Array(0);
|
|
112
112
|
if (value !== undefined)
|
|
113
113
|
(0, runtime_3.reflectionMergePartial)(this, message, value);
|
|
114
114
|
return message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/any.ts"],"names":[],"mappings":";;;AAoCA,kDAAgD;AAEhD,kDAA2D;AAE3D,kDAA8D;AAC9D,kDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"any.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/any.ts"],"names":[],"mappings":";;;AAoCA,kDAAgD;AAEhD,kDAA2D;AAE3D,kDAA8D;AAC9D,kDAAoD;AACpD,kDAAuD;AAEvD,kDAAwD;AAKxD,kDAAmD;AA8HnD,2FAA2F;AAC3F,MAAM,QAAS,SAAQ,qBAAgB;IACnC;QACI,KAAK,CAAC,qBAAqB,EAAE;YACzB,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,qBAAqB,EAAE;YACvE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,oBAAoB,EAAE;SACvE,CAAC,CAAC;IACP,CAAC;IACD;;;;OAIG;IACH,IAAI,CAAmB,OAAU,EAAE,IAAqB;QACpD,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;SAC5E,CAAC;IACN,CAAC;IACD;;OAEG;IACH,MAAM,CAAmB,GAAQ,EAAE,IAAqB,EAAE,OAAoC;QAC1F,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kDAAkD,GAAG,GAAG,CAAC,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;QACtH,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KA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,0BAA0B;QAC1B,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpE,sBAAsB;QACtB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM;YACpB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACU,QAAA,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -4,15 +4,13 @@ exports.Empty = void 0;
|
|
|
4
4
|
const runtime_1 = require("@protobuf-ts/runtime");
|
|
5
5
|
const runtime_2 = require("@protobuf-ts/runtime");
|
|
6
6
|
const runtime_3 = require("@protobuf-ts/runtime");
|
|
7
|
-
const runtime_4 = require("@protobuf-ts/runtime");
|
|
8
7
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
9
|
-
class Empty$Type extends
|
|
8
|
+
class Empty$Type extends runtime_3.MessageType {
|
|
10
9
|
constructor() {
|
|
11
10
|
super("google.protobuf.Empty", []);
|
|
12
11
|
}
|
|
13
12
|
create(value) {
|
|
14
|
-
const message =
|
|
15
|
-
globalThis.Object.defineProperty(message, runtime_3.MESSAGE_TYPE, { enumerable: false, value: this });
|
|
13
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
16
14
|
if (value !== undefined)
|
|
17
15
|
(0, runtime_2.reflectionMergePartial)(this, message, value);
|
|
18
16
|
return message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/empty.ts"],"names":[],"mappings":";;;AAoCA,kDAA2D;AAI3D,kDAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/empty.ts"],"names":[],"mappings":";;;AAoCA,kDAA2D;AAI3D,kDAA8D;AAC9D,kDAAmD;AAgBnD,2FAA2F;AAC3F,MAAM,UAAW,SAAQ,qBAAkB;IACvC;QACI,KAAK,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,MAAM,CAAC,KAA6B;QAChC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAiB,CAAC,CAAC,CAAC;QACnE,IAAI,KAAK,KAAK,SAAS;YACnB,IAAA,gCAAsB,EAAQ,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,kBAAkB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAA0B,EAAE,MAAc;QAChG,OAAO,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;IACnC,CAAC;IACD,mBAAmB,CAAC,OAAc,EAAE,MAAqB,EAAE,OAA2B;QAClF,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACU,QAAA,KAAK,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -7,9 +7,8 @@ const runtime_3 = require("@protobuf-ts/runtime");
|
|
|
7
7
|
const runtime_4 = require("@protobuf-ts/runtime");
|
|
8
8
|
const runtime_5 = require("@protobuf-ts/runtime");
|
|
9
9
|
const runtime_6 = require("@protobuf-ts/runtime");
|
|
10
|
-
const runtime_7 = require("@protobuf-ts/runtime");
|
|
11
10
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
12
|
-
class Timestamp$Type extends
|
|
11
|
+
class Timestamp$Type extends runtime_6.MessageType {
|
|
13
12
|
constructor() {
|
|
14
13
|
super("google.protobuf.Timestamp", [
|
|
15
14
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
|
|
@@ -22,7 +21,7 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
22
21
|
now() {
|
|
23
22
|
const msg = this.create();
|
|
24
23
|
const ms = Date.now();
|
|
25
|
-
msg.seconds =
|
|
24
|
+
msg.seconds = runtime_5.PbLong.from(Math.floor(ms / 1000)).toNumber();
|
|
26
25
|
msg.nanos = (ms % 1000) * 1000000;
|
|
27
26
|
return msg;
|
|
28
27
|
}
|
|
@@ -30,7 +29,7 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
30
29
|
* Converts a `Timestamp` to a JavaScript Date.
|
|
31
30
|
*/
|
|
32
31
|
toDate(message) {
|
|
33
|
-
return new Date(
|
|
32
|
+
return new Date(runtime_5.PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
35
|
* Converts a JavaScript Date to a `Timestamp`.
|
|
@@ -38,7 +37,7 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
38
37
|
fromDate(date) {
|
|
39
38
|
const msg = this.create();
|
|
40
39
|
const ms = date.getTime();
|
|
41
|
-
msg.seconds =
|
|
40
|
+
msg.seconds = runtime_5.PbLong.from(Math.floor(ms / 1000)).toNumber();
|
|
42
41
|
msg.nanos = (ms % 1000) * 1000000;
|
|
43
42
|
return msg;
|
|
44
43
|
}
|
|
@@ -47,7 +46,7 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
47
46
|
* in the RFC 3339 format.
|
|
48
47
|
*/
|
|
49
48
|
internalJsonWrite(message, options) {
|
|
50
|
-
let ms =
|
|
49
|
+
let ms = runtime_5.PbLong.from(message.seconds).toNumber() * 1000;
|
|
51
50
|
if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
|
|
52
51
|
throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
|
|
53
52
|
if (message.nanos < 0)
|
|
@@ -70,7 +69,7 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
70
69
|
*/
|
|
71
70
|
internalJsonRead(json, options, target) {
|
|
72
71
|
if (typeof json !== "string")
|
|
73
|
-
throw new Error("Unable to parse Timestamp from JSON " + (0,
|
|
72
|
+
throw new Error("Unable to parse Timestamp from JSON " + (0, runtime_4.typeofJsonValue)(json) + ".");
|
|
74
73
|
let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
|
|
75
74
|
if (!matches)
|
|
76
75
|
throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
|
|
@@ -81,15 +80,16 @@ class Timestamp$Type extends runtime_7.MessageType {
|
|
|
81
80
|
throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
|
|
82
81
|
if (!target)
|
|
83
82
|
target = this.create();
|
|
84
|
-
target.seconds =
|
|
83
|
+
target.seconds = runtime_5.PbLong.from(ms / 1000).toNumber();
|
|
85
84
|
target.nanos = 0;
|
|
86
85
|
if (matches[7])
|
|
87
86
|
target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
|
|
88
87
|
return target;
|
|
89
88
|
}
|
|
90
89
|
create(value) {
|
|
91
|
-
const message =
|
|
92
|
-
|
|
90
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
91
|
+
message.seconds = 0;
|
|
92
|
+
message.nanos = 0;
|
|
93
93
|
if (value !== undefined)
|
|
94
94
|
(0, runtime_3.reflectionMergePartial)(this, message, value);
|
|
95
95
|
return message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/timestamp.ts"],"names":[],"mappings":";;;AAoCA,kDAAgD;AAGhD,kDAA2D;AAE3D,kDAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/timestamp.ts"],"names":[],"mappings":";;;AAoCA,kDAAgD;AAGhD,kDAA2D;AAE3D,kDAA8D;AAC9D,kDAAuD;AAIvD,kDAA8C;AAC9C,kDAAmD;AA4GnD,2FAA2F;AAC3F,MAAM,cAAe,SAAQ,qBAAsB;IAC/C;QACI,KAAK,CAAC,2BAA2B,EAAE;YAC/B,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,oBAAoB,EAAE,CAAC,EAAE,CAAC,CAAC,mBAAmB,EAAE;YAC/F,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,oBAAoB,EAAE;SACtE,CAAC,CAAC;IACP,CAAC;IACD;;OAEG;IACH,GAAG;QACC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE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OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YACxG,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,mBAAmB,CAAC,OAAkB,EAAE,MAAqB,EAAE,OAA2B;QACtF,wBAAwB;QACxB,IAAI,OAAO,CAAC,OAAO,KAAK,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,sBAAsB;QACtB,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -2,7 +2,6 @@ import type { ExternalStoreDataResponse } from "./DhtRpc";
|
|
|
2
2
|
import type { ExternalStoreDataRequest } from "./DhtRpc";
|
|
3
3
|
import type { ExternalFindDataResponse } from "./DhtRpc";
|
|
4
4
|
import type { ExternalFindDataRequest } from "./DhtRpc";
|
|
5
|
-
import type { DisconnectNoticeResponse } from "./DhtRpc";
|
|
6
5
|
import type { DisconnectNotice } from "./DhtRpc";
|
|
7
6
|
import type { UnlockRequest } from "./DhtRpc";
|
|
8
7
|
import type { LockResponse } from "./DhtRpc";
|
|
@@ -272,9 +271,9 @@ export interface IConnectionLockRpcClient {
|
|
|
272
271
|
*/
|
|
273
272
|
unlockRequest(input: UnlockRequest, options?: RpcOptions): UnaryCall<UnlockRequest, Empty>;
|
|
274
273
|
/**
|
|
275
|
-
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (
|
|
274
|
+
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
|
|
276
275
|
*/
|
|
277
|
-
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice,
|
|
276
|
+
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, Empty>;
|
|
278
277
|
}
|
|
279
278
|
/**
|
|
280
279
|
* @generated from protobuf service dht.ConnectionLockRpc
|
|
@@ -296,9 +295,9 @@ export declare class ConnectionLockRpcClient implements IConnectionLockRpcClient
|
|
|
296
295
|
*/
|
|
297
296
|
unlockRequest(input: UnlockRequest, options?: RpcOptions): UnaryCall<UnlockRequest, Empty>;
|
|
298
297
|
/**
|
|
299
|
-
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (
|
|
298
|
+
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
|
|
300
299
|
*/
|
|
301
|
-
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice,
|
|
300
|
+
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, Empty>;
|
|
302
301
|
}
|
|
303
302
|
/**
|
|
304
303
|
* @generated from protobuf service dht.ExternalApiRpc
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExternalApiRpcClient = exports.ConnectionLockRpcClient = exports.WebrtcConnectorRpcClient = exports.WebsocketConnectorRpcClient = exports.RecursiveOperationSessionRpcClient = exports.StoreRpcClient = exports.RecursiveOperationRpcClient = exports.RouterRpcClient = exports.DhtNodeRpcClient = void 0;
|
|
4
|
-
// @generated by protobuf-ts 2.9.
|
|
4
|
+
// @generated by protobuf-ts 2.9.3 with parameter server_generic,generate_dependencies,long_type_number
|
|
5
5
|
// @generated from protobuf file "packages/dht/protos/DhtRpc.proto" (package "dht", syntax proto3)
|
|
6
6
|
// tslint:disable
|
|
7
7
|
const DhtRpc_1 = require("./DhtRpc");
|
|
@@ -18,11 +18,12 @@ const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc");
|
|
|
18
18
|
* @generated from protobuf service dht.DhtNodeRpc
|
|
19
19
|
*/
|
|
20
20
|
class DhtNodeRpcClient {
|
|
21
|
+
_transport;
|
|
22
|
+
typeName = DhtRpc_9.DhtNodeRpc.typeName;
|
|
23
|
+
methods = DhtRpc_9.DhtNodeRpc.methods;
|
|
24
|
+
options = DhtRpc_9.DhtNodeRpc.options;
|
|
21
25
|
constructor(_transport) {
|
|
22
26
|
this._transport = _transport;
|
|
23
|
-
this.typeName = DhtRpc_9.DhtNodeRpc.typeName;
|
|
24
|
-
this.methods = DhtRpc_9.DhtNodeRpc.methods;
|
|
25
|
-
this.options = DhtRpc_9.DhtNodeRpc.options;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* @generated from protobuf rpc: getClosestPeers(dht.ClosestPeersRequest) returns (dht.ClosestPeersResponse);
|
|
@@ -51,11 +52,12 @@ exports.DhtNodeRpcClient = DhtNodeRpcClient;
|
|
|
51
52
|
* @generated from protobuf service dht.RouterRpc
|
|
52
53
|
*/
|
|
53
54
|
class RouterRpcClient {
|
|
55
|
+
_transport;
|
|
56
|
+
typeName = DhtRpc_8.RouterRpc.typeName;
|
|
57
|
+
methods = DhtRpc_8.RouterRpc.methods;
|
|
58
|
+
options = DhtRpc_8.RouterRpc.options;
|
|
54
59
|
constructor(_transport) {
|
|
55
60
|
this._transport = _transport;
|
|
56
|
-
this.typeName = DhtRpc_8.RouterRpc.typeName;
|
|
57
|
-
this.methods = DhtRpc_8.RouterRpc.methods;
|
|
58
|
-
this.options = DhtRpc_8.RouterRpc.options;
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
63
|
* @generated from protobuf rpc: routeMessage(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
|
|
@@ -77,11 +79,12 @@ exports.RouterRpcClient = RouterRpcClient;
|
|
|
77
79
|
* @generated from protobuf service dht.RecursiveOperationRpc
|
|
78
80
|
*/
|
|
79
81
|
class RecursiveOperationRpcClient {
|
|
82
|
+
_transport;
|
|
83
|
+
typeName = DhtRpc_7.RecursiveOperationRpc.typeName;
|
|
84
|
+
methods = DhtRpc_7.RecursiveOperationRpc.methods;
|
|
85
|
+
options = DhtRpc_7.RecursiveOperationRpc.options;
|
|
80
86
|
constructor(_transport) {
|
|
81
87
|
this._transport = _transport;
|
|
82
|
-
this.typeName = DhtRpc_7.RecursiveOperationRpc.typeName;
|
|
83
|
-
this.methods = DhtRpc_7.RecursiveOperationRpc.methods;
|
|
84
|
-
this.options = DhtRpc_7.RecursiveOperationRpc.options;
|
|
85
88
|
}
|
|
86
89
|
/**
|
|
87
90
|
* @generated from protobuf rpc: routeRequest(dht.RouteMessageWrapper) returns (dht.RouteMessageAck);
|
|
@@ -96,11 +99,12 @@ exports.RecursiveOperationRpcClient = RecursiveOperationRpcClient;
|
|
|
96
99
|
* @generated from protobuf service dht.StoreRpc
|
|
97
100
|
*/
|
|
98
101
|
class StoreRpcClient {
|
|
102
|
+
_transport;
|
|
103
|
+
typeName = DhtRpc_6.StoreRpc.typeName;
|
|
104
|
+
methods = DhtRpc_6.StoreRpc.methods;
|
|
105
|
+
options = DhtRpc_6.StoreRpc.options;
|
|
99
106
|
constructor(_transport) {
|
|
100
107
|
this._transport = _transport;
|
|
101
|
-
this.typeName = DhtRpc_6.StoreRpc.typeName;
|
|
102
|
-
this.methods = DhtRpc_6.StoreRpc.methods;
|
|
103
|
-
this.options = DhtRpc_6.StoreRpc.options;
|
|
104
108
|
}
|
|
105
109
|
/**
|
|
106
110
|
* @generated from protobuf rpc: storeData(dht.StoreDataRequest) returns (dht.StoreDataResponse);
|
|
@@ -122,11 +126,12 @@ exports.StoreRpcClient = StoreRpcClient;
|
|
|
122
126
|
* @generated from protobuf service dht.RecursiveOperationSessionRpc
|
|
123
127
|
*/
|
|
124
128
|
class RecursiveOperationSessionRpcClient {
|
|
129
|
+
_transport;
|
|
130
|
+
typeName = DhtRpc_5.RecursiveOperationSessionRpc.typeName;
|
|
131
|
+
methods = DhtRpc_5.RecursiveOperationSessionRpc.methods;
|
|
132
|
+
options = DhtRpc_5.RecursiveOperationSessionRpc.options;
|
|
125
133
|
constructor(_transport) {
|
|
126
134
|
this._transport = _transport;
|
|
127
|
-
this.typeName = DhtRpc_5.RecursiveOperationSessionRpc.typeName;
|
|
128
|
-
this.methods = DhtRpc_5.RecursiveOperationSessionRpc.methods;
|
|
129
|
-
this.options = DhtRpc_5.RecursiveOperationSessionRpc.options;
|
|
130
135
|
}
|
|
131
136
|
/**
|
|
132
137
|
* @generated from protobuf rpc: sendResponse(dht.RecursiveOperationResponse) returns (google.protobuf.Empty);
|
|
@@ -141,11 +146,12 @@ exports.RecursiveOperationSessionRpcClient = RecursiveOperationSessionRpcClient;
|
|
|
141
146
|
* @generated from protobuf service dht.WebsocketConnectorRpc
|
|
142
147
|
*/
|
|
143
148
|
class WebsocketConnectorRpcClient {
|
|
149
|
+
_transport;
|
|
150
|
+
typeName = DhtRpc_4.WebsocketConnectorRpc.typeName;
|
|
151
|
+
methods = DhtRpc_4.WebsocketConnectorRpc.methods;
|
|
152
|
+
options = DhtRpc_4.WebsocketConnectorRpc.options;
|
|
144
153
|
constructor(_transport) {
|
|
145
154
|
this._transport = _transport;
|
|
146
|
-
this.typeName = DhtRpc_4.WebsocketConnectorRpc.typeName;
|
|
147
|
-
this.methods = DhtRpc_4.WebsocketConnectorRpc.methods;
|
|
148
|
-
this.options = DhtRpc_4.WebsocketConnectorRpc.options;
|
|
149
155
|
}
|
|
150
156
|
/**
|
|
151
157
|
* @generated from protobuf rpc: requestConnection(dht.WebsocketConnectionRequest) returns (google.protobuf.Empty);
|
|
@@ -160,11 +166,12 @@ exports.WebsocketConnectorRpcClient = WebsocketConnectorRpcClient;
|
|
|
160
166
|
* @generated from protobuf service dht.WebrtcConnectorRpc
|
|
161
167
|
*/
|
|
162
168
|
class WebrtcConnectorRpcClient {
|
|
169
|
+
_transport;
|
|
170
|
+
typeName = DhtRpc_3.WebrtcConnectorRpc.typeName;
|
|
171
|
+
methods = DhtRpc_3.WebrtcConnectorRpc.methods;
|
|
172
|
+
options = DhtRpc_3.WebrtcConnectorRpc.options;
|
|
163
173
|
constructor(_transport) {
|
|
164
174
|
this._transport = _transport;
|
|
165
|
-
this.typeName = DhtRpc_3.WebrtcConnectorRpc.typeName;
|
|
166
|
-
this.methods = DhtRpc_3.WebrtcConnectorRpc.methods;
|
|
167
|
-
this.options = DhtRpc_3.WebrtcConnectorRpc.options;
|
|
168
175
|
}
|
|
169
176
|
/**
|
|
170
177
|
* @generated from protobuf rpc: requestConnection(dht.WebrtcConnectionRequest) returns (google.protobuf.Empty);
|
|
@@ -200,11 +207,12 @@ exports.WebrtcConnectorRpcClient = WebrtcConnectorRpcClient;
|
|
|
200
207
|
* @generated from protobuf service dht.ConnectionLockRpc
|
|
201
208
|
*/
|
|
202
209
|
class ConnectionLockRpcClient {
|
|
210
|
+
_transport;
|
|
211
|
+
typeName = DhtRpc_2.ConnectionLockRpc.typeName;
|
|
212
|
+
methods = DhtRpc_2.ConnectionLockRpc.methods;
|
|
213
|
+
options = DhtRpc_2.ConnectionLockRpc.options;
|
|
203
214
|
constructor(_transport) {
|
|
204
215
|
this._transport = _transport;
|
|
205
|
-
this.typeName = DhtRpc_2.ConnectionLockRpc.typeName;
|
|
206
|
-
this.methods = DhtRpc_2.ConnectionLockRpc.methods;
|
|
207
|
-
this.options = DhtRpc_2.ConnectionLockRpc.options;
|
|
208
216
|
}
|
|
209
217
|
/**
|
|
210
218
|
* @generated from protobuf rpc: lockRequest(dht.LockRequest) returns (dht.LockResponse);
|
|
@@ -221,7 +229,7 @@ class ConnectionLockRpcClient {
|
|
|
221
229
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
222
230
|
}
|
|
223
231
|
/**
|
|
224
|
-
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (
|
|
232
|
+
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
|
|
225
233
|
*/
|
|
226
234
|
gracefulDisconnect(input, options) {
|
|
227
235
|
const method = this.methods[2], opt = this._transport.mergeOptions(options);
|
|
@@ -233,11 +241,12 @@ exports.ConnectionLockRpcClient = ConnectionLockRpcClient;
|
|
|
233
241
|
* @generated from protobuf service dht.ExternalApiRpc
|
|
234
242
|
*/
|
|
235
243
|
class ExternalApiRpcClient {
|
|
244
|
+
_transport;
|
|
245
|
+
typeName = DhtRpc_1.ExternalApiRpc.typeName;
|
|
246
|
+
methods = DhtRpc_1.ExternalApiRpc.methods;
|
|
247
|
+
options = DhtRpc_1.ExternalApiRpc.options;
|
|
236
248
|
constructor(_transport) {
|
|
237
249
|
this._transport = _transport;
|
|
238
|
-
this.typeName = DhtRpc_1.ExternalApiRpc.typeName;
|
|
239
|
-
this.methods = DhtRpc_1.ExternalApiRpc.methods;
|
|
240
|
-
this.options = DhtRpc_1.ExternalApiRpc.options;
|
|
241
250
|
}
|
|
242
251
|
/**
|
|
243
252
|
* @generated from protobuf rpc: externalFindData(dht.ExternalFindDataRequest) returns (dht.ExternalFindDataResponse);
|