@waku/core 0.0.5 → 0.0.7
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/CHANGELOG.md +51 -3
- package/bundle/index.js +31146 -26342
- package/bundle/lib/message/topic_only_message.js +33 -0
- package/bundle/lib/message/version_0.js +133 -0
- package/bundle/lib/predefined_bootstrap_nodes.js +24 -4
- package/bundle/{message-049c8b67.js → peer_exchange-53df2b11.js} +3579 -1007
- package/dist/index.d.ts +14 -13
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/{waku_filter → filter}/filter_rpc.d.ts +1 -1
- package/dist/lib/{waku_filter → filter}/filter_rpc.js +1 -1
- package/dist/lib/filter/filter_rpc.js.map +1 -0
- package/dist/lib/filter/index.d.ts +25 -0
- package/dist/lib/{waku_filter → filter}/index.js +14 -9
- package/dist/lib/filter/index.js.map +1 -0
- package/dist/lib/light_push/index.d.ts +22 -0
- package/dist/lib/{waku_light_push → light_push}/index.js +14 -9
- package/dist/lib/light_push/index.js.map +1 -0
- package/dist/lib/{waku_light_push → light_push}/push_rpc.d.ts +1 -1
- package/dist/lib/{waku_light_push → light_push}/push_rpc.js +1 -1
- package/dist/lib/light_push/push_rpc.js.map +1 -0
- package/dist/lib/message/topic_only_message.d.ts +16 -0
- package/dist/lib/{waku_message → message}/topic_only_message.js +2 -1
- package/dist/lib/message/topic_only_message.js.map +1 -0
- package/dist/lib/message/version_0.d.ts +54 -0
- package/dist/lib/{waku_message → message}/version_0.js +41 -6
- package/dist/lib/message/version_0.js.map +1 -0
- package/dist/lib/predefined_bootstrap_nodes.d.ts +1 -2
- package/dist/lib/predefined_bootstrap_nodes.js +0 -2
- package/dist/lib/predefined_bootstrap_nodes.js.map +1 -1
- package/dist/lib/{waku_relay → relay}/constants.d.ts +0 -0
- package/dist/lib/{waku_relay → relay}/constants.js +0 -0
- package/dist/lib/relay/constants.js.map +1 -0
- package/dist/lib/relay/index.d.ts +24 -0
- package/dist/lib/{waku_relay → relay}/index.js +9 -6
- package/dist/lib/relay/index.js.map +1 -0
- package/dist/lib/{waku_store → store}/history_rpc.d.ts +1 -1
- package/dist/lib/{waku_store → store}/history_rpc.js +1 -1
- package/dist/lib/store/history_rpc.js.map +1 -0
- package/dist/lib/store/index.d.ts +68 -0
- package/dist/lib/{waku_store → store}/index.js +41 -16
- package/dist/lib/store/index.js.map +1 -0
- package/dist/lib/to_proto_message.d.ts +3 -3
- package/dist/lib/to_proto_message.js +1 -0
- package/dist/lib/to_proto_message.js.map +1 -1
- package/dist/lib/wait_for_remote_peer.js +14 -5
- package/dist/lib/wait_for_remote_peer.js.map +1 -1
- package/dist/lib/waku.d.ts +17 -15
- package/dist/lib/waku.js +49 -41
- package/dist/lib/waku.js.map +1 -1
- package/package.json +28 -31
- package/src/index.ts +25 -14
- package/src/lib/{waku_filter → filter}/filter_rpc.ts +1 -2
- package/src/lib/{waku_filter → filter}/index.ts +51 -30
- package/src/lib/{waku_light_push → light_push}/index.ts +38 -19
- package/src/lib/{waku_light_push → light_push}/push_rpc.ts +1 -2
- package/src/lib/{waku_message → message}/topic_only_message.ts +12 -7
- package/src/lib/{waku_message → message}/version_0.ts +59 -18
- package/src/lib/predefined_bootstrap_nodes.ts +2 -6
- package/src/lib/{waku_relay → relay}/constants.ts +0 -0
- package/src/lib/{waku_relay → relay}/index.ts +30 -26
- package/src/lib/{waku_store → store}/history_rpc.ts +1 -2
- package/src/lib/{waku_store → store}/index.ts +93 -28
- package/src/lib/to_proto_message.ts +5 -5
- package/src/lib/wait_for_remote_peer.ts +19 -7
- package/src/lib/waku.ts +78 -51
- package/bundle/browser-1e1a2f27.js +0 -722
- package/bundle/events-158407bb.js +0 -1929
- package/bundle/index-64ce43f0.js +0 -69
- package/bundle/index-8710041d.js +0 -2962
- package/bundle/index-a67d7136.js +0 -4059
- package/bundle/lib/peer_discovery_static_list.js +0 -89
- package/bundle/lib/wait_for_remote_peer.js +0 -326
- package/bundle/lib/waku_message/topic_only_message.js +0 -3
- package/bundle/lib/waku_message/version_0.js +0 -317
- package/bundle/random_subset-75d1c511.js +0 -26
- package/bundle/topic_only_message-5ad3a869.js +0 -82
- package/dist/lib/multiaddr_to_peer_info.d.ts +0 -3
- package/dist/lib/multiaddr_to_peer_info.js +0 -15
- package/dist/lib/multiaddr_to_peer_info.js.map +0 -1
- package/dist/lib/peer_discovery_static_list.d.ts +0 -44
- package/dist/lib/peer_discovery_static_list.js +0 -72
- package/dist/lib/peer_discovery_static_list.js.map +0 -1
- package/dist/lib/select_connection.d.ts +0 -2
- package/dist/lib/select_connection.js +0 -19
- package/dist/lib/select_connection.js.map +0 -1
- package/dist/lib/select_peer.d.ts +0 -15
- package/dist/lib/select_peer.js +0 -59
- package/dist/lib/select_peer.js.map +0 -1
- package/dist/lib/waku_filter/filter_rpc.js.map +0 -1
- package/dist/lib/waku_filter/index.d.ts +0 -50
- package/dist/lib/waku_filter/index.js.map +0 -1
- package/dist/lib/waku_light_push/index.d.ts +0 -38
- package/dist/lib/waku_light_push/index.js.map +0 -1
- package/dist/lib/waku_light_push/push_rpc.js.map +0 -1
- package/dist/lib/waku_message/topic_only_message.d.ts +0 -15
- package/dist/lib/waku_message/topic_only_message.js.map +0 -1
- package/dist/lib/waku_message/version_0.d.ts +0 -27
- package/dist/lib/waku_message/version_0.js.map +0 -1
- package/dist/lib/waku_relay/constants.js.map +0 -1
- package/dist/lib/waku_relay/index.d.ts +0 -66
- package/dist/lib/waku_relay/index.js.map +0 -1
- package/dist/lib/waku_store/history_rpc.js.map +0 -1
- package/dist/lib/waku_store/index.d.ts +0 -126
- package/dist/lib/waku_store/index.js.map +0 -1
- package/dist/proto/filter.d.ts +0 -65
- package/dist/proto/filter.js +0 -425
- package/dist/proto/filter.js.map +0 -1
- package/dist/proto/light_push.d.ts +0 -57
- package/dist/proto/light_push.js +0 -369
- package/dist/proto/light_push.js.map +0 -1
- package/dist/proto/message.d.ts +0 -29
- package/dist/proto/message.js +0 -215
- package/dist/proto/message.js.map +0 -1
- package/dist/proto/store.d.ts +0 -104
- package/dist/proto/store.js +0 -602
- package/dist/proto/store.js.map +0 -1
- package/dist/proto/topic_only_message.d.ts +0 -10
- package/dist/proto/topic_only_message.js +0 -46
- package/dist/proto/topic_only_message.js.map +0 -1
- package/src/lib/multiaddr_to_peer_info.ts +0 -17
- package/src/lib/peer_discovery_static_list.ts +0 -118
- package/src/lib/select_connection.ts +0 -24
- package/src/lib/select_peer.ts +0 -77
- package/src/proto/filter.ts +0 -602
- package/src/proto/light_push.ts +0 -526
- package/src/proto/message.ts +0 -304
- package/src/proto/store.ts +0 -844
- package/src/proto/topic_only_message.ts +0 -67
@@ -1,317 +0,0 @@
|
|
1
|
-
import { d as debug } from '../../browser-1e1a2f27.js';
|
2
|
-
import { m as message$1, j as encodeMessage, k as decodeMessage } from '../../message-049c8b67.js';
|
3
|
-
|
4
|
-
/* eslint-disable import/export */
|
5
|
-
var RateLimitProof;
|
6
|
-
(function (RateLimitProof) {
|
7
|
-
let _codec;
|
8
|
-
RateLimitProof.codec = () => {
|
9
|
-
if (_codec == null) {
|
10
|
-
_codec = message$1((obj, writer, opts = {}) => {
|
11
|
-
if (opts.lengthDelimited !== false) {
|
12
|
-
writer.fork();
|
13
|
-
}
|
14
|
-
if (obj.proof != null) {
|
15
|
-
writer.uint32(10);
|
16
|
-
writer.bytes(obj.proof);
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
throw new Error('Protocol error: required field "proof" was not found in object');
|
20
|
-
}
|
21
|
-
if (obj.merkleRoot != null) {
|
22
|
-
writer.uint32(18);
|
23
|
-
writer.bytes(obj.merkleRoot);
|
24
|
-
}
|
25
|
-
else {
|
26
|
-
throw new Error('Protocol error: required field "merkleRoot" was not found in object');
|
27
|
-
}
|
28
|
-
if (obj.epoch != null) {
|
29
|
-
writer.uint32(26);
|
30
|
-
writer.bytes(obj.epoch);
|
31
|
-
}
|
32
|
-
else {
|
33
|
-
throw new Error('Protocol error: required field "epoch" was not found in object');
|
34
|
-
}
|
35
|
-
if (obj.shareX != null) {
|
36
|
-
writer.uint32(34);
|
37
|
-
writer.bytes(obj.shareX);
|
38
|
-
}
|
39
|
-
else {
|
40
|
-
throw new Error('Protocol error: required field "shareX" was not found in object');
|
41
|
-
}
|
42
|
-
if (obj.shareY != null) {
|
43
|
-
writer.uint32(42);
|
44
|
-
writer.bytes(obj.shareY);
|
45
|
-
}
|
46
|
-
else {
|
47
|
-
throw new Error('Protocol error: required field "shareY" was not found in object');
|
48
|
-
}
|
49
|
-
if (obj.nullifier != null) {
|
50
|
-
writer.uint32(50);
|
51
|
-
writer.bytes(obj.nullifier);
|
52
|
-
}
|
53
|
-
else {
|
54
|
-
throw new Error('Protocol error: required field "nullifier" was not found in object');
|
55
|
-
}
|
56
|
-
if (obj.rlnIdentifier != null) {
|
57
|
-
writer.uint32(58);
|
58
|
-
writer.bytes(obj.rlnIdentifier);
|
59
|
-
}
|
60
|
-
else {
|
61
|
-
throw new Error('Protocol error: required field "rlnIdentifier" was not found in object');
|
62
|
-
}
|
63
|
-
if (opts.lengthDelimited !== false) {
|
64
|
-
writer.ldelim();
|
65
|
-
}
|
66
|
-
}, (reader, length) => {
|
67
|
-
const obj = {
|
68
|
-
proof: new Uint8Array(0),
|
69
|
-
merkleRoot: new Uint8Array(0),
|
70
|
-
epoch: new Uint8Array(0),
|
71
|
-
shareX: new Uint8Array(0),
|
72
|
-
shareY: new Uint8Array(0),
|
73
|
-
nullifier: new Uint8Array(0),
|
74
|
-
rlnIdentifier: new Uint8Array(0),
|
75
|
-
};
|
76
|
-
const end = length == null ? reader.len : reader.pos + length;
|
77
|
-
while (reader.pos < end) {
|
78
|
-
const tag = reader.uint32();
|
79
|
-
switch (tag >>> 3) {
|
80
|
-
case 1:
|
81
|
-
obj.proof = reader.bytes();
|
82
|
-
break;
|
83
|
-
case 2:
|
84
|
-
obj.merkleRoot = reader.bytes();
|
85
|
-
break;
|
86
|
-
case 3:
|
87
|
-
obj.epoch = reader.bytes();
|
88
|
-
break;
|
89
|
-
case 4:
|
90
|
-
obj.shareX = reader.bytes();
|
91
|
-
break;
|
92
|
-
case 5:
|
93
|
-
obj.shareY = reader.bytes();
|
94
|
-
break;
|
95
|
-
case 6:
|
96
|
-
obj.nullifier = reader.bytes();
|
97
|
-
break;
|
98
|
-
case 7:
|
99
|
-
obj.rlnIdentifier = reader.bytes();
|
100
|
-
break;
|
101
|
-
default:
|
102
|
-
reader.skipType(tag & 7);
|
103
|
-
break;
|
104
|
-
}
|
105
|
-
}
|
106
|
-
if (obj.proof == null) {
|
107
|
-
throw new Error('Protocol error: value for required field "proof" was not found in protobuf');
|
108
|
-
}
|
109
|
-
if (obj.merkleRoot == null) {
|
110
|
-
throw new Error('Protocol error: value for required field "merkleRoot" was not found in protobuf');
|
111
|
-
}
|
112
|
-
if (obj.epoch == null) {
|
113
|
-
throw new Error('Protocol error: value for required field "epoch" was not found in protobuf');
|
114
|
-
}
|
115
|
-
if (obj.shareX == null) {
|
116
|
-
throw new Error('Protocol error: value for required field "shareX" was not found in protobuf');
|
117
|
-
}
|
118
|
-
if (obj.shareY == null) {
|
119
|
-
throw new Error('Protocol error: value for required field "shareY" was not found in protobuf');
|
120
|
-
}
|
121
|
-
if (obj.nullifier == null) {
|
122
|
-
throw new Error('Protocol error: value for required field "nullifier" was not found in protobuf');
|
123
|
-
}
|
124
|
-
if (obj.rlnIdentifier == null) {
|
125
|
-
throw new Error('Protocol error: value for required field "rlnIdentifier" was not found in protobuf');
|
126
|
-
}
|
127
|
-
return obj;
|
128
|
-
});
|
129
|
-
}
|
130
|
-
return _codec;
|
131
|
-
};
|
132
|
-
RateLimitProof.encode = (obj) => {
|
133
|
-
return encodeMessage(obj, RateLimitProof.codec());
|
134
|
-
};
|
135
|
-
RateLimitProof.decode = (buf) => {
|
136
|
-
return decodeMessage(buf, RateLimitProof.codec());
|
137
|
-
};
|
138
|
-
})(RateLimitProof || (RateLimitProof = {}));
|
139
|
-
var WakuMessage;
|
140
|
-
(function (WakuMessage) {
|
141
|
-
let _codec;
|
142
|
-
WakuMessage.codec = () => {
|
143
|
-
if (_codec == null) {
|
144
|
-
_codec = message$1((obj, writer, opts = {}) => {
|
145
|
-
if (opts.lengthDelimited !== false) {
|
146
|
-
writer.fork();
|
147
|
-
}
|
148
|
-
if (obj.payload != null) {
|
149
|
-
writer.uint32(10);
|
150
|
-
writer.bytes(obj.payload);
|
151
|
-
}
|
152
|
-
if (obj.contentTopic != null) {
|
153
|
-
writer.uint32(18);
|
154
|
-
writer.string(obj.contentTopic);
|
155
|
-
}
|
156
|
-
if (obj.version != null) {
|
157
|
-
writer.uint32(24);
|
158
|
-
writer.uint32(obj.version);
|
159
|
-
}
|
160
|
-
if (obj.timestampDeprecated != null) {
|
161
|
-
writer.uint32(33);
|
162
|
-
writer.double(obj.timestampDeprecated);
|
163
|
-
}
|
164
|
-
if (obj.timestamp != null) {
|
165
|
-
writer.uint32(80);
|
166
|
-
writer.sint64(obj.timestamp);
|
167
|
-
}
|
168
|
-
if (obj.rateLimitProof != null) {
|
169
|
-
writer.uint32(170);
|
170
|
-
RateLimitProof.codec().encode(obj.rateLimitProof, writer);
|
171
|
-
}
|
172
|
-
if (opts.lengthDelimited !== false) {
|
173
|
-
writer.ldelim();
|
174
|
-
}
|
175
|
-
}, (reader, length) => {
|
176
|
-
const obj = {};
|
177
|
-
const end = length == null ? reader.len : reader.pos + length;
|
178
|
-
while (reader.pos < end) {
|
179
|
-
const tag = reader.uint32();
|
180
|
-
switch (tag >>> 3) {
|
181
|
-
case 1:
|
182
|
-
obj.payload = reader.bytes();
|
183
|
-
break;
|
184
|
-
case 2:
|
185
|
-
obj.contentTopic = reader.string();
|
186
|
-
break;
|
187
|
-
case 3:
|
188
|
-
obj.version = reader.uint32();
|
189
|
-
break;
|
190
|
-
case 4:
|
191
|
-
obj.timestampDeprecated = reader.double();
|
192
|
-
break;
|
193
|
-
case 10:
|
194
|
-
obj.timestamp = reader.sint64();
|
195
|
-
break;
|
196
|
-
case 21:
|
197
|
-
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32());
|
198
|
-
break;
|
199
|
-
default:
|
200
|
-
reader.skipType(tag & 7);
|
201
|
-
break;
|
202
|
-
}
|
203
|
-
}
|
204
|
-
return obj;
|
205
|
-
});
|
206
|
-
}
|
207
|
-
return _codec;
|
208
|
-
};
|
209
|
-
WakuMessage.encode = (obj) => {
|
210
|
-
return encodeMessage(obj, WakuMessage.codec());
|
211
|
-
};
|
212
|
-
WakuMessage.decode = (buf) => {
|
213
|
-
return decodeMessage(buf, WakuMessage.codec());
|
214
|
-
};
|
215
|
-
})(WakuMessage || (WakuMessage = {}));
|
216
|
-
|
217
|
-
var message = /*#__PURE__*/Object.freeze({
|
218
|
-
__proto__: null,
|
219
|
-
get RateLimitProof () { return RateLimitProof; },
|
220
|
-
get WakuMessage () { return WakuMessage; }
|
221
|
-
});
|
222
|
-
|
223
|
-
const log = debug("waku:message:version-0");
|
224
|
-
const OneMillion = BigInt(1000000);
|
225
|
-
const Version = 0;
|
226
|
-
class MessageV0 {
|
227
|
-
constructor(proto) {
|
228
|
-
this.proto = proto;
|
229
|
-
}
|
230
|
-
get _rawPayload() {
|
231
|
-
if (this.proto.payload) {
|
232
|
-
return new Uint8Array(this.proto.payload);
|
233
|
-
}
|
234
|
-
return;
|
235
|
-
}
|
236
|
-
get payload() {
|
237
|
-
return this._rawPayload;
|
238
|
-
}
|
239
|
-
get contentTopic() {
|
240
|
-
return this.proto.contentTopic;
|
241
|
-
}
|
242
|
-
get _rawTimestamp() {
|
243
|
-
return this.proto.timestamp;
|
244
|
-
}
|
245
|
-
get timestamp() {
|
246
|
-
// In the case we receive a value that is bigger than JS's max number,
|
247
|
-
// we catch the error and return undefined.
|
248
|
-
try {
|
249
|
-
if (this.proto.timestamp) {
|
250
|
-
// nanoseconds 10^-9 to milliseconds 10^-3
|
251
|
-
const timestamp = this.proto.timestamp / OneMillion;
|
252
|
-
return new Date(Number(timestamp));
|
253
|
-
}
|
254
|
-
if (this.proto.timestampDeprecated) {
|
255
|
-
return new Date(this.proto.timestampDeprecated * 1000);
|
256
|
-
}
|
257
|
-
}
|
258
|
-
catch (e) {
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
return;
|
262
|
-
}
|
263
|
-
get version() {
|
264
|
-
// https://github.com/status-im/js-waku/issues/921
|
265
|
-
return this.proto.version ?? 0;
|
266
|
-
}
|
267
|
-
get rateLimitProof() {
|
268
|
-
return this.proto.rateLimitProof;
|
269
|
-
}
|
270
|
-
}
|
271
|
-
class EncoderV0 {
|
272
|
-
constructor(contentTopic) {
|
273
|
-
this.contentTopic = contentTopic;
|
274
|
-
}
|
275
|
-
async toWire(message$1) {
|
276
|
-
return WakuMessage.encode(await this.toProtoObj(message$1));
|
277
|
-
}
|
278
|
-
async toProtoObj(message) {
|
279
|
-
const timestamp = message.timestamp ?? new Date();
|
280
|
-
return {
|
281
|
-
payload: message.payload,
|
282
|
-
version: Version,
|
283
|
-
contentTopic: this.contentTopic,
|
284
|
-
timestamp: BigInt(timestamp.valueOf()) * OneMillion,
|
285
|
-
rateLimitProof: message.rateLimitProof,
|
286
|
-
};
|
287
|
-
}
|
288
|
-
}
|
289
|
-
class DecoderV0 {
|
290
|
-
constructor(contentTopic) {
|
291
|
-
this.contentTopic = contentTopic;
|
292
|
-
}
|
293
|
-
fromWireToProtoObj(bytes) {
|
294
|
-
const protoMessage = WakuMessage.decode(bytes);
|
295
|
-
log("Message decoded", protoMessage);
|
296
|
-
return Promise.resolve({
|
297
|
-
payload: protoMessage.payload ?? undefined,
|
298
|
-
contentTopic: protoMessage.contentTopic ?? undefined,
|
299
|
-
version: protoMessage.version ?? undefined,
|
300
|
-
timestamp: protoMessage.timestamp ?? undefined,
|
301
|
-
rateLimitProof: protoMessage.rateLimitProof ?? undefined,
|
302
|
-
});
|
303
|
-
}
|
304
|
-
async fromProtoObj(proto) {
|
305
|
-
// https://github.com/status-im/js-waku/issues/921
|
306
|
-
if (proto.version === undefined) {
|
307
|
-
proto.version = 0;
|
308
|
-
}
|
309
|
-
if (proto.version !== Version) {
|
310
|
-
log("Failed to decode due to incorrect version, expected:", Version, ", actual:", proto.version);
|
311
|
-
return Promise.resolve(undefined);
|
312
|
-
}
|
313
|
-
return new MessageV0(proto);
|
314
|
-
}
|
315
|
-
}
|
316
|
-
|
317
|
-
export { DecoderV0, EncoderV0, MessageV0, Version, message as proto };
|
@@ -1,26 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Return pseudo random subset of the input.
|
3
|
-
*/
|
4
|
-
function getPseudoRandomSubset(values, wantedNumber) {
|
5
|
-
if (values.length <= wantedNumber || values.length <= 1) {
|
6
|
-
return values;
|
7
|
-
}
|
8
|
-
return shuffle(values).slice(0, wantedNumber);
|
9
|
-
}
|
10
|
-
function shuffle(arr) {
|
11
|
-
if (arr.length <= 1) {
|
12
|
-
return arr;
|
13
|
-
}
|
14
|
-
const randInt = () => {
|
15
|
-
return Math.floor(Math.random() * Math.floor(arr.length));
|
16
|
-
};
|
17
|
-
for (let i = 0; i < arr.length; i++) {
|
18
|
-
const j = randInt();
|
19
|
-
const tmp = arr[i];
|
20
|
-
arr[i] = arr[j];
|
21
|
-
arr[j] = tmp;
|
22
|
-
}
|
23
|
-
return arr;
|
24
|
-
}
|
25
|
-
|
26
|
-
export { getPseudoRandomSubset as g };
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import { d as debug } from './browser-1e1a2f27.js';
|
2
|
-
import { m as message, j as encodeMessage, k as decodeMessage } from './message-049c8b67.js';
|
3
|
-
|
4
|
-
/* eslint-disable import/export */
|
5
|
-
var TopicOnlyMessage$1;
|
6
|
-
(function (TopicOnlyMessage) {
|
7
|
-
let _codec;
|
8
|
-
TopicOnlyMessage.codec = () => {
|
9
|
-
if (_codec == null) {
|
10
|
-
_codec = message((obj, writer, opts = {}) => {
|
11
|
-
if (opts.lengthDelimited !== false) {
|
12
|
-
writer.fork();
|
13
|
-
}
|
14
|
-
if (obj.contentTopic != null) {
|
15
|
-
writer.uint32(18);
|
16
|
-
writer.string(obj.contentTopic);
|
17
|
-
}
|
18
|
-
if (opts.lengthDelimited !== false) {
|
19
|
-
writer.ldelim();
|
20
|
-
}
|
21
|
-
}, (reader, length) => {
|
22
|
-
const obj = {};
|
23
|
-
const end = length == null ? reader.len : reader.pos + length;
|
24
|
-
while (reader.pos < end) {
|
25
|
-
const tag = reader.uint32();
|
26
|
-
switch (tag >>> 3) {
|
27
|
-
case 2:
|
28
|
-
obj.contentTopic = reader.string();
|
29
|
-
break;
|
30
|
-
default:
|
31
|
-
reader.skipType(tag & 7);
|
32
|
-
break;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
return obj;
|
36
|
-
});
|
37
|
-
}
|
38
|
-
return _codec;
|
39
|
-
};
|
40
|
-
TopicOnlyMessage.encode = (obj) => {
|
41
|
-
return encodeMessage(obj, TopicOnlyMessage.codec());
|
42
|
-
};
|
43
|
-
TopicOnlyMessage.decode = (buf) => {
|
44
|
-
return decodeMessage(buf, TopicOnlyMessage.codec());
|
45
|
-
};
|
46
|
-
})(TopicOnlyMessage$1 || (TopicOnlyMessage$1 = {}));
|
47
|
-
|
48
|
-
var topic_only_message = /*#__PURE__*/Object.freeze({
|
49
|
-
__proto__: null,
|
50
|
-
get TopicOnlyMessage () { return TopicOnlyMessage$1; }
|
51
|
-
});
|
52
|
-
|
53
|
-
const log = debug("waku:message:topic-only");
|
54
|
-
class TopicOnlyMessage {
|
55
|
-
constructor(proto) {
|
56
|
-
this.proto = proto;
|
57
|
-
}
|
58
|
-
get contentTopic() {
|
59
|
-
return this.proto.contentTopic ?? "";
|
60
|
-
}
|
61
|
-
}
|
62
|
-
class TopicOnlyDecoder {
|
63
|
-
constructor() {
|
64
|
-
this.contentTopic = "";
|
65
|
-
}
|
66
|
-
fromWireToProtoObj(bytes) {
|
67
|
-
const protoMessage = TopicOnlyMessage$1.decode(bytes);
|
68
|
-
log("Message decoded", protoMessage);
|
69
|
-
return Promise.resolve({
|
70
|
-
contentTopic: protoMessage.contentTopic,
|
71
|
-
payload: undefined,
|
72
|
-
rateLimitProof: undefined,
|
73
|
-
timestamp: undefined,
|
74
|
-
version: undefined,
|
75
|
-
});
|
76
|
-
}
|
77
|
-
async fromProtoObj(proto) {
|
78
|
-
return new TopicOnlyMessage(proto);
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
export { TopicOnlyDecoder as T, TopicOnlyMessage as a, topic_only_message as t };
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { peerIdFromString } from "@libp2p/peer-id";
|
2
|
-
export function multiaddrsToPeerInfo(mas) {
|
3
|
-
return mas
|
4
|
-
.map((ma) => {
|
5
|
-
const peerIdStr = ma.getPeerId();
|
6
|
-
const protocols = [];
|
7
|
-
return {
|
8
|
-
id: peerIdStr ? peerIdFromString(peerIdStr) : null,
|
9
|
-
multiaddrs: [ma.decapsulateCode(421)],
|
10
|
-
protocols,
|
11
|
-
};
|
12
|
-
})
|
13
|
-
.filter((peerInfo) => peerInfo.id !== null);
|
14
|
-
}
|
15
|
-
//# sourceMappingURL=multiaddr_to_peer_info.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"multiaddr_to_peer_info.js","sourceRoot":"","sources":["../../src/lib/multiaddr_to_peer_info.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,UAAU,oBAAoB,CAAC,GAAgB;IACnD,OAAO,GAAG;SACP,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACV,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;QACjC,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,OAAO;YACL,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,UAAU,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YACrC,SAAS;SACV,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,QAAQ,EAAwB,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AACtE,CAAC"}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import type { PeerDiscovery, PeerDiscoveryEvents } from "@libp2p/interface-peer-discovery";
|
2
|
-
import { symbol } from "@libp2p/interface-peer-discovery";
|
3
|
-
import { EventEmitter } from "@libp2p/interfaces/events";
|
4
|
-
import type { Multiaddr } from "@multiformats/multiaddr";
|
5
|
-
export interface Options {
|
6
|
-
/**
|
7
|
-
* The maximum of peers to connect to as part of the bootstrap process.
|
8
|
-
*
|
9
|
-
* @default The length of the passed `peers` array.
|
10
|
-
*/
|
11
|
-
maxPeers?: number;
|
12
|
-
/**
|
13
|
-
* The interval between emitting addresses in milliseconds.
|
14
|
-
*
|
15
|
-
* @default {@link PeerDiscoveryStaticPeers.DefaultInterval}
|
16
|
-
*/
|
17
|
-
interval?: number;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Pass a list of multiaddr that will be used to bootstrap a node.
|
21
|
-
*/
|
22
|
-
export declare class PeerDiscoveryStaticPeers extends EventEmitter<PeerDiscoveryEvents> implements PeerDiscovery {
|
23
|
-
static DefaultInterval: number;
|
24
|
-
private readonly peers;
|
25
|
-
private timer?;
|
26
|
-
private readonly interval;
|
27
|
-
/**
|
28
|
-
* @param peers Multiaddrs of peers to connect to.
|
29
|
-
* @param opts
|
30
|
-
*/
|
31
|
-
constructor(peers: string[] | Multiaddr[], opts?: Options);
|
32
|
-
/**
|
33
|
-
* Start emitting static peers.
|
34
|
-
*/
|
35
|
-
start(): void;
|
36
|
-
private _startTimer;
|
37
|
-
_returnPeers(): void;
|
38
|
-
/**
|
39
|
-
* Stop emitting peers.
|
40
|
-
*/
|
41
|
-
stop(): void;
|
42
|
-
get [symbol](): true;
|
43
|
-
get [Symbol.toStringTag](): string;
|
44
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import { symbol } from "@libp2p/interface-peer-discovery";
|
2
|
-
import { CustomEvent, EventEmitter } from "@libp2p/interfaces/events";
|
3
|
-
import { multiaddr } from "@multiformats/multiaddr";
|
4
|
-
import debug from "debug";
|
5
|
-
import { multiaddrsToPeerInfo } from "./multiaddr_to_peer_info.js";
|
6
|
-
import { getPseudoRandomSubset } from "./random_subset.js";
|
7
|
-
const log = debug("waku:peer-discovery-static-list");
|
8
|
-
/**
|
9
|
-
* Pass a list of multiaddr that will be used to bootstrap a node.
|
10
|
-
*/
|
11
|
-
export class PeerDiscoveryStaticPeers extends EventEmitter {
|
12
|
-
/**
|
13
|
-
* @param peers Multiaddrs of peers to connect to.
|
14
|
-
* @param opts
|
15
|
-
*/
|
16
|
-
constructor(peers, opts) {
|
17
|
-
super();
|
18
|
-
this.interval = opts?.interval ?? PeerDiscoveryStaticPeers.DefaultInterval;
|
19
|
-
const maxPeers = opts?.maxPeers ?? peers?.length;
|
20
|
-
const peerMas = peers.map((peer) => {
|
21
|
-
if (typeof peer === "string") {
|
22
|
-
return multiaddr(peer);
|
23
|
-
}
|
24
|
-
else {
|
25
|
-
return peer;
|
26
|
-
}
|
27
|
-
});
|
28
|
-
this.peers = multiaddrsToPeerInfo(getPseudoRandomSubset(peerMas, maxPeers));
|
29
|
-
log("Use provided list of peers (reduced to maxPeers)", this.peers.map((ma) => ma.toString()));
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* Start emitting static peers.
|
33
|
-
*/
|
34
|
-
start() {
|
35
|
-
this._startTimer();
|
36
|
-
}
|
37
|
-
_startTimer() {
|
38
|
-
if (this.peers) {
|
39
|
-
log("Starting to emit static peers.");
|
40
|
-
if (this.timer != null) {
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
this.timer = setInterval(() => this._returnPeers(), this.interval);
|
44
|
-
this._returnPeers();
|
45
|
-
}
|
46
|
-
}
|
47
|
-
_returnPeers() {
|
48
|
-
if (this.timer == null) {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
this.peers.forEach((peerData) => {
|
52
|
-
this.dispatchEvent(new CustomEvent("peer", { detail: peerData }));
|
53
|
-
});
|
54
|
-
}
|
55
|
-
/**
|
56
|
-
* Stop emitting peers.
|
57
|
-
*/
|
58
|
-
stop() {
|
59
|
-
if (this.timer != null) {
|
60
|
-
clearInterval(this.timer);
|
61
|
-
}
|
62
|
-
this.timer = undefined;
|
63
|
-
}
|
64
|
-
get [symbol]() {
|
65
|
-
return true;
|
66
|
-
}
|
67
|
-
get [Symbol.toStringTag]() {
|
68
|
-
return "@waku/peer-discovery-static-list";
|
69
|
-
}
|
70
|
-
}
|
71
|
-
PeerDiscoveryStaticPeers.DefaultInterval = 200;
|
72
|
-
//# sourceMappingURL=peer_discovery_static_list.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"peer_discovery_static_list.js","sourceRoot":"","sources":["../../src/lib/peer_discovery_static_list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,GAAG,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAiBrD;;GAEG;AACH,MAAM,OAAO,wBACX,SAAQ,YAAiC;IAQzC;;;OAGG;IACH,YAAY,KAA6B,EAAE,IAAc;QACvD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,wBAAwB,CAAC,eAAe,CAAC;QAC3E,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,KAAK,EA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IAAI,EAAE;YACtB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3B;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,MAAM,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,kCAAkC,CAAC;IAC5C,CAAC;;AA9EM,wCAAe,GAAG,GAAG,CAAC"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
export function selectConnection(connections) {
|
2
|
-
if (!connections.length)
|
3
|
-
return;
|
4
|
-
if (connections.length === 1)
|
5
|
-
return connections[0];
|
6
|
-
let latestConnection;
|
7
|
-
connections.forEach((connection) => {
|
8
|
-
if (connection.stat.status === "OPEN") {
|
9
|
-
if (!latestConnection) {
|
10
|
-
latestConnection = connection;
|
11
|
-
}
|
12
|
-
else if (connection.stat.timeline.open > latestConnection.stat.timeline.open) {
|
13
|
-
latestConnection = connection;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
});
|
17
|
-
return latestConnection;
|
18
|
-
}
|
19
|
-
//# sourceMappingURL=select_connection.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"select_connection.js","sourceRoot":"","sources":["../../src/lib/select_connection.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAC9B,WAAyB;IAEzB,IAAI,CAAC,WAAW,CAAC,MAAM;QAAE,OAAO;IAChC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;IAEpD,IAAI,gBAAwC,CAAC;IAE7C,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACjC,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;YACrC,IAAI,CAAC,gBAAgB,EAAE;gBACrB,gBAAgB,GAAG,UAAU,CAAC;aAC/B;iBAAM,IACL,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EACnE;gBACA,gBAAgB,GAAG,UAAU,CAAC;aAC/B;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { PeerId } from "@libp2p/interface-peer-id";
|
2
|
-
import type { Peer, PeerStore } from "@libp2p/interface-peer-store";
|
3
|
-
/**
|
4
|
-
* Returns a pseudo-random peer that supports the given protocol.
|
5
|
-
* Useful for protocols such as store and light push
|
6
|
-
*/
|
7
|
-
export declare function selectRandomPeer(peers: Peer[]): Peer | undefined;
|
8
|
-
/**
|
9
|
-
* Returns the list of peers that supports the given protocol.
|
10
|
-
*/
|
11
|
-
export declare function getPeersForProtocol(peerStore: PeerStore, protocols: string[]): Promise<Peer[]>;
|
12
|
-
export declare function selectPeerForProtocol(peerStore: PeerStore, protocols: string[], peerId?: PeerId): Promise<{
|
13
|
-
peer: Peer;
|
14
|
-
protocol: string;
|
15
|
-
} | undefined>;
|
package/dist/lib/select_peer.js
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
import debug from "debug";
|
2
|
-
const log = debug("waku:select-peer");
|
3
|
-
/**
|
4
|
-
* Returns a pseudo-random peer that supports the given protocol.
|
5
|
-
* Useful for protocols such as store and light push
|
6
|
-
*/
|
7
|
-
export function selectRandomPeer(peers) {
|
8
|
-
if (peers.length === 0)
|
9
|
-
return;
|
10
|
-
const index = Math.round(Math.random() * (peers.length - 1));
|
11
|
-
return peers[index];
|
12
|
-
}
|
13
|
-
/**
|
14
|
-
* Returns the list of peers that supports the given protocol.
|
15
|
-
*/
|
16
|
-
export async function getPeersForProtocol(peerStore, protocols) {
|
17
|
-
const peers = [];
|
18
|
-
await peerStore.forEach((peer) => {
|
19
|
-
for (let i = 0; i < protocols.length; i++) {
|
20
|
-
if (peer.protocols.includes(protocols[i])) {
|
21
|
-
peers.push(peer);
|
22
|
-
break;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
});
|
26
|
-
return peers;
|
27
|
-
}
|
28
|
-
export async function selectPeerForProtocol(peerStore, protocols, peerId) {
|
29
|
-
let peer;
|
30
|
-
if (peerId) {
|
31
|
-
peer = await peerStore.get(peerId);
|
32
|
-
if (!peer) {
|
33
|
-
log(`Failed to retrieve connection details for provided peer in peer store: ${peerId.toString()}`);
|
34
|
-
return;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
else {
|
38
|
-
const peers = await getPeersForProtocol(peerStore, protocols);
|
39
|
-
peer = selectRandomPeer(peers);
|
40
|
-
if (!peer) {
|
41
|
-
log("Failed to find known peer that registers protocols", protocols);
|
42
|
-
return;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
let protocol;
|
46
|
-
for (const codec of protocols) {
|
47
|
-
if (peer.protocols.includes(codec)) {
|
48
|
-
protocol = codec;
|
49
|
-
// Do not break as we want to keep the last value
|
50
|
-
}
|
51
|
-
}
|
52
|
-
log(`Using codec ${protocol}`);
|
53
|
-
if (!protocol) {
|
54
|
-
log(`Peer does not register required protocols: ${peer.id.toString()}`, protocols);
|
55
|
-
return;
|
56
|
-
}
|
57
|
-
return { peer, protocol };
|
58
|
-
}
|
59
|
-
//# sourceMappingURL=select_peer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"select_peer.js","sourceRoot":"","sources":["../../src/lib/select_peer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,GAAG,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,M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