@streamr/dht 101.1.2 → 102.0.0-beta.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 +17 -18
- package/dist/src/connection/Connection.d.ts +1 -1
- package/dist/src/connection/ConnectionLockRpcLocal.d.ts +5 -3
- package/dist/src/connection/ConnectionLockRpcLocal.js +9 -3
- package/dist/src/connection/ConnectionLockRpcLocal.js.map +1 -1
- package/dist/src/connection/ConnectionLockRpcRemote.d.ts +3 -2
- package/dist/src/connection/ConnectionLockRpcRemote.js +14 -3
- package/dist/src/connection/ConnectionLockRpcRemote.js.map +1 -1
- package/dist/src/connection/ConnectionLockStates.d.ts +5 -0
- package/dist/src/connection/ConnectionLockStates.js +14 -0
- package/dist/src/connection/ConnectionLockStates.js.map +1 -1
- package/dist/src/connection/ConnectionManager.d.ts +8 -1
- package/dist/src/connection/ConnectionManager.js +96 -32
- package/dist/src/connection/ConnectionManager.js.map +1 -1
- package/dist/src/connection/ConnectionsView.d.ts +1 -1
- package/dist/src/connection/ConnectorFacade.d.ts +1 -1
- package/dist/src/connection/Handshaker.d.ts +2 -2
- package/dist/src/connection/Handshaker.js +11 -7
- package/dist/src/connection/Handshaker.js.map +1 -1
- package/dist/src/connection/ManagedConnection.d.ts +7 -1
- package/dist/src/connection/ManagedConnection.js +41 -8
- package/dist/src/connection/ManagedConnection.js.map +1 -1
- package/dist/src/connection/PendingConnection.d.ts +1 -1
- package/dist/src/connection/connectivityChecker.d.ts +1 -1
- package/dist/src/connection/connectivityChecker.js +22 -11
- package/dist/src/connection/connectivityChecker.js.map +1 -1
- package/dist/src/connection/connectivityRequestHandler.js +4 -4
- package/dist/src/connection/connectivityRequestHandler.js.map +1 -1
- package/dist/src/connection/simulator/Simulator.d.ts +1 -1
- package/dist/src/connection/simulator/Simulator.js +5 -4
- package/dist/src/connection/simulator/Simulator.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnection.d.ts +1 -1
- package/dist/src/connection/simulator/SimulatorConnection.js +9 -9
- package/dist/src/connection/simulator/SimulatorConnection.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorConnector.d.ts +1 -1
- package/dist/src/connection/simulator/SimulatorConnector.js +4 -4
- package/dist/src/connection/simulator/SimulatorConnector.js.map +1 -1
- package/dist/src/connection/simulator/SimulatorTransport.d.ts +1 -1
- package/dist/src/connection/simulator/SimulatorTransport.js +2 -1
- package/dist/src/connection/simulator/SimulatorTransport.js.map +1 -1
- package/dist/src/connection/simulator/pings.d.ts +1 -1
- package/dist/src/connection/simulator/pings.js +3 -3
- package/dist/src/connection/simulator/pings.js.map +1 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.d.ts +2 -1
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js +13 -8
- package/dist/src/connection/webrtc/NodeWebrtcConnection.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnector.d.ts +2 -1
- package/dist/src/connection/webrtc/WebrtcConnector.js +28 -17
- package/dist/src/connection/webrtc/WebrtcConnector.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.d.ts +3 -3
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js +4 -4
- package/dist/src/connection/webrtc/WebrtcConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/webrtc/WebrtcConnectorRpcRemote.d.ts +1 -1
- package/dist/src/connection/webrtc/iceServerAsString.js +1 -2
- package/dist/src/connection/webrtc/iceServerAsString.js.map +1 -1
- package/dist/src/connection/websocket/AbstractWebsocketClientConnection.d.ts +0 -1
- package/dist/src/connection/websocket/WebsocketClientConnector.d.ts +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnector.js +3 -3
- package/dist/src/connection/websocket/WebsocketClientConnector.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcLocal.d.ts +3 -4
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcLocal.js +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcLocal.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcRemote.d.ts +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcRemote.js +1 -1
- package/dist/src/connection/websocket/WebsocketClientConnectorRpcRemote.js.map +1 -1
- package/dist/src/connection/websocket/WebsocketServerConnection.d.ts +0 -1
- package/dist/src/connection/websocket/WebsocketServerConnector.d.ts +1 -1
- package/dist/src/connection/websocket/WebsocketServerConnector.js +34 -24
- package/dist/src/connection/websocket/WebsocketServerConnector.js.map +1 -1
- package/dist/src/dht/DhtNode.d.ts +5 -2
- package/dist/src/dht/DhtNode.js +20 -8
- package/dist/src/dht/DhtNode.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcLocal.d.ts +4 -4
- package/dist/src/dht/DhtNodeRpcLocal.js +3 -3
- package/dist/src/dht/DhtNodeRpcLocal.js.map +1 -1
- package/dist/src/dht/DhtNodeRpcRemote.d.ts +2 -2
- package/dist/src/dht/DhtNodeRpcRemote.js +3 -3
- package/dist/src/dht/DhtNodeRpcRemote.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcLocal.d.ts +3 -3
- package/dist/src/dht/ExternalApiRpcLocal.js +3 -3
- package/dist/src/dht/ExternalApiRpcLocal.js.map +1 -1
- package/dist/src/dht/ExternalApiRpcRemote.d.ts +3 -3
- package/dist/src/dht/ExternalApiRpcRemote.js +2 -2
- package/dist/src/dht/ExternalApiRpcRemote.js.map +1 -1
- package/dist/src/dht/PeerManager.d.ts +3 -2
- package/dist/src/dht/PeerManager.js +12 -11
- package/dist/src/dht/PeerManager.js.map +1 -1
- package/dist/src/dht/contact/Contact.d.ts +1 -1
- package/dist/src/dht/contact/Contact.js +1 -1
- package/dist/src/dht/contact/Contact.js.map +1 -1
- package/dist/src/dht/contact/RingContactList.d.ts +1 -1
- package/dist/src/dht/contact/RingContactList.js +1 -1
- package/dist/src/dht/contact/RingContactList.js.map +1 -1
- package/dist/src/dht/contact/RpcRemote.d.ts +1 -1
- package/dist/src/dht/contact/SortedContactList.js +2 -2
- package/dist/src/dht/contact/SortedContactList.js.map +1 -1
- package/dist/src/dht/contact/ringIdentifiers.d.ts +1 -1
- package/dist/src/dht/discovery/DiscoverySession.d.ts +1 -2
- package/dist/src/dht/discovery/DiscoverySession.js +3 -3
- package/dist/src/dht/discovery/DiscoverySession.js.map +1 -1
- package/dist/src/dht/discovery/PeerDiscovery.d.ts +1 -2
- package/dist/src/dht/discovery/PeerDiscovery.js +7 -7
- package/dist/src/dht/discovery/PeerDiscovery.js.map +1 -1
- package/dist/src/dht/discovery/RingDiscoverySession.d.ts +0 -1
- package/dist/src/dht/discovery/RingDiscoverySession.js +1 -1
- package/dist/src/dht/discovery/RingDiscoverySession.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.d.ts +3 -3
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js +8 -8
- package/dist/src/dht/recursive-operation/RecursiveOperationManager.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.d.ts +2 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js +2 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcLocal.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.d.ts +2 -2
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js +3 -3
- package/dist/src/dht/recursive-operation/RecursiveOperationRpcRemote.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.d.ts +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js +7 -7
- package/dist/src/dht/recursive-operation/RecursiveOperationSession.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.d.ts +3 -3
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.js.map +1 -1
- package/dist/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.d.ts +2 -2
- package/dist/src/dht/routing/DuplicateDetector.js.map +1 -1
- package/dist/src/dht/routing/Router.d.ts +4 -1
- package/dist/src/dht/routing/Router.js +17 -9
- package/dist/src/dht/routing/Router.js.map +1 -1
- package/dist/src/dht/routing/RouterRpcLocal.d.ts +2 -2
- package/dist/src/dht/routing/RouterRpcLocal.js +5 -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 +1 -1
- package/dist/src/dht/routing/RoutingSession.js +7 -8
- package/dist/src/dht/routing/RoutingSession.js.map +1 -1
- package/dist/src/dht/routing/RoutingTablesCache.d.ts +1 -1
- package/dist/src/dht/routing/getPreviousPeer.d.ts +1 -1
- package/dist/src/dht/store/LocalDataStore.d.ts +1 -1
- package/dist/src/dht/store/LocalDataStore.js +3 -3
- package/dist/src/dht/store/LocalDataStore.js.map +1 -1
- package/dist/src/dht/store/StoreManager.d.ts +3 -3
- 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.d.ts +4 -4
- package/dist/src/dht/store/StoreRpcLocal.js +4 -4
- package/dist/src/dht/store/StoreRpcLocal.js.map +1 -1
- package/dist/src/dht/store/StoreRpcRemote.d.ts +3 -3
- package/dist/src/dht/store/StoreRpcRemote.js +7 -4
- package/dist/src/dht/store/StoreRpcRemote.js.map +1 -1
- package/dist/src/exports.d.ts +2 -2
- package/dist/src/exports.js +6 -6
- package/dist/src/exports.js.map +1 -1
- package/dist/src/helpers/AddressTools.js +2 -3
- package/dist/src/helpers/AddressTools.js.map +1 -1
- package/dist/src/helpers/Connectivity.d.ts +1 -1
- package/dist/src/helpers/Connectivity.js +1 -1
- package/dist/src/helpers/Connectivity.js.map +1 -1
- package/dist/src/helpers/createPeerDescriptor.d.ts +1 -1
- package/dist/src/helpers/createPeerDescriptor.js +2 -2
- package/dist/src/helpers/createPeerDescriptor.js.map +1 -1
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.d.ts +1 -1
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.js +1 -1
- package/dist/src/helpers/createPeerDescriptorSignaturePayload.js.map +1 -1
- package/dist/src/helpers/debugHelpers.js +2 -2
- package/dist/src/helpers/debugHelpers.js.map +1 -1
- package/dist/src/helpers/protoClasses.d.ts +1 -1
- package/dist/src/helpers/protoClasses.js +1 -1
- package/dist/src/helpers/protoClasses.js.map +1 -1
- package/dist/src/helpers/protoToString.js +1 -2
- package/dist/src/helpers/protoToString.js.map +1 -1
- package/dist/src/helpers/version.d.ts +1 -1
- package/dist/src/helpers/version.js +4 -4
- package/dist/src/helpers/version.js.map +1 -1
- package/dist/src/identifiers.d.ts +5 -5
- package/dist/src/identifiers.js +11 -11
- package/dist/src/identifiers.js.map +1 -1
- package/dist/src/rpc-protocol/DhtCallContext.d.ts +1 -1
- package/dist/src/rpc-protocol/DhtRpcOptions.d.ts +1 -1
- package/dist/src/transport/ITransport.d.ts +2 -1
- package/dist/src/transport/ListeningRpcCommunicator.d.ts +2 -1
- package/dist/src/transport/ListeningRpcCommunicator.js +13 -4
- package/dist/src/transport/ListeningRpcCommunicator.js.map +1 -1
- package/dist/src/transport/RoutingRpcCommunicator.d.ts +1 -1
- package/eslint.config.mjs +12 -0
- package/jest.config.ts +12 -0
- package/package.json +17 -18
- package/proto.sh +2 -3
- package/protos/DhtRpc.proto +11 -4
- package/src/connection/Connection.ts +1 -1
- package/src/connection/ConnectionLockRpcLocal.ts +16 -7
- package/src/connection/ConnectionLockRpcRemote.ts +18 -6
- package/src/connection/ConnectionLockStates.ts +18 -0
- package/src/connection/ConnectionManager.ts +93 -27
- package/src/connection/ConnectionsView.ts +1 -1
- package/src/connection/ConnectorFacade.ts +1 -1
- package/src/connection/Handshaker.ts +18 -14
- package/src/connection/ManagedConnection.ts +28 -3
- package/src/connection/PendingConnection.ts +1 -1
- package/src/connection/connectivityChecker.ts +6 -5
- package/src/connection/connectivityRequestHandler.ts +4 -4
- package/src/connection/simulator/Simulator.ts +8 -7
- package/src/connection/simulator/SimulatorConnection.ts +10 -10
- package/src/connection/simulator/SimulatorConnector.ts +5 -5
- package/src/connection/simulator/SimulatorTransport.ts +3 -2
- package/src/connection/simulator/pings.ts +1 -1
- package/src/connection/webrtc/BrowserWebrtcConnection.ts +10 -1
- package/src/connection/webrtc/NodeWebrtcConnection.ts +15 -11
- package/src/connection/webrtc/WebrtcConnector.ts +13 -11
- package/src/connection/webrtc/WebrtcConnectorRpcLocal.ts +8 -8
- package/src/connection/webrtc/WebrtcConnectorRpcRemote.ts +2 -2
- package/src/connection/websocket/WebsocketClientConnector.ts +5 -5
- package/src/connection/websocket/WebsocketClientConnectorRpcLocal.ts +5 -5
- package/src/connection/websocket/WebsocketClientConnectorRpcRemote.ts +4 -4
- package/src/connection/websocket/WebsocketServerConnector.ts +24 -20
- package/src/dht/DhtNode.ts +29 -11
- package/src/dht/DhtNodeRpcLocal.ts +8 -8
- package/src/dht/DhtNodeRpcRemote.ts +5 -5
- package/src/dht/ExternalApiRpcLocal.ts +8 -8
- package/src/dht/ExternalApiRpcRemote.ts +6 -6
- package/src/dht/PeerManager.ts +16 -14
- package/src/dht/contact/Contact.ts +3 -3
- package/src/dht/contact/RingContactList.ts +3 -3
- package/src/dht/contact/RpcRemote.ts +1 -1
- package/src/dht/contact/SortedContactList.ts +3 -3
- package/src/dht/contact/ringIdentifiers.ts +1 -1
- package/src/dht/discovery/DiscoverySession.ts +5 -5
- package/src/dht/discovery/PeerDiscovery.ts +12 -12
- package/src/dht/discovery/RingDiscoverySession.ts +3 -3
- package/src/dht/recursive-operation/RecursiveOperationManager.ts +10 -10
- package/src/dht/recursive-operation/RecursiveOperationRpcLocal.ts +4 -4
- package/src/dht/recursive-operation/RecursiveOperationRpcRemote.ts +6 -6
- package/src/dht/recursive-operation/RecursiveOperationSession.ts +8 -8
- package/src/dht/recursive-operation/RecursiveOperationSessionRpcLocal.ts +5 -5
- package/src/dht/recursive-operation/RecursiveOperationSessionRpcRemote.ts +2 -2
- package/src/dht/routing/DuplicateDetector.ts +1 -1
- package/src/dht/routing/Router.ts +19 -10
- package/src/dht/routing/RouterRpcLocal.ts +7 -7
- package/src/dht/routing/RouterRpcRemote.ts +9 -9
- package/src/dht/routing/RoutingSession.ts +9 -10
- package/src/dht/routing/RoutingTablesCache.ts +1 -1
- package/src/dht/routing/getPreviousPeer.ts +1 -1
- package/src/dht/store/LocalDataStore.ts +5 -5
- package/src/dht/store/StoreManager.ts +13 -13
- package/src/dht/store/StoreRpcLocal.ts +9 -9
- package/src/dht/store/StoreRpcRemote.ts +10 -7
- package/src/exports.ts +5 -5
- package/src/helpers/Connectivity.ts +1 -1
- package/src/helpers/createPeerDescriptor.ts +3 -3
- package/src/helpers/createPeerDescriptorSignaturePayload.ts +1 -1
- package/src/helpers/protoClasses.ts +2 -2
- package/src/helpers/version.ts +2 -2
- package/src/identifiers.ts +7 -7
- package/src/rpc-protocol/DhtCallContext.ts +1 -1
- package/src/rpc-protocol/DhtRpcOptions.ts +1 -1
- package/src/transport/ITransport.ts +2 -1
- package/src/transport/ListeningRpcCommunicator.ts +14 -6
- package/src/transport/RoutingRpcCommunicator.ts +2 -2
- package/test/benchmark/Find.test.ts +9 -9
- package/test/benchmark/KademliaCorrectness.test.ts +7 -7
- package/test/benchmark/RingCorrectness.test.ts +8 -8
- package/test/benchmark/SortedContactListBenchmark.test.ts +10 -10
- package/test/benchmark/hybrid-network-simulation/RingContactList.test.ts +3 -3
- package/test/end-to-end/Layer0Webrtc-Layer1.test.ts +6 -6
- package/test/end-to-end/Layer0Webrtc.test.ts +6 -6
- 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 +6 -6
- package/test/integration/ConnectionLocking.test.ts +48 -37
- package/test/integration/ConnectionManager.test.ts +62 -6
- package/test/integration/ConnectivityChecking.test.ts +3 -2
- package/test/integration/DhtJoinPeerDiscovery.test.ts +2 -2
- package/test/integration/DhtNode.test.ts +6 -6
- package/test/integration/DhtNodeExternalAPI.test.ts +7 -7
- package/test/integration/DhtNodeRpcRemote.test.ts +9 -9
- package/test/integration/DhtRpc.test.ts +12 -13
- package/test/integration/Find.test.ts +5 -5
- package/test/integration/GeoIpConnectivityChecking.test.ts +8 -7
- package/test/integration/Layer1-scale.test.ts +3 -3
- package/test/integration/Mock-Layer1-Layer0.test.ts +6 -6
- package/test/integration/MultipleEntryPointJoining.test.ts +1 -1
- package/test/integration/ReplicateData.test.ts +10 -11
- package/test/integration/RouteMessage.test.ts +13 -13
- package/test/integration/RouterRpcRemote.test.ts +7 -7
- package/test/integration/SimultaneousConnections.test.ts +14 -13
- package/test/integration/Store.test.ts +9 -9
- package/test/integration/StoreAndDelete.test.ts +10 -10
- package/test/integration/StoreOnDhtWithThreeNodes.test.ts +10 -10
- package/test/integration/StoreOnDhtWithTwoNodes.test.ts +10 -10
- package/test/integration/StoreRpcRemote.test.ts +11 -11
- package/test/integration/WebrtcConnectionManagement.test.ts +4 -31
- package/test/integration/WebrtcConnectorRpc.test.ts +14 -14
- package/test/integration/Websocket.test.ts +0 -2
- package/test/integration/WebsocketClientConnectorRpc.test.ts +8 -8
- package/test/integration/WebsocketConnectionManagement.test.ts +11 -12
- package/test/integration/{rpc-connections-over-webrpc.test.ts → rpc-connections-over-webrtc.test.ts} +12 -46
- package/test/unit/AutoCertifierClientFacade.test.ts +6 -6
- package/test/unit/ConnectionManager.test.ts +4 -3
- package/test/unit/ConnectivityHelpers.test.ts +1 -1
- package/test/unit/DiscoverySession.test.ts +6 -6
- package/test/unit/Handshaker.test.ts +2 -2
- package/test/unit/ListeningRpcCommunicator.test.ts +52 -0
- package/test/unit/LocalDataStore.test.ts +21 -21
- package/test/unit/PeerManager.test.ts +15 -15
- package/test/unit/PendingConnection.test.ts +1 -1
- package/test/unit/ProtobufMessage.test.ts +1 -1
- package/test/unit/RandomContactList.test.ts +2 -2
- package/test/unit/RecursiveOperationManager.test.ts +3 -3
- package/test/unit/RecursiveOperationSession.test.ts +6 -6
- package/test/unit/Router.test.ts +6 -6
- package/test/unit/RoutingSession.test.ts +13 -6
- package/test/unit/SortedContactList.test.ts +8 -8
- package/test/unit/StoreManager.test.ts +12 -12
- package/test/unit/StoreRpcLocal.test.ts +9 -9
- package/test/unit/WebrtcConnection.test.ts +29 -0
- package/test/unit/WebsocketClientConnector.test.ts +1 -1
- package/test/unit/WebsocketServerConnector.test.ts +1 -1
- package/test/unit/connectivityRequestHandler.test.ts +6 -6
- package/test/unit/createPeerDescriptor.test.ts +4 -4
- package/test/unit/customMatchers.test.ts +18 -0
- package/test/unit/getClosestNodes.test.ts +5 -5
- package/test/unit/version.test.ts +9 -9
- package/test/utils/FakeConnectorFacade.ts +1 -1
- package/test/utils/FakeTransport.ts +12 -9
- package/test/utils/customMatchers.ts +9 -9
- package/test/utils/mock/MockConnectionsView.ts +1 -1
- package/test/utils/mock/MockRouter.ts +5 -1
- package/test/utils/mock/MockTransport.ts +6 -1
- package/test/utils/mock/mockDataEntry.ts +6 -6
- package/test/utils/topology.ts +3 -4
- package/test/utils/utils.ts +11 -11
- package/tsconfig.jest.json +2 -1
- package/tsconfig.node.json +1 -0
- package/.eslintignore +0 -5
- package/.eslintrc +0 -3
- package/dist/src/proto/google/protobuf/any.d.ts +0 -173
- package/dist/src/proto/google/protobuf/any.js +0 -155
- package/dist/src/proto/google/protobuf/any.js.map +0 -1
- package/dist/src/proto/google/protobuf/empty.d.ts +0 -32
- package/dist/src/proto/google/protobuf/empty.js +0 -32
- package/dist/src/proto/google/protobuf/empty.js.map +0 -1
- package/dist/src/proto/google/protobuf/timestamp.d.ts +0 -149
- package/dist/src/proto/google/protobuf/timestamp.js +0 -136
- package/dist/src/proto/google/protobuf/timestamp.js.map +0 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +0 -352
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +0 -278
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +0 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +0 -975
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +0 -661
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +0 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +0 -157
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.js +0 -3
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.js.map +0 -1
- package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.d.ts +0 -87
- package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.js +0 -66
- package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.js.map +0 -1
- package/dist/src/proto/tests.d.ts +0 -39
- package/dist/src/proto/tests.js +0 -34
- package/dist/src/proto/tests.js.map +0 -1
- package/jest.config.js +0 -5
- package/src/proto/google/protobuf/any.ts +0 -319
- package/src/proto/google/protobuf/empty.ts +0 -82
- package/src/proto/google/protobuf/timestamp.ts +0 -281
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +0 -407
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +0 -160
- package/src/proto/packages/dht/protos/DhtRpc.ts +0 -1244
- package/src/proto/packages/proto-rpc/protos/ProtoRpc.ts +0 -108
- package/src/proto/tests.ts +0 -52
- package/test/benchmark/any.test.ts +0 -28
- /package/{src/types/glogal.d.ts → test/types/global.d.ts} +0 -0
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -43,12 +53,19 @@ class ManagedConnection extends eventemitter3_1.default {
|
|
|
43
53
|
lastUsedTimestamp = Date.now();
|
|
44
54
|
replacedAsDuplicate = false;
|
|
45
55
|
stopped = false;
|
|
56
|
+
openedAt = Date.now();
|
|
57
|
+
bytesSent = 0;
|
|
58
|
+
bytesReceived = 0;
|
|
59
|
+
messagesSent = 0;
|
|
60
|
+
messagesReceived = 0;
|
|
46
61
|
constructor(peerDescriptor, connection) {
|
|
47
62
|
super();
|
|
48
63
|
this.connectionId = (0, Connection_1.createRandomConnectionId)();
|
|
49
64
|
this.connection = connection;
|
|
50
65
|
connection.on('data', (bytes) => {
|
|
51
66
|
this.lastUsedTimestamp = Date.now();
|
|
67
|
+
this.messagesReceived += 1;
|
|
68
|
+
this.bytesReceived += bytes.length;
|
|
52
69
|
this.emit('managedData', bytes, this.getPeerDescriptor());
|
|
53
70
|
});
|
|
54
71
|
connection.on('disconnected', (gracefulLeave) => this.onDisconnected(gracefulLeave));
|
|
@@ -73,6 +90,8 @@ class ManagedConnection extends eventemitter3_1.default {
|
|
|
73
90
|
throw new Err.SendFailed('ManagedConnection is stopped');
|
|
74
91
|
}
|
|
75
92
|
this.lastUsedTimestamp = Date.now();
|
|
93
|
+
this.messagesSent += 1;
|
|
94
|
+
this.bytesSent += data.length;
|
|
76
95
|
this.connection.send(data);
|
|
77
96
|
}
|
|
78
97
|
async close(gracefulLeave) {
|
|
@@ -83,7 +102,7 @@ class ManagedConnection extends eventemitter3_1.default {
|
|
|
83
102
|
this.removeAllListeners();
|
|
84
103
|
}
|
|
85
104
|
getNodeId() {
|
|
86
|
-
return (0, identifiers_1.
|
|
105
|
+
return (0, identifiers_1.toNodeId)(this.remotePeerDescriptor);
|
|
87
106
|
}
|
|
88
107
|
getLastUsedTimestamp() {
|
|
89
108
|
return this.lastUsedTimestamp;
|
|
@@ -91,6 +110,20 @@ class ManagedConnection extends eventemitter3_1.default {
|
|
|
91
110
|
getPeerDescriptor() {
|
|
92
111
|
return this.remotePeerDescriptor;
|
|
93
112
|
}
|
|
113
|
+
getDiagnosticInfo() {
|
|
114
|
+
return {
|
|
115
|
+
remotePeerDescriptor: this.remotePeerDescriptor,
|
|
116
|
+
lastUsedTimestamp: this.lastUsedTimestamp,
|
|
117
|
+
replacedAsDuplicate: this.replacedAsDuplicate,
|
|
118
|
+
stopped: this.stopped,
|
|
119
|
+
openedAt: this.openedAt,
|
|
120
|
+
bytesSent: this.bytesSent,
|
|
121
|
+
bytesReceived: this.bytesReceived,
|
|
122
|
+
messagesSent: this.messagesSent,
|
|
123
|
+
messagesReceived: this.messagesReceived
|
|
124
|
+
// Add connection type?
|
|
125
|
+
};
|
|
126
|
+
}
|
|
94
127
|
}
|
|
95
128
|
exports.ManagedConnection = ManagedConnection;
|
|
96
129
|
//# sourceMappingURL=ManagedConnection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedConnection.js","sourceRoot":"","sources":["../../../src/connection/ManagedConnection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManagedConnection.js","sourceRoot":"","sources":["../../../src/connection/ManagedConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAwC;AAExC,0CAAuC;AACvC,kEAAwC;AACxC,2DAA0E;AAC1E,gDAAqD;AACrD,6CAAuD;AAOvD,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAIjC,mHAAmH;AACnH,gDAAgD;AAChD,MAAa,iBAAkB,SAAQ,uBAAqC;IAEhE,UAAU,CAAa;IACxB,YAAY,CAAc;IACzB,oBAAoB,CAAgB;IACpC,iBAAiB,GAAW,IAAI,CAAC,GAAG,EAAE,CAAA;IACtC,mBAAmB,GAAG,KAAK,CAAA;IAC3B,OAAO,GAAG,KAAK,CAAA;IACf,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IACrB,SAAS,GAAG,CAAC,CAAA;IACb,aAAa,GAAG,CAAC,CAAA;IACjB,YAAY,GAAG,CAAC,CAAA;IAChB,gBAAgB,GAAG,CAAC,CAAA;IAE5B,YAAY,cAA8B,EAAE,UAAuB;QAC/D,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,YAAY,GAAG,IAAA,qCAAwB,GAAE,CAAA;QAC9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAiB,EAAE,EAAE;YACxC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACnC,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAA;YAC1B,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,MAAM,CAAA;YAClC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAG,CAAC,CAA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,CAAC;YACf,OAAM;QACV,CAAC;QACD,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC1C,IAAI,CAAC,kBAAkB,EAAE,CAAA;IAC7B,CAAC;IAED,SAAS;QACL,OAAO,IAAA,sBAAQ,EAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IAC9C,CAAC;IAED,oBAAoB;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAA;IACjC,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,oBAAoB,CAAA;IACpC,CAAC;IAED,iBAAiB;QACb,OAAO;YACH,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,uBAAuB;SAC1B,CAAA;IAEL,CAAC;CAEJ;AA5FD,8CA4FC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { PeerDescriptor } from '
|
|
2
|
+
import { PeerDescriptor } from '../../generated/packages/dht/protos/DhtRpc';
|
|
3
3
|
import { IConnection } from './IConnection';
|
|
4
4
|
export interface PendingConnectionEvents {
|
|
5
5
|
connected: (peerDescriptor: PeerDescriptor, connection: IConnection) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectivityRequest, ConnectivityResponse, PeerDescriptor } from '
|
|
1
|
+
import { ConnectivityRequest, ConnectivityResponse, PeerDescriptor } from '../../generated/packages/dht/protos/DhtRpc';
|
|
2
2
|
import { IConnection } from './IConnection';
|
|
3
3
|
export declare const connectAsync: ({ url, allowSelfSignedCertificate, timeoutMs }: {
|
|
4
4
|
url: string;
|
|
@@ -15,19 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.sendConnectivityRequest = exports.CONNECTIVITY_CHECKER_SERVICE_ID = exports.connectAsync = void 0;
|
|
27
37
|
const utils_1 = require("@streamr/utils");
|
|
28
38
|
const uuid_1 = require("uuid");
|
|
29
39
|
const Err = __importStar(require("../helpers/errors"));
|
|
30
|
-
const DhtRpc_1 = require("
|
|
40
|
+
const DhtRpc_1 = require("../../generated/packages/dht/protos/DhtRpc");
|
|
31
41
|
const NodeWebsocketClientConnection_1 = require("./websocket/NodeWebsocketClientConnection");
|
|
32
42
|
const WebsocketClientConnector_1 = require("./websocket/WebsocketClientConnector");
|
|
33
43
|
const version_1 = require("../helpers/version");
|
|
@@ -94,14 +104,15 @@ const sendConnectivityRequest = async (request, entryPoint) => {
|
|
|
94
104
|
if (message.body.oneofKind === 'connectivityResponse') {
|
|
95
105
|
logger.debug('ConnectivityResponse received: ' + JSON.stringify(DhtRpc_1.Message.toJson(message)));
|
|
96
106
|
const connectivityResponseMessage = message.body.connectivityResponse;
|
|
97
|
-
const
|
|
107
|
+
const remoteProtocolVersion = connectivityResponseMessage.protocolVersion;
|
|
98
108
|
outgoingConnection.off('data', listener);
|
|
99
109
|
clearTimeout(timeoutId);
|
|
100
|
-
if ((0, version_1.
|
|
110
|
+
if ((0, version_1.isMaybeSupportedProtocolVersion)(remoteProtocolVersion)) {
|
|
101
111
|
resolve(connectivityResponseMessage);
|
|
102
112
|
}
|
|
103
113
|
else {
|
|
104
|
-
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
115
|
+
reject(`Unsupported version: ${remoteProtocolVersion}`);
|
|
105
116
|
}
|
|
106
117
|
}
|
|
107
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectivityChecker.js","sourceRoot":"","sources":["../../../src/connection/connectivityChecker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connectivityChecker.js","sourceRoot":"","sources":["../../../src/connection/connectivityChecker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAsF;AACtF,+BAAyB;AACzB,uDAAwC;AACxC,uEAGmD;AAEnD,6FAAqF;AACrF,mFAAuF;AACvF,gDAAoE;AAEpE,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,6CAA6C;AACtC,MAAM,YAAY,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,0BAA0B,EAAE,SAAS,GAAG,IAAI,EACV,EACpD,EAAE;IACtB,MAAM,MAAM,GAAG,IA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,CAAC,CAAA;wBACzC,YAAY,CAAC,SAAS,CAAC,CAAA;wBACvB,IAAI,IAAA,yCAA+B,EAAC,qBAAqB,CAAC,EAAE,CAAC;4BACzD,OAAO,CAAC,2BAA2B,CAAC,CAAA;wBACxC,CAAC;6BAAM,CAAC;4BACJ,2EAA2E;4BAC3E,MAAM,CAAC,wBAAwB,qBAAqB,EAAE,CAAC,CAAA;wBAC3D,CAAC;oBACL,CAAC;gBACL,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACX,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;gBACpD,CAAC;YACL,CAAC,CAAA;YACD,kBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;IACD,IAAI,CAAC;QACD,MAAM,UAAU,GAAG,eAAe,EAAE,CAAA;QACpC,kBAAkB,CAAC,IAAI,CAAC,gBAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;QAC9C,MAAM,CAAC,KAAK,CAAC,4BAA4B,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAChF,OAAO,MAAM,UAAU,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAA;QAClD,MAAM,CAAC,CAAA;IACX,CAAC;AACL,CAAC,CAAA;AAtEY,QAAA,uBAAuB,2BAsEnC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.attachConnectivityRequestHandler = exports.DISABLE_CONNECTIVITY_PROBE = void 0;
|
|
4
4
|
const utils_1 = require("@streamr/utils");
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
|
-
const DhtRpc_1 = require("
|
|
6
|
+
const DhtRpc_1 = require("../../generated/packages/dht/protos/DhtRpc");
|
|
7
7
|
const ConnectionManager_1 = require("./ConnectionManager");
|
|
8
8
|
const connectivityChecker_1 = require("./connectivityChecker");
|
|
9
9
|
const WebsocketClientConnector_1 = require("./websocket/WebsocketClientConnector");
|
|
@@ -45,7 +45,7 @@ const handleIncomingConnectivityRequest = async (connection, connectivityRequest
|
|
|
45
45
|
host,
|
|
46
46
|
natType: ConnectionManager_1.NatType.UNKNOWN,
|
|
47
47
|
ipAddress: (0, utils_1.ipv4ToNumber)(ipAddress),
|
|
48
|
-
|
|
48
|
+
protocolVersion: version_1.LOCAL_PROTOCOL_VERSION
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
if (geoIpLocator !== undefined) {
|
|
@@ -87,7 +87,7 @@ const connectivityProbe = async (connectivityRequest, ipAddress, host) => {
|
|
|
87
87
|
natType: ConnectionManager_1.NatType.OPEN_INTERNET,
|
|
88
88
|
websocket: { host, port: connectivityRequest.port, tls: connectivityRequest.tls },
|
|
89
89
|
ipAddress: (0, utils_1.ipv4ToNumber)(ipAddress),
|
|
90
|
-
|
|
90
|
+
protocolVersion: version_1.LOCAL_PROTOCOL_VERSION
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
catch (err) {
|
|
@@ -96,7 +96,7 @@ const connectivityProbe = async (connectivityRequest, ipAddress, host) => {
|
|
|
96
96
|
host,
|
|
97
97
|
natType: ConnectionManager_1.NatType.UNKNOWN,
|
|
98
98
|
ipAddress: (0, utils_1.ipv4ToNumber)(ipAddress),
|
|
99
|
-
|
|
99
|
+
protocolVersion: version_1.LOCAL_PROTOCOL_VERSION
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
if (outgoingConnection) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectivityRequestHandler.js","sourceRoot":"","sources":["../../../src/connection/connectivityRequestHandler.ts"],"names":[],"mappings":";;;AAAA,0CAAqD;AACrD,+BAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"connectivityRequestHandler.js","sourceRoot":"","sources":["../../../src/connection/connectivityRequestHandler.ts"],"names":[],"mappings":";;;AAAA,0CAAqD;AACrD,+BAAyB;AACzB,uEAImD;AACnD,2DAA6C;AAC7C,+DAAqF;AAGrF,mFAAuF;AACvF,gDAA2D;AAG9C,QAAA,0BAA0B,GAAG,CAAC,CAAA;AAE3C,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAE1B,MAAM,gCAAgC,GAAG,CAAC,oBAA+C,EAAE,YAA2B,EAAQ,EAAE;IACnI,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAgB,EAAE,EAAE;QACvD,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACpC,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,gBAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YACxC,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,KAAK,qBAAqB,EAAE,CAAC;gBACnD,MAAM,CAAC,KAAK,CAAC,gCAAgC,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;gBACxF,IAAI,CAAC;oBACD,MAAM,iCAAiC,CAAC,oBAAoB,EACxD,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAA;oBACnD,MAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAA;gBACxD,CAAC;gBAAC,OAAO,IAAI,EAAE,CAAC;oBACZ,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;gBACpE,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1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,OAAO,EAAE,2BAAO,CAAC,OAAO;YACxB,SAAS,EAAE,IAAA,oBAAY,EAAC,SAAS,CAAC;YAClC,eAAe,EAAE,gCAAsB;SAC1C,CAAA;IACL,CAAC;IACD,IAAI,kBAAkB,EAAE,CAAC;QACrB,+DAA+D;QAC/D,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,2BAA2B,CAAA;AACtC,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PeerDescriptor } from '
|
|
1
|
+
import { PeerDescriptor } from '../../../generated/packages/dht/protos/DhtRpc';
|
|
2
2
|
import { SimulatorConnector } from './SimulatorConnector';
|
|
3
3
|
import { SimulatorConnection } from './SimulatorConnection';
|
|
4
4
|
export declare enum LatencyType {
|
|
@@ -150,13 +150,14 @@ class Simulator {
|
|
|
150
150
|
sourceAssociation.connectedCallback();
|
|
151
151
|
}
|
|
152
152
|
addConnector(connector) {
|
|
153
|
-
this.connectors.set((0, identifiers_1.
|
|
153
|
+
this.connectors.set((0, identifiers_1.toNodeId)(connector.getPeerDescriptor()), connector);
|
|
154
154
|
}
|
|
155
155
|
executeConnectOperation(operation) {
|
|
156
|
-
const target = this.connectors.get((0, identifiers_1.
|
|
156
|
+
const target = this.connectors.get((0, identifiers_1.toNodeId)(operation.targetDescriptor));
|
|
157
157
|
if (!target) {
|
|
158
158
|
logger.error('Target connector not found when executing connect operation');
|
|
159
|
-
|
|
159
|
+
operation.association.connectedCallback('Target connector not found');
|
|
160
|
+
return;
|
|
160
161
|
}
|
|
161
162
|
target.handleIncomingConnection(operation.sourceConnection);
|
|
162
163
|
}
|
|
@@ -238,7 +239,7 @@ class Simulator {
|
|
|
238
239
|
logger.error('connect() called on a stopped simulator ' + (new Error().stack));
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
|
-
debugHelpers_1.debugVars
|
|
242
|
+
debugHelpers_1.debugVars.simulatorHeapSize = this.operationQueue.size();
|
|
242
243
|
const association = new Association(sourceConnection, undefined, connectedCallback);
|
|
243
244
|
this.associations.set(sourceConnection.connectionId, association);
|
|
244
245
|
const executionTime = this.generateExecutionTime(association, sourceConnection.localPeerDescriptor.region, targetDescriptor.region);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Simulator.js","sourceRoot":"","sources":["../../../../src/connection/simulator/Simulator.ts"],"names":[],"mappings":";;;;;;AAKA,0CAAuC;AACvC,mCAA8C;AAC9C,gDAAuB;AACvB,6DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"Simulator.js","sourceRoot":"","sources":["../../../../src/connection/simulator/Simulator.ts"],"names":[],"mappings":";;;;;;AAKA,0CAAuC;AACvC,mCAA8C;AAC9C,gDAAuB;AACvB,6DAAsD;AACtD,mDAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,IAAY,WAAgF;AAA5F,WAAY,WAAW;IAAG,4BAAa,CAAA;IAAE,gCAAiB,CAAA;IAAE,4BAAa,CAAA;IAAE,8BAAe,CAAA;AAAC,CAAC,EAAhF,WAAW,2BAAX,WAAW,QAAqE;AAE5F,6BAA6B;AAE7B,MAAM,WAAW;IAQF;IAPJ,gBAAgB,CAAqB;IACrC,qBAAqB,CAAsB;IAC1C,eAAe,GAAW,CAAC,CAAA;IAC3B,OAAO,GAAG,KAAK,CAAA;IAEvB,YAAY,gBAAqC,EAC7C,qBAA2C,EACpC,iBAA4C;QAA5C,sBAAiB,GAAjB,iBAAiB,CAA2B;QAEnD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACxC,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAA;IACtD,CAAC;IAEM,wBAAwB,CAAC,UAA+B;QAC3D,IAAI,CAAC,qBAAqB,GAAG,UAAU,CAAA;IAC3C,CAAC;IAEM,kBAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAA;IAC/B,CAAC;IAEM,kBAAkB,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OAAM;QACV,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,EACxD,gBAAgB,CAAC,mBAAmB,CAAC,MAAM,EAC3C,WAAW,CAAC,qBAAsB,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;QAElE,WAAW,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;QAE7C,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;QAErE,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,0CAA0C,CAAC,CAAA;QAEhF,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACvC,CAAC;IACL,CAAC;CACJ;AAvRD,8BAuRC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectionType, IConnection } from '../IConnection';
|
|
2
2
|
import { Simulator } from './Simulator';
|
|
3
|
-
import { PeerDescriptor } from '
|
|
3
|
+
import { PeerDescriptor } from '../../../generated/packages/dht/protos/DhtRpc';
|
|
4
4
|
import { Connection } from '../Connection';
|
|
5
5
|
export declare class SimulatorConnection extends Connection implements IConnection {
|
|
6
6
|
private stopped;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SimulatorConnection = void 0;
|
|
4
|
-
const DhtRpc_1 = require("
|
|
4
|
+
const DhtRpc_1 = require("../../../generated/packages/dht/protos/DhtRpc");
|
|
5
5
|
const Connection_1 = require("../Connection");
|
|
6
6
|
const utils_1 = require("@streamr/utils");
|
|
7
7
|
const protoToString_1 = require("../../helpers/protoToString");
|
|
@@ -33,14 +33,14 @@ class SimulatorConnection extends Connection_1.Connection {
|
|
|
33
33
|
this.simulator.send(this, data);
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
const localNodeId = (0, identifiers_1.
|
|
37
|
-
const targetNodeId = (0, identifiers_1.
|
|
36
|
+
const localNodeId = (0, identifiers_1.toNodeId)(this.localPeerDescriptor);
|
|
37
|
+
const targetNodeId = (0, identifiers_1.toNodeId)(this.targetPeerDescriptor);
|
|
38
38
|
logger.error(localNodeId + ', ' + targetNodeId + 'tried to send() on a stopped connection');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
async close(gracefulLeave) {
|
|
42
|
-
const localNodeId = (0, identifiers_1.
|
|
43
|
-
const targetNodeId = (0, identifiers_1.
|
|
42
|
+
const localNodeId = (0, identifiers_1.toNodeId)(this.localPeerDescriptor);
|
|
43
|
+
const targetNodeId = (0, identifiers_1.toNodeId)(this.targetPeerDescriptor);
|
|
44
44
|
logger.trace(localNodeId + ', ' + targetNodeId + ' close()');
|
|
45
45
|
if (!this.stopped) {
|
|
46
46
|
logger.trace(localNodeId + ', ' + targetNodeId + ' close() not stopped');
|
|
@@ -90,7 +90,7 @@ class SimulatorConnection extends Connection_1.Connection {
|
|
|
90
90
|
}
|
|
91
91
|
handleIncomingDisconnection() {
|
|
92
92
|
if (!this.stopped) {
|
|
93
|
-
const localNodeId = (0, identifiers_1.
|
|
93
|
+
const localNodeId = (0, identifiers_1.toNodeId)(this.localPeerDescriptor);
|
|
94
94
|
logger.trace(localNodeId + ' handleIncomingDisconnection()');
|
|
95
95
|
this.stopped = true;
|
|
96
96
|
this.doDisconnect(false);
|
|
@@ -100,7 +100,7 @@ class SimulatorConnection extends Connection_1.Connection {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
destroy() {
|
|
103
|
-
const localNodeId = (0, identifiers_1.
|
|
103
|
+
const localNodeId = (0, identifiers_1.toNodeId)(this.localPeerDescriptor);
|
|
104
104
|
if (!this.stopped) {
|
|
105
105
|
logger.trace(localNodeId + ' destroy()');
|
|
106
106
|
this.removeAllListeners();
|
|
@@ -111,8 +111,8 @@ class SimulatorConnection extends Connection_1.Connection {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
doDisconnect(gracefulLeave) {
|
|
114
|
-
const localNodeId = (0, identifiers_1.
|
|
115
|
-
const targetNodeId = (0, identifiers_1.
|
|
114
|
+
const localNodeId = (0, identifiers_1.toNodeId)(this.localPeerDescriptor);
|
|
115
|
+
const targetNodeId = (0, identifiers_1.toNodeId)(this.targetPeerDescriptor);
|
|
116
116
|
logger.trace(localNodeId + ' doDisconnect()');
|
|
117
117
|
this.stopped = true;
|
|
118
118
|
logger.trace(localNodeId + ', ' + targetNodeId + ' doDisconnect emitting');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimulatorConnection.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorConnection.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"SimulatorConnection.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorConnection.ts"],"names":[],"mappings":";;;AAEA,0EAAuF;AACvF,8CAA0C;AAC1C,0CAAuC;AACvC,+DAA2D;AAC3D,mDAA4C;AAE5C,MAAM,MAAM,GAAG,IAAI,cAAM,CAAC,MAAM,CAAC,CAAA;AAEjC,MAAa,mBAAoB,SAAQ,uBAAU;IAEvC,OAAO,GAAG,KAAK,CAAA;IAChB,mBAAmB,CAAgB;IAClC,oBAAoB,CAAgB;IACpC,SAAS,CAAW;IAE5B,YACI,mBAAmC,EACnC,oBAAoC,EACpC,cAA8B,EAC9B,SAAoB;QAEpB,KAAK,CAAC,cAAc,CAAC,CAAA;QAErB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAC9C,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAA;QAC5C,IAAI,CAAC,oBAAoB,GAAG,oBAAo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ACV,MAAM,WAAW,GAAG,IAAA,sBAAQ,EAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACtD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,YAAY,CAAC,CAAA;YACxC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;QACxC,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,+CAA+C,CAAC,CAAA;QAC/E,CAAC;IACL,CAAC;IAEO,YAAY,CAAC,aAAsB;QACvC,MAAM,WAAW,GAAG,IAAA,sBAAQ,EAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACtD,MAAM,YAAY,GAAG,IAAA,sBAAQ,EAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;QACxD,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC,CAAA;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QAEnB,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,GAAG,YAAY,GAAG,wBAAwB,CAAC,CAAA;QAE1E,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAAA;IAC5C,CAAC;CACJ;AA9HD,kDA8HC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PeerDescriptor } from '
|
|
1
|
+
import { PeerDescriptor } from '../../../generated/packages/dht/protos/DhtRpc';
|
|
2
2
|
import { Simulator } from './Simulator';
|
|
3
3
|
import { SimulatorConnection } from './SimulatorConnection';
|
|
4
4
|
import { PendingConnection } from '../PendingConnection';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SimulatorConnector = void 0;
|
|
4
4
|
const IConnection_1 = require("../IConnection");
|
|
5
|
-
const DhtRpc_1 = require("
|
|
5
|
+
const DhtRpc_1 = require("../../../generated/packages/dht/protos/DhtRpc");
|
|
6
6
|
const utils_1 = require("@streamr/utils");
|
|
7
7
|
const SimulatorConnection_1 = require("./SimulatorConnection");
|
|
8
8
|
const identifiers_1 = require("../../identifiers");
|
|
@@ -21,8 +21,8 @@ class SimulatorConnector {
|
|
|
21
21
|
this.onNewConnection = onNewConnection;
|
|
22
22
|
}
|
|
23
23
|
connect(targetPeerDescriptor) {
|
|
24
|
-
logger.trace('connect() ' + (0, identifiers_1.
|
|
25
|
-
const nodeId = (0, identifiers_1.
|
|
24
|
+
logger.trace('connect() ' + (0, identifiers_1.toNodeId)(targetPeerDescriptor));
|
|
25
|
+
const nodeId = (0, identifiers_1.toNodeId)(targetPeerDescriptor);
|
|
26
26
|
const existingConnection = this.connectingConnections.get(nodeId);
|
|
27
27
|
if (existingConnection) {
|
|
28
28
|
return existingConnection;
|
|
@@ -49,7 +49,7 @@ class SimulatorConnector {
|
|
|
49
49
|
handleIncomingConnection(sourceConnection) {
|
|
50
50
|
// connection is incoming, so remotePeerDescriptor is localPeerDescriptor
|
|
51
51
|
const remotePeerDescriptor = sourceConnection.localPeerDescriptor;
|
|
52
|
-
const remoteNodeId = (0, identifiers_1.
|
|
52
|
+
const remoteNodeId = (0, identifiers_1.toNodeId)(sourceConnection.localPeerDescriptor);
|
|
53
53
|
logger.trace(remoteNodeId + ' incoming connection, stopped: ' + this.stopped);
|
|
54
54
|
if (this.stopped) {
|
|
55
55
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimulatorConnector.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorConnector.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"SimulatorConnector.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorConnector.ts"],"names":[],"mappings":";;;AA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AC,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAA;QACpG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAEzB,UAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE;YACrC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,6BAA6B,CAAC,CAAA;YAE1D,IAAI,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBAC1C,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,0BAA0B,CAAC,CAAA;gBACvD,IAAA,4BAAe,EAAC,UAAU,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAA;YAC9D,CAAC;iBAAM,CAAC;gBACJ,IAAA,4BAAe,EAAC,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAc,CAAC,oBAAoB,CAAC,CAAA;YACnG,CAAC;QACL,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;IACvD,CAAC;IAEM,KAAK,CAAC,IAAI;QACb,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC;CACJ;AAlFD,gDAkFC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PeerDescriptor } from '
|
|
1
|
+
import { PeerDescriptor } from '../../../generated/packages/dht/protos/DhtRpc';
|
|
2
2
|
import { ConnectionManager } from '../ConnectionManager';
|
|
3
3
|
import { Simulator } from './Simulator';
|
|
4
4
|
export declare class SimulatorTransport extends ConnectionManager {
|
|
@@ -8,7 +8,8 @@ class SimulatorTransport extends ConnectionManager_1.ConnectionManager {
|
|
|
8
8
|
constructor(localPeerDescriptor, simulator) {
|
|
9
9
|
super({
|
|
10
10
|
createConnectorFacade: () => new ConnectorFacade_1.SimulatorConnectorFacade(localPeerDescriptor, simulator),
|
|
11
|
-
metricsContext: new utils_1.MetricsContext()
|
|
11
|
+
metricsContext: new utils_1.MetricsContext(),
|
|
12
|
+
allowIncomingPrivateConnections: false
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimulatorTransport.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorTransport.ts"],"names":[],"mappings":";;;AAAA,0CAA+C;AAE/C,4DAAwD;AAExD,wDAA6D;AAE7D,MAAa,kBAAmB,SAAQ,qCAAiB;IACrD,YAAY,mBAAmC,EAAE,SAAoB;QACjE,KAAK,CAAC;YACF,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,0CAAwB,CAAC,mBAAmB,EAAE,SAAS,CAAC;YACzF,cAAc,EAAE,IAAI,sBAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"SimulatorTransport.js","sourceRoot":"","sources":["../../../../src/connection/simulator/SimulatorTransport.ts"],"names":[],"mappings":";;;AAAA,0CAA+C;AAE/C,4DAAwD;AAExD,wDAA6D;AAE7D,MAAa,kBAAmB,SAAQ,qCAAiB;IACrD,YAAY,mBAAmC,EAAE,SAAoB;QACjE,KAAK,CAAC;YACF,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,0CAAwB,CAAC,mBAAmB,EAAE,SAAS,CAAC;YACzF,cAAc,EAAE,IAAI,sBAAc,EAAE;YACpC,+BAA+B,EAAE,KAAK;SACzC,CAAC,CAAA;IACN,CAAC;CACJ;AARD,gDAQC"}
|
|
@@ -17,5 +17,5 @@ export declare enum RegionIndex {
|
|
|
17
17
|
sa_east_1 = 15
|
|
18
18
|
}
|
|
19
19
|
export declare const regionPingMatrix: number[][];
|
|
20
|
-
export declare function getRegionDelayMatrix():
|
|
20
|
+
export declare function getRegionDelayMatrix(): number[][];
|
|
21
21
|
export declare function getRandomRegion(): number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable max-len, @typescript-eslint/prefer-for-of */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.regionPingMatrix = exports.RegionIndex = void 0;
|
|
5
|
+
exports.getRegionDelayMatrix = getRegionDelayMatrix;
|
|
6
|
+
exports.getRandomRegion = getRandomRegion;
|
|
5
7
|
// This file contains a 16x16 matrix of ping times measured between
|
|
6
8
|
// amazon regions. Converted to typescript from the file pings.csv
|
|
7
9
|
// in order to make loading into browser easier.
|
|
@@ -53,9 +55,7 @@ function getRegionDelayMatrix() {
|
|
|
53
55
|
}
|
|
54
56
|
return ret;
|
|
55
57
|
}
|
|
56
|
-
exports.getRegionDelayMatrix = getRegionDelayMatrix;
|
|
57
58
|
function getRandomRegion() {
|
|
58
59
|
return Math.floor(Math.random() * 15);
|
|
59
60
|
}
|
|
60
|
-
exports.getRandomRegion = getRandomRegion;
|
|
61
61
|
//# sourceMappingURL=pings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pings.js","sourceRoot":"","sources":["../../../../src/connection/simulator/pings.ts"],"names":[],"mappings":";AAAA,8DAA8D;;;
|
|
1
|
+
{"version":3,"file":"pings.js","sourceRoot":"","sources":["../../../../src/connection/simulator/pings.ts"],"names":[],"mappings":";AAAA,8DAA8D;;;AA2B9D,oDAUC;AAED,0CAEC;AAvCD,mEAAmE;AACnE,kEAAkE;AAClE,gDAAgD;AAEhD,IAAY,WAA0N;AAAtO,WAAY,WAAW;IAAG,6DAAY,CAAA;IAAE,uDAAS,CAAA;IAAE,uDAAS,CAAA;IAAE,uDAAS,CAAA;IAAE,yDAAU,CAAA;IA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C,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,MAAM,GAAG,GAAG,EAAE,CAAA;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,wBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClD,GAAG,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACxC,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAED,SAAgB,eAAe;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IWebrtcConnection, WebrtcConnectionEvents } from './IWebrtcConnection';
|
|
2
2
|
import { ConnectionType, IConnection, ConnectionID, ConnectionEvents } from '../IConnection';
|
|
3
|
-
import { PeerDescriptor } from '
|
|
3
|
+
import { PeerDescriptor } from '../../../generated/packages/dht/protos/DhtRpc';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import { IceServer } from './WebrtcConnector';
|
|
6
6
|
import { PortRange } from '../ConnectionManager';
|
|
@@ -28,6 +28,7 @@ export declare class NodeWebrtcConnection extends EventEmitter<Events> implement
|
|
|
28
28
|
private readonly maxMessageSize?;
|
|
29
29
|
private closed;
|
|
30
30
|
private offering?;
|
|
31
|
+
private readonly earlyTimeout;
|
|
31
32
|
constructor(params: Params);
|
|
32
33
|
start(isOffering: boolean): void;
|
|
33
34
|
setRemoteDescription(description: string, type: string): Promise<void>;
|