@streamr/trackerless-network 100.0.0-pretestnet.4 → 100.0.0-testnet-one.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +7 -7
- package/dist/src/identifiers.js +1 -1
- package/dist/src/identifiers.js.map +1 -1
- package/dist/src/logic/DeliveryRpcRemote.d.ts +2 -2
- package/dist/src/logic/DeliveryRpcRemote.js +1 -1
- package/dist/src/logic/DeliveryRpcRemote.js.map +1 -1
- package/dist/src/logic/EntryPointDiscovery.js +1 -0
- package/dist/src/logic/EntryPointDiscovery.js.map +1 -1
- package/dist/src/logic/Layer0Node.d.ts +1 -1
- package/dist/src/logic/RandomGraphNode.js.map +1 -1
- package/dist/src/logic/StreamrNode.js +3 -6
- package/dist/src/logic/StreamrNode.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.d.ts +2 -2
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js +1 -1
- package/dist/src/logic/neighbor-discovery/HandshakeRpcRemote.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/Handshaker.js +1 -0
- package/dist/src/logic/neighbor-discovery/Handshaker.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborFinder.js +2 -0
- package/dist/src/logic/neighbor-discovery/NeighborFinder.js.map +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.d.ts +2 -2
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js +1 -1
- package/dist/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.js.map +1 -1
- package/dist/src/logic/propagation/Propagation.js +1 -0
- package/dist/src/logic/propagation/Propagation.js.map +1 -1
- package/dist/src/logic/proxy/ProxyClient.js +5 -2
- package/dist/src/logic/proxy/ProxyClient.js.map +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.d.ts +2 -2
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js +1 -1
- package/dist/src/logic/proxy/ProxyConnectionRpcRemote.js.map +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.d.ts +2 -2
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js +1 -1
- package/dist/src/logic/temporary-connection/TemporaryConnectionRpcRemote.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +5 -16
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +2 -9
- package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +80 -95
- package/dist/src/proto/packages/dht/protos/DhtRpc.js +67 -66
- package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -1
- package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +3 -10
- package/dist/test/utils/utils.d.ts +1 -1
- package/dist/test/utils/utils.js +1 -1
- package/dist/test/utils/utils.js.map +1 -1
- package/package.json +7 -7
- package/src/identifiers.ts +1 -1
- package/src/logic/DeliveryRpcRemote.ts +2 -2
- package/src/logic/EntryPointDiscovery.ts +3 -2
- package/src/logic/Layer0Node.ts +1 -1
- package/src/logic/RandomGraphNode.ts +1 -1
- package/src/logic/StreamrNode.ts +3 -6
- package/src/logic/neighbor-discovery/HandshakeRpcRemote.ts +2 -2
- package/src/logic/neighbor-discovery/Handshaker.ts +1 -0
- package/src/logic/neighbor-discovery/NeighborFinder.ts +2 -0
- package/src/logic/neighbor-discovery/NeighborUpdateRpcRemote.ts +2 -2
- package/src/logic/propagation/Propagation.ts +1 -0
- package/src/logic/proxy/ProxyClient.ts +4 -2
- package/src/logic/proxy/ProxyConnectionRpcRemote.ts +2 -2
- package/src/logic/temporary-connection/TemporaryConnectionRpcRemote.ts +2 -2
- package/src/proto/packages/dht/protos/DhtRpc.client.ts +6 -20
- package/src/proto/packages/dht/protos/DhtRpc.server.ts +3 -10
- package/src/proto/packages/dht/protos/DhtRpc.ts +103 -135
- package/test/end-to-end/random-graph-with-real-connections.test.ts +1 -1
- package/test/integration/DeliveryRpcRemote.test.ts +2 -2
- package/test/integration/HandshakeRpcRemote.test.ts +2 -2
- package/test/integration/Handshakes.test.ts +3 -3
- package/test/integration/NeighborUpdateRpcRemote.test.ts +3 -3
- package/test/integration/NetworkNode.test.ts +2 -2
- package/test/integration/StreamrNode.test.ts +2 -2
- package/test/integration/joining-streams-on-offline-peers.test.ts +5 -5
- package/test/integration/stream-without-default-entrypoints.test.ts +1 -1
- package/test/unit/EntrypointDiscovery.test.ts +4 -4
- package/test/unit/HandshakeRpcLocal.test.ts +2 -2
- package/test/unit/NodeList.test.ts +3 -3
- package/test/utils/utils.ts +2 -2
|
@@ -14,21 +14,25 @@ import { Any } from "../../../google/protobuf/any";
|
|
|
14
14
|
*/
|
|
15
15
|
export interface StoreDataRequest {
|
|
16
16
|
/**
|
|
17
|
-
* @generated from protobuf field: bytes
|
|
17
|
+
* @generated from protobuf field: bytes key = 1;
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
key: Uint8Array;
|
|
20
20
|
/**
|
|
21
21
|
* @generated from protobuf field: google.protobuf.Any data = 2;
|
|
22
22
|
*/
|
|
23
23
|
data?: Any;
|
|
24
24
|
/**
|
|
25
|
-
* @generated from protobuf field:
|
|
25
|
+
* @generated from protobuf field: dht.PeerDescriptor creator = 3;
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
creator?: PeerDescriptor;
|
|
28
28
|
/**
|
|
29
|
-
* @generated from protobuf field: google.protobuf.Timestamp
|
|
29
|
+
* @generated from protobuf field: google.protobuf.Timestamp createdAt = 4;
|
|
30
|
+
*/
|
|
31
|
+
createdAt?: Timestamp;
|
|
32
|
+
/**
|
|
33
|
+
* @generated from protobuf field: uint32 ttl = 5;
|
|
30
34
|
*/
|
|
31
|
-
|
|
35
|
+
ttl: number;
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
38
|
* @generated from protobuf message dht.StoreDataResponse
|
|
@@ -62,86 +66,59 @@ export interface ExternalStoreDataResponse {
|
|
|
62
66
|
storers: PeerDescriptor[];
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
|
-
* @generated from protobuf message dht.
|
|
66
|
-
*/
|
|
67
|
-
export interface MigrateDataRequest {
|
|
68
|
-
/**
|
|
69
|
-
* @generated from protobuf field: dht.DataEntry dataEntry = 1;
|
|
70
|
-
*/
|
|
71
|
-
dataEntry?: DataEntry;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @generated from protobuf message dht.MigrateDataResponse
|
|
75
|
-
*/
|
|
76
|
-
export interface MigrateDataResponse {
|
|
77
|
-
/**
|
|
78
|
-
* @generated from protobuf field: string error = 1;
|
|
79
|
-
*/
|
|
80
|
-
error: string;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @generated from protobuf message dht.DeleteDataRequest
|
|
84
|
-
*/
|
|
85
|
-
export interface DeleteDataRequest {
|
|
86
|
-
/**
|
|
87
|
-
* @generated from protobuf field: bytes kademliaId = 1;
|
|
88
|
-
*/
|
|
89
|
-
kademliaId: Uint8Array;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* @generated from protobuf message dht.DeleteDataResponse
|
|
69
|
+
* @generated from protobuf message dht.ReplicateDataRequest
|
|
93
70
|
*/
|
|
94
|
-
export interface
|
|
71
|
+
export interface ReplicateDataRequest {
|
|
95
72
|
/**
|
|
96
|
-
* @generated from protobuf field:
|
|
73
|
+
* @generated from protobuf field: dht.DataEntry entry = 1;
|
|
97
74
|
*/
|
|
98
|
-
|
|
75
|
+
entry?: DataEntry;
|
|
99
76
|
}
|
|
100
77
|
/**
|
|
101
78
|
* @generated from protobuf message dht.DataEntry
|
|
102
79
|
*/
|
|
103
80
|
export interface DataEntry {
|
|
104
81
|
/**
|
|
105
|
-
* @generated from protobuf field:
|
|
82
|
+
* @generated from protobuf field: bytes key = 1;
|
|
106
83
|
*/
|
|
107
|
-
|
|
84
|
+
key: Uint8Array;
|
|
108
85
|
/**
|
|
109
|
-
* @generated from protobuf field:
|
|
86
|
+
* @generated from protobuf field: google.protobuf.Any data = 2;
|
|
110
87
|
*/
|
|
111
|
-
|
|
88
|
+
data?: Any;
|
|
112
89
|
/**
|
|
113
|
-
* @generated from protobuf field:
|
|
90
|
+
* @generated from protobuf field: dht.PeerDescriptor creator = 3;
|
|
114
91
|
*/
|
|
115
|
-
|
|
92
|
+
creator?: PeerDescriptor;
|
|
93
|
+
/**
|
|
94
|
+
* @generated from protobuf field: google.protobuf.Timestamp createdAt = 4;
|
|
95
|
+
*/
|
|
96
|
+
createdAt?: Timestamp;
|
|
116
97
|
/**
|
|
117
|
-
* @generated from protobuf field: google.protobuf.Timestamp storedAt =
|
|
98
|
+
* @generated from protobuf field: google.protobuf.Timestamp storedAt = 5;
|
|
118
99
|
*/
|
|
119
100
|
storedAt?: Timestamp;
|
|
120
101
|
/**
|
|
121
|
-
* @generated from protobuf field: uint32 ttl =
|
|
102
|
+
* @generated from protobuf field: uint32 ttl = 6;
|
|
122
103
|
*/
|
|
123
104
|
ttl: number; // milliseconds
|
|
124
105
|
/**
|
|
125
|
-
* @generated from protobuf field: bool stale =
|
|
106
|
+
* @generated from protobuf field: bool stale = 7;
|
|
126
107
|
*/
|
|
127
108
|
stale: boolean;
|
|
128
109
|
/**
|
|
129
|
-
* @generated from protobuf field: bool deleted =
|
|
110
|
+
* @generated from protobuf field: bool deleted = 8;
|
|
130
111
|
*/
|
|
131
112
|
deleted: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* @generated from protobuf field: google.protobuf.Timestamp storerTime = 8;
|
|
134
|
-
*/
|
|
135
|
-
storerTime?: Timestamp;
|
|
136
113
|
}
|
|
137
114
|
/**
|
|
138
115
|
* @generated from protobuf message dht.ClosestPeersRequest
|
|
139
116
|
*/
|
|
140
117
|
export interface ClosestPeersRequest {
|
|
141
118
|
/**
|
|
142
|
-
* @generated from protobuf field: bytes
|
|
119
|
+
* @generated from protobuf field: bytes nodeId = 1;
|
|
143
120
|
*/
|
|
144
|
-
|
|
121
|
+
nodeId: Uint8Array;
|
|
145
122
|
/**
|
|
146
123
|
* @generated from protobuf field: string requestId = 2;
|
|
147
124
|
*/
|
|
@@ -169,9 +146,9 @@ export interface FindRequest {
|
|
|
169
146
|
*/
|
|
170
147
|
sessionId: string;
|
|
171
148
|
/**
|
|
172
|
-
* @generated from protobuf field:
|
|
149
|
+
* @generated from protobuf field: dht.FindAction action = 2;
|
|
173
150
|
*/
|
|
174
|
-
|
|
151
|
+
action: FindAction;
|
|
175
152
|
}
|
|
176
153
|
/**
|
|
177
154
|
* @generated from protobuf message dht.FindResponse
|
|
@@ -186,9 +163,9 @@ export interface FindResponse {
|
|
|
186
163
|
*/
|
|
187
164
|
dataEntries: DataEntry[];
|
|
188
165
|
/**
|
|
189
|
-
* @generated from protobuf field:
|
|
166
|
+
* @generated from protobuf field: bool noCloserNodesFound = 3;
|
|
190
167
|
*/
|
|
191
|
-
noCloserNodesFound
|
|
168
|
+
noCloserNodesFound: boolean;
|
|
192
169
|
/**
|
|
193
170
|
* @generated from protobuf field: repeated dht.PeerDescriptor routingPath = 4;
|
|
194
171
|
*/
|
|
@@ -226,9 +203,9 @@ export interface LeaveNotice {
|
|
|
226
203
|
*/
|
|
227
204
|
export interface PeerDescriptor {
|
|
228
205
|
/**
|
|
229
|
-
* @generated from protobuf field: bytes
|
|
206
|
+
* @generated from protobuf field: bytes nodeId = 1;
|
|
230
207
|
*/
|
|
231
|
-
|
|
208
|
+
nodeId: Uint8Array;
|
|
232
209
|
/**
|
|
233
210
|
* @generated from protobuf field: dht.NodeType type = 2;
|
|
234
211
|
*/
|
|
@@ -305,9 +282,9 @@ export interface RouteMessageAck {
|
|
|
305
282
|
*/
|
|
306
283
|
requestId: string;
|
|
307
284
|
/**
|
|
308
|
-
* @generated from protobuf field:
|
|
285
|
+
* @generated from protobuf field: optional dht.RouteMessageError error = 2;
|
|
309
286
|
*/
|
|
310
|
-
error
|
|
287
|
+
error?: RouteMessageError;
|
|
311
288
|
}
|
|
312
289
|
// Correspond to the MessageType Enum
|
|
313
290
|
|
|
@@ -536,10 +513,6 @@ export interface LockResponse {
|
|
|
536
513
|
* @generated from protobuf field: bool accepted = 1;
|
|
537
514
|
*/
|
|
538
515
|
accepted: boolean;
|
|
539
|
-
/**
|
|
540
|
-
* @generated from protobuf field: optional bool reason = 2;
|
|
541
|
-
*/
|
|
542
|
-
reason?: boolean;
|
|
543
516
|
}
|
|
544
517
|
/**
|
|
545
518
|
* @generated from protobuf message dht.DisconnectNotice
|
|
@@ -560,22 +533,35 @@ export interface DisconnectNoticeResponse {
|
|
|
560
533
|
*/
|
|
561
534
|
export interface ExternalFindDataRequest {
|
|
562
535
|
/**
|
|
563
|
-
* @generated from protobuf field: bytes
|
|
536
|
+
* @generated from protobuf field: bytes key = 1;
|
|
564
537
|
*/
|
|
565
|
-
|
|
538
|
+
key: Uint8Array;
|
|
566
539
|
}
|
|
567
540
|
/**
|
|
568
541
|
* @generated from protobuf message dht.ExternalFindDataResponse
|
|
569
542
|
*/
|
|
570
543
|
export interface ExternalFindDataResponse {
|
|
571
544
|
/**
|
|
572
|
-
* @generated from protobuf field: repeated dht.DataEntry
|
|
545
|
+
* @generated from protobuf field: repeated dht.DataEntry entries = 1;
|
|
573
546
|
*/
|
|
574
|
-
|
|
547
|
+
entries: DataEntry[];
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* @generated from protobuf enum dht.FindAction
|
|
551
|
+
*/
|
|
552
|
+
export enum FindAction {
|
|
553
|
+
/**
|
|
554
|
+
* @generated from protobuf enum value: NODE = 0;
|
|
555
|
+
*/
|
|
556
|
+
NODE = 0,
|
|
557
|
+
/**
|
|
558
|
+
* @generated from protobuf enum value: FETCH_DATA = 1;
|
|
559
|
+
*/
|
|
560
|
+
FETCH_DATA = 1,
|
|
575
561
|
/**
|
|
576
|
-
* @generated from protobuf
|
|
562
|
+
* @generated from protobuf enum value: DELETE_DATA = 2;
|
|
577
563
|
*/
|
|
578
|
-
|
|
564
|
+
DELETE_DATA = 2
|
|
579
565
|
}
|
|
580
566
|
/**
|
|
581
567
|
* @generated from protobuf enum dht.NodeType
|
|
@@ -615,6 +601,26 @@ export enum RpcResponseError {
|
|
|
615
601
|
*/
|
|
616
602
|
UNKNOWN_RPC_METHOD = 3
|
|
617
603
|
}
|
|
604
|
+
/**
|
|
605
|
+
* @generated from protobuf enum dht.RouteMessageError
|
|
606
|
+
*/
|
|
607
|
+
export enum RouteMessageError {
|
|
608
|
+
/**
|
|
609
|
+
* @generated from protobuf enum value: NO_TARGETS = 0;
|
|
610
|
+
*/
|
|
611
|
+
NO_TARGETS = 0,
|
|
612
|
+
/**
|
|
613
|
+
* @generated from protobuf enum value: DUPLICATE = 1;
|
|
614
|
+
*/
|
|
615
|
+
DUPLICATE = 1,
|
|
616
|
+
/**
|
|
617
|
+
* TODO: can this be removed? If DhtNode is already stopped the server side requests
|
|
618
|
+
* should not be processed
|
|
619
|
+
*
|
|
620
|
+
* @generated from protobuf enum value: STOPPED = 2;
|
|
621
|
+
*/
|
|
622
|
+
STOPPED = 2
|
|
623
|
+
}
|
|
618
624
|
/**
|
|
619
625
|
* @generated from protobuf enum dht.HandshakeError
|
|
620
626
|
*/
|
|
@@ -676,10 +682,11 @@ export enum DisconnectMode {
|
|
|
676
682
|
class StoreDataRequest$Type extends MessageType$<StoreDataRequest> {
|
|
677
683
|
constructor() {
|
|
678
684
|
super("dht.StoreDataRequest", [
|
|
679
|
-
{ no: 1, name: "
|
|
685
|
+
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
680
686
|
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
681
|
-
{ no: 3, name: "
|
|
682
|
-
{ no: 4, name: "
|
|
687
|
+
{ no: 3, name: "creator", kind: "message", T: () => PeerDescriptor },
|
|
688
|
+
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
689
|
+
{ no: 5, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
|
683
690
|
]);
|
|
684
691
|
}
|
|
685
692
|
}
|
|
@@ -725,65 +732,29 @@ class ExternalStoreDataResponse$Type extends MessageType$<ExternalStoreDataRespo
|
|
|
725
732
|
*/
|
|
726
733
|
export const ExternalStoreDataResponse = new ExternalStoreDataResponse$Type();
|
|
727
734
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
728
|
-
class
|
|
735
|
+
class ReplicateDataRequest$Type extends MessageType$<ReplicateDataRequest> {
|
|
729
736
|
constructor() {
|
|
730
|
-
super("dht.
|
|
731
|
-
{ no: 1, name: "
|
|
737
|
+
super("dht.ReplicateDataRequest", [
|
|
738
|
+
{ no: 1, name: "entry", kind: "message", T: () => DataEntry }
|
|
732
739
|
]);
|
|
733
740
|
}
|
|
734
741
|
}
|
|
735
742
|
/**
|
|
736
|
-
* @generated MessageType for protobuf message dht.
|
|
743
|
+
* @generated MessageType for protobuf message dht.ReplicateDataRequest
|
|
737
744
|
*/
|
|
738
|
-
export const
|
|
739
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
740
|
-
class MigrateDataResponse$Type extends MessageType$<MigrateDataResponse> {
|
|
741
|
-
constructor() {
|
|
742
|
-
super("dht.MigrateDataResponse", [
|
|
743
|
-
{ no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
744
|
-
]);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* @generated MessageType for protobuf message dht.MigrateDataResponse
|
|
749
|
-
*/
|
|
750
|
-
export const MigrateDataResponse = new MigrateDataResponse$Type();
|
|
751
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
752
|
-
class DeleteDataRequest$Type extends MessageType$<DeleteDataRequest> {
|
|
753
|
-
constructor() {
|
|
754
|
-
super("dht.DeleteDataRequest", [
|
|
755
|
-
{ no: 1, name: "kademliaId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
756
|
-
]);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* @generated MessageType for protobuf message dht.DeleteDataRequest
|
|
761
|
-
*/
|
|
762
|
-
export const DeleteDataRequest = new DeleteDataRequest$Type();
|
|
763
|
-
// @generated message type with reflection information, may provide speed optimized methods
|
|
764
|
-
class DeleteDataResponse$Type extends MessageType$<DeleteDataResponse> {
|
|
765
|
-
constructor() {
|
|
766
|
-
super("dht.DeleteDataResponse", [
|
|
767
|
-
{ no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
768
|
-
]);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* @generated MessageType for protobuf message dht.DeleteDataResponse
|
|
773
|
-
*/
|
|
774
|
-
export const DeleteDataResponse = new DeleteDataResponse$Type();
|
|
745
|
+
export const ReplicateDataRequest = new ReplicateDataRequest$Type();
|
|
775
746
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
776
747
|
class DataEntry$Type extends MessageType$<DataEntry> {
|
|
777
748
|
constructor() {
|
|
778
749
|
super("dht.DataEntry", [
|
|
779
|
-
{ no: 1, name: "
|
|
780
|
-
{ no: 2, name: "
|
|
781
|
-
{ no: 3, name: "
|
|
782
|
-
{ no: 4, name: "
|
|
783
|
-
{ no: 5, name: "
|
|
784
|
-
{ no: 6, name: "
|
|
785
|
-
{ no: 7, name: "
|
|
786
|
-
{ no: 8, name: "
|
|
750
|
+
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
751
|
+
{ no: 2, name: "data", kind: "message", T: () => Any },
|
|
752
|
+
{ no: 3, name: "creator", kind: "message", T: () => PeerDescriptor },
|
|
753
|
+
{ no: 4, name: "createdAt", kind: "message", T: () => Timestamp },
|
|
754
|
+
{ no: 5, name: "storedAt", kind: "message", T: () => Timestamp },
|
|
755
|
+
{ no: 6, name: "ttl", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
|
|
756
|
+
{ no: 7, name: "stale", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
757
|
+
{ no: 8, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
787
758
|
]);
|
|
788
759
|
}
|
|
789
760
|
}
|
|
@@ -795,7 +766,7 @@ export const DataEntry = new DataEntry$Type();
|
|
|
795
766
|
class ClosestPeersRequest$Type extends MessageType$<ClosestPeersRequest> {
|
|
796
767
|
constructor() {
|
|
797
768
|
super("dht.ClosestPeersRequest", [
|
|
798
|
-
{ no: 1, name: "
|
|
769
|
+
{ no: 1, name: "nodeId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
799
770
|
{ no: 2, name: "requestId", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
800
771
|
]);
|
|
801
772
|
}
|
|
@@ -822,7 +793,7 @@ class FindRequest$Type extends MessageType$<FindRequest> {
|
|
|
822
793
|
constructor() {
|
|
823
794
|
super("dht.FindRequest", [
|
|
824
795
|
{ no: 1, name: "sessionId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
825
|
-
{ no: 2, name: "
|
|
796
|
+
{ no: 2, name: "action", kind: "enum", T: () => ["dht.FindAction", FindAction] }
|
|
826
797
|
]);
|
|
827
798
|
}
|
|
828
799
|
}
|
|
@@ -836,7 +807,7 @@ class FindResponse$Type extends MessageType$<FindResponse> {
|
|
|
836
807
|
super("dht.FindResponse", [
|
|
837
808
|
{ no: 1, name: "closestConnectedPeers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor },
|
|
838
809
|
{ no: 2, name: "dataEntries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataEntry },
|
|
839
|
-
{ no: 3, name: "noCloserNodesFound", kind: "scalar",
|
|
810
|
+
{ no: 3, name: "noCloserNodesFound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
840
811
|
{ no: 4, name: "routingPath", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PeerDescriptor }
|
|
841
812
|
]);
|
|
842
813
|
}
|
|
@@ -885,7 +856,7 @@ export const LeaveNotice = new LeaveNotice$Type();
|
|
|
885
856
|
class PeerDescriptor$Type extends MessageType$<PeerDescriptor> {
|
|
886
857
|
constructor() {
|
|
887
858
|
super("dht.PeerDescriptor", [
|
|
888
|
-
{ no: 1, name: "
|
|
859
|
+
{ no: 1, name: "nodeId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
|
|
889
860
|
{ no: 2, name: "type", kind: "enum", T: () => ["dht.NodeType", NodeType] },
|
|
890
861
|
{ no: 3, name: "udp", kind: "message", T: () => ConnectivityMethod },
|
|
891
862
|
{ no: 4, name: "tcp", kind: "message", T: () => ConnectivityMethod },
|
|
@@ -934,7 +905,7 @@ class RouteMessageAck$Type extends MessageType$<RouteMessageAck> {
|
|
|
934
905
|
constructor() {
|
|
935
906
|
super("dht.RouteMessageAck", [
|
|
936
907
|
{ no: 1, name: "requestId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
937
|
-
{ no: 2, name: "error", kind: "
|
|
908
|
+
{ no: 2, name: "error", kind: "enum", opt: true, T: () => ["dht.RouteMessageError", RouteMessageError] }
|
|
938
909
|
]);
|
|
939
910
|
}
|
|
940
911
|
}
|
|
@@ -1119,8 +1090,7 @@ export const UnlockRequest = new UnlockRequest$Type();
|
|
|
1119
1090
|
class LockResponse$Type extends MessageType$<LockResponse> {
|
|
1120
1091
|
constructor() {
|
|
1121
1092
|
super("dht.LockResponse", [
|
|
1122
|
-
{ no: 1, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
1123
|
-
{ no: 2, name: "reason", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
|
|
1093
|
+
{ no: 1, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
1124
1094
|
]);
|
|
1125
1095
|
}
|
|
1126
1096
|
}
|
|
@@ -1154,7 +1124,7 @@ export const DisconnectNoticeResponse = new DisconnectNoticeResponse$Type();
|
|
|
1154
1124
|
class ExternalFindDataRequest$Type extends MessageType$<ExternalFindDataRequest> {
|
|
1155
1125
|
constructor() {
|
|
1156
1126
|
super("dht.ExternalFindDataRequest", [
|
|
1157
|
-
{ no: 1, name: "
|
|
1127
|
+
{ no: 1, name: "key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
1158
1128
|
]);
|
|
1159
1129
|
}
|
|
1160
1130
|
}
|
|
@@ -1166,8 +1136,7 @@ export const ExternalFindDataRequest = new ExternalFindDataRequest$Type();
|
|
|
1166
1136
|
class ExternalFindDataResponse$Type extends MessageType$<ExternalFindDataResponse> {
|
|
1167
1137
|
constructor() {
|
|
1168
1138
|
super("dht.ExternalFindDataResponse", [
|
|
1169
|
-
{ no: 1, name: "
|
|
1170
|
-
{ no: 2, name: "error", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
1139
|
+
{ no: 1, name: "entries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataEntry }
|
|
1171
1140
|
]);
|
|
1172
1141
|
}
|
|
1173
1142
|
}
|
|
@@ -1201,8 +1170,7 @@ export const FindRpc = new ServiceType("dht.FindRpc", [
|
|
|
1201
1170
|
*/
|
|
1202
1171
|
export const StoreRpc = new ServiceType("dht.StoreRpc", [
|
|
1203
1172
|
{ name: "storeData", options: {}, I: StoreDataRequest, O: StoreDataResponse },
|
|
1204
|
-
{ name: "
|
|
1205
|
-
{ name: "deleteData", options: {}, I: DeleteDataRequest, O: DeleteDataResponse }
|
|
1173
|
+
{ name: "replicateData", options: {}, I: ReplicateDataRequest, O: Empty }
|
|
1206
1174
|
]);
|
|
1207
1175
|
/**
|
|
1208
1176
|
* @generated ServiceType for protobuf service dht.FindSessionRpc
|
|
@@ -11,7 +11,7 @@ import { Layer1Node } from '../../src/logic/Layer1Node'
|
|
|
11
11
|
describe('random graph with real connections', () => {
|
|
12
12
|
|
|
13
13
|
const epPeerDescriptor: PeerDescriptor = {
|
|
14
|
-
|
|
14
|
+
nodeId: Uint8Array.from([1, 2, 3]),
|
|
15
15
|
type: NodeType.NODEJS,
|
|
16
16
|
websocket: { host: '127.0.0.1', port: 12221, tls: false }
|
|
17
17
|
}
|
|
@@ -26,11 +26,11 @@ describe('DeliveryRpcRemote', () => {
|
|
|
26
26
|
let rpcRemote: DeliveryRpcRemote
|
|
27
27
|
|
|
28
28
|
const clientNode: PeerDescriptor = {
|
|
29
|
-
|
|
29
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
30
30
|
type: NodeType.NODEJS
|
|
31
31
|
}
|
|
32
32
|
const serverNode: PeerDescriptor = {
|
|
33
|
-
|
|
33
|
+
nodeId: new Uint8Array([2, 2, 2]),
|
|
34
34
|
type: NodeType.NODEJS
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -21,11 +21,11 @@ describe('HandshakeRpcRemote', () => {
|
|
|
21
21
|
let rpcRemote: HandshakeRpcRemote
|
|
22
22
|
|
|
23
23
|
const clientNode: PeerDescriptor = {
|
|
24
|
-
|
|
24
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
25
25
|
type: NodeType.NODEJS
|
|
26
26
|
}
|
|
27
27
|
const serverNode: PeerDescriptor = {
|
|
28
|
-
|
|
28
|
+
nodeId: new Uint8Array([2, 2, 2]),
|
|
29
29
|
type: NodeType.NODEJS
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -20,15 +20,15 @@ import { StreamPartIDUtils } from '@streamr/protocol'
|
|
|
20
20
|
describe('Handshakes', () => {
|
|
21
21
|
|
|
22
22
|
const peerDescriptor1: PeerDescriptor = {
|
|
23
|
-
|
|
23
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
24
24
|
type: NodeType.NODEJS
|
|
25
25
|
}
|
|
26
26
|
const peerDescriptor2: PeerDescriptor = {
|
|
27
|
-
|
|
27
|
+
nodeId: new Uint8Array([2, 1, 1]),
|
|
28
28
|
type: NodeType.NODEJS
|
|
29
29
|
}
|
|
30
30
|
const peerDescriptor3: PeerDescriptor = {
|
|
31
|
-
|
|
31
|
+
nodeId: new Uint8Array([3, 1, 1]),
|
|
32
32
|
type: NodeType.NODEJS
|
|
33
33
|
}
|
|
34
34
|
let rpcCommunicator1: ListeningRpcCommunicator
|
|
@@ -19,11 +19,11 @@ describe('NeighborUpdateRpcRemote', () => {
|
|
|
19
19
|
let rpcRemote: NeighborUpdateRpcRemote
|
|
20
20
|
|
|
21
21
|
const clientNode: PeerDescriptor = {
|
|
22
|
-
|
|
22
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
23
23
|
type: NodeType.NODEJS
|
|
24
24
|
}
|
|
25
25
|
const serverNode: PeerDescriptor = {
|
|
26
|
-
|
|
26
|
+
nodeId: new Uint8Array([2, 2, 2]),
|
|
27
27
|
type: NodeType.NODEJS
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -47,7 +47,7 @@ describe('NeighborUpdateRpcRemote', () => {
|
|
|
47
47
|
'neighborUpdate',
|
|
48
48
|
async (): Promise<NeighborUpdate> => {
|
|
49
49
|
const node: PeerDescriptor = {
|
|
50
|
-
|
|
50
|
+
nodeId: new Uint8Array([4, 2, 4]),
|
|
51
51
|
type: NodeType.NODEJS
|
|
52
52
|
}
|
|
53
53
|
const update: NeighborUpdate = {
|
|
@@ -20,12 +20,12 @@ describe('NetworkNode', () => {
|
|
|
20
20
|
let node2: NetworkNode
|
|
21
21
|
|
|
22
22
|
const pd1: PeerDescriptor = {
|
|
23
|
-
|
|
23
|
+
nodeId: new Uint8Array([1, 2, 3]),
|
|
24
24
|
type: NodeType.NODEJS
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const pd2: PeerDescriptor = {
|
|
28
|
-
|
|
28
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
29
29
|
type: NodeType.NODEJS
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -22,11 +22,11 @@ describe('StreamrNode', () => {
|
|
|
22
22
|
let node2: StreamrNode
|
|
23
23
|
|
|
24
24
|
const peerDescriptor1: PeerDescriptor = {
|
|
25
|
-
|
|
25
|
+
nodeId: new Uint8Array([1, 2, 3]),
|
|
26
26
|
type: NodeType.NODEJS
|
|
27
27
|
}
|
|
28
28
|
const peerDescriptor2: PeerDescriptor = {
|
|
29
|
-
|
|
29
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
30
30
|
type: NodeType.NODEJS
|
|
31
31
|
}
|
|
32
32
|
const STREAM_PART_ID = StreamPartIDUtils.parse('test#0')
|
|
@@ -12,31 +12,31 @@ const STREAM_PART_ID = StreamPartIDUtils.parse('stream#0')
|
|
|
12
12
|
describe('Joining stream parts on offline nodes', () => {
|
|
13
13
|
|
|
14
14
|
const entryPointPeerDescriptor: PeerDescriptor = {
|
|
15
|
-
|
|
15
|
+
nodeId: new Uint8Array([1, 2, 3]),
|
|
16
16
|
type: NodeType.NODEJS,
|
|
17
17
|
region: getRandomRegion()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const node1PeerDescriptor: PeerDescriptor = {
|
|
21
|
-
|
|
21
|
+
nodeId: new Uint8Array([1, 1, 1]),
|
|
22
22
|
type: NodeType.NODEJS,
|
|
23
23
|
region: getRandomRegion()
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const node2PeerDescriptor: PeerDescriptor = {
|
|
27
|
-
|
|
27
|
+
nodeId: new Uint8Array([2, 2, 2]),
|
|
28
28
|
type: NodeType.NODEJS,
|
|
29
29
|
region: getRandomRegion()
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const offlineDescriptor1: PeerDescriptor = {
|
|
33
|
-
|
|
33
|
+
nodeId: new Uint8Array([3, 3, 3]),
|
|
34
34
|
type: NodeType.NODEJS,
|
|
35
35
|
region: getRandomRegion()
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const offlineDescriptor2: PeerDescriptor = {
|
|
39
|
-
|
|
39
|
+
nodeId: new Uint8Array([4, 4, 4]),
|
|
40
40
|
type: NodeType.NODEJS,
|
|
41
41
|
region: getRandomRegion()
|
|
42
42
|
}
|
|
@@ -20,7 +20,7 @@ describe('stream without default entrypoints', () => {
|
|
|
20
20
|
let nodes: NetworkNode[]
|
|
21
21
|
let numOfReceivedMessages: number
|
|
22
22
|
const entryPointPeerDescriptor: PeerDescriptor = {
|
|
23
|
-
|
|
23
|
+
nodeId: new Uint8Array([1, 2, 3]),
|
|
24
24
|
type: NodeType.NODEJS,
|
|
25
25
|
region: getRandomRegion()
|
|
26
26
|
}
|
|
@@ -20,19 +20,19 @@ describe('EntryPointDiscovery', () => {
|
|
|
20
20
|
const deletedPeerDescriptor = createMockPeerDescriptor()
|
|
21
21
|
|
|
22
22
|
const fakeData: DataEntry = {
|
|
23
|
+
key: Uint8Array.from([1, 2, 3]),
|
|
23
24
|
data: Any.pack(peerDescriptor, PeerDescriptor),
|
|
25
|
+
creator: peerDescriptor,
|
|
24
26
|
ttl: 1000,
|
|
25
|
-
storer: peerDescriptor,
|
|
26
|
-
kademliaId: Uint8Array.from([1, 2, 3]),
|
|
27
27
|
stale: false,
|
|
28
28
|
deleted: false
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const fakeDeletedData: DataEntry = {
|
|
32
|
+
key: Uint8Array.from([1, 2, 3]),
|
|
32
33
|
data: Any.pack(deletedPeerDescriptor, PeerDescriptor),
|
|
34
|
+
creator: deletedPeerDescriptor,
|
|
33
35
|
ttl: 1000,
|
|
34
|
-
storer: deletedPeerDescriptor,
|
|
35
|
-
kademliaId: Uint8Array.from([1, 2, 3]),
|
|
36
36
|
stale: false,
|
|
37
37
|
deleted: true
|
|
38
38
|
}
|
|
@@ -88,7 +88,7 @@ describe('HandshakeRpcLocal', () => {
|
|
|
88
88
|
const req: InterleaveNotice = {
|
|
89
89
|
streamPartId: STREAM_PART_ID,
|
|
90
90
|
interleaveTargetDescriptor: {
|
|
91
|
-
|
|
91
|
+
nodeId: hexToBinary('0x2222'),
|
|
92
92
|
type: NodeType.NODEJS
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -103,7 +103,7 @@ describe('HandshakeRpcLocal', () => {
|
|
|
103
103
|
const req: InterleaveNotice = {
|
|
104
104
|
streamPartId: StreamPartIDUtils.parse('other-stream#0'),
|
|
105
105
|
interleaveTargetDescriptor: {
|
|
106
|
-
|
|
106
|
+
nodeId: hexToBinary('0x2222'),
|
|
107
107
|
type: NodeType.NODEJS
|
|
108
108
|
}
|
|
109
109
|
}
|