@helia/bitswap 0.0.0-329652a
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/LICENSE +4 -0
- package/README.md +64 -0
- package/dist/index.min.js +3 -0
- package/dist/src/bitswap.d.ts +50 -0
- package/dist/src/bitswap.d.ts.map +1 -0
- package/dist/src/bitswap.js +120 -0
- package/dist/src/bitswap.js.map +1 -0
- package/dist/src/constants.d.ts +12 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +12 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.d.ts +178 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/network.d.ts +84 -0
- package/dist/src/network.d.ts.map +1 -0
- package/dist/src/network.js +370 -0
- package/dist/src/network.js.map +1 -0
- package/dist/src/pb/message.d.ts +67 -0
- package/dist/src/pb/message.d.ts.map +1 -0
- package/dist/src/pb/message.js +359 -0
- package/dist/src/pb/message.js.map +1 -0
- package/dist/src/peer-want-lists/index.d.ts +44 -0
- package/dist/src/peer-want-lists/index.d.ts.map +1 -0
- package/dist/src/peer-want-lists/index.js +116 -0
- package/dist/src/peer-want-lists/index.js.map +1 -0
- package/dist/src/peer-want-lists/ledger.d.ts +54 -0
- package/dist/src/peer-want-lists/ledger.d.ts.map +1 -0
- package/dist/src/peer-want-lists/ledger.js +104 -0
- package/dist/src/peer-want-lists/ledger.js.map +1 -0
- package/dist/src/session.d.ts +20 -0
- package/dist/src/session.d.ts.map +1 -0
- package/dist/src/session.js +100 -0
- package/dist/src/session.js.map +1 -0
- package/dist/src/stats.d.ts +16 -0
- package/dist/src/stats.d.ts.map +1 -0
- package/dist/src/stats.js +49 -0
- package/dist/src/stats.js.map +1 -0
- package/dist/src/utils/cid-prefix.d.ts +3 -0
- package/dist/src/utils/cid-prefix.d.ts.map +1 -0
- package/dist/src/utils/cid-prefix.js +7 -0
- package/dist/src/utils/cid-prefix.js.map +1 -0
- package/dist/src/utils/varint-decoder.d.ts +3 -0
- package/dist/src/utils/varint-decoder.d.ts.map +1 -0
- package/dist/src/utils/varint-decoder.js +15 -0
- package/dist/src/utils/varint-decoder.js.map +1 -0
- package/dist/src/utils/varint-encoder.d.ts +3 -0
- package/dist/src/utils/varint-encoder.d.ts.map +1 -0
- package/dist/src/utils/varint-encoder.js +14 -0
- package/dist/src/utils/varint-encoder.js.map +1 -0
- package/dist/src/want-list.d.ts +120 -0
- package/dist/src/want-list.d.ts.map +1 -0
- package/dist/src/want-list.js +361 -0
- package/dist/src/want-list.js.map +1 -0
- package/package.json +200 -0
- package/src/bitswap.ts +152 -0
- package/src/constants.ts +11 -0
- package/src/index.ts +215 -0
- package/src/network.ts +506 -0
- package/src/pb/message.proto +42 -0
- package/src/pb/message.ts +450 -0
- package/src/peer-want-lists/index.ts +165 -0
- package/src/peer-want-lists/ledger.ts +161 -0
- package/src/session.ts +150 -0
- package/src/stats.ts +67 -0
- package/src/utils/cid-prefix.ts +8 -0
- package/src/utils/varint-decoder.ts +19 -0
- package/src/utils/varint-encoder.ts +18 -0
- package/src/want-list.ts +529 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { AbortError } from '@libp2p/interface';
|
|
2
|
+
import { trackedPeerMap, PeerSet } from '@libp2p/peer-collections';
|
|
3
|
+
import { trackedMap } from '@libp2p/utils/tracked-map';
|
|
4
|
+
import all from 'it-all';
|
|
5
|
+
import filter from 'it-filter';
|
|
6
|
+
import map from 'it-map';
|
|
7
|
+
import { pipe } from 'it-pipe';
|
|
8
|
+
import { CID } from 'multiformats/cid';
|
|
9
|
+
import { sha256 } from 'multiformats/hashes/sha2';
|
|
10
|
+
import pDefer from 'p-defer';
|
|
11
|
+
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
12
|
+
import { DEFAULT_MESSAGE_SEND_DELAY } from './constants.js';
|
|
13
|
+
import { BlockPresenceType, WantType } from './pb/message.js';
|
|
14
|
+
import vd from './utils/varint-decoder.js';
|
|
15
|
+
export class WantList {
|
|
16
|
+
/**
|
|
17
|
+
* Tracks what CIDs we've previously sent to which peers
|
|
18
|
+
*/
|
|
19
|
+
peers;
|
|
20
|
+
wants;
|
|
21
|
+
network;
|
|
22
|
+
log;
|
|
23
|
+
sendMessagesDelay;
|
|
24
|
+
sendMessagesTimeout;
|
|
25
|
+
hashLoader;
|
|
26
|
+
constructor(components, init = {}) {
|
|
27
|
+
this.peers = trackedPeerMap({
|
|
28
|
+
name: 'ipfs_bitswap_peers',
|
|
29
|
+
metrics: components.metrics
|
|
30
|
+
});
|
|
31
|
+
this.wants = trackedMap({
|
|
32
|
+
name: 'ipfs_bitswap_wantlist',
|
|
33
|
+
metrics: components.metrics
|
|
34
|
+
});
|
|
35
|
+
this.network = components.network;
|
|
36
|
+
this.sendMessagesDelay = init.sendMessagesDelay ?? DEFAULT_MESSAGE_SEND_DELAY;
|
|
37
|
+
this.log = components.logger.forComponent('helia:bitswap:wantlist');
|
|
38
|
+
this.hashLoader = init.hashLoader;
|
|
39
|
+
this.network.addEventListener('bitswap:message', (evt) => {
|
|
40
|
+
this.receiveMessage(evt.detail.peer, evt.detail.message)
|
|
41
|
+
.catch(err => {
|
|
42
|
+
this.log.error('error receiving bitswap message from %p', evt.detail.peer, err);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
this.network.addEventListener('peer:connected', evt => {
|
|
46
|
+
this.peerConnected(evt.detail)
|
|
47
|
+
.catch(err => {
|
|
48
|
+
this.log.error('error processing newly connected bitswap peer %p', evt.detail, err);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
this.network.addEventListener('peer:disconnected', evt => {
|
|
52
|
+
this.peerDisconnected(evt.detail);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async addEntry(cid, options) {
|
|
56
|
+
const cidStr = uint8ArrayToString(cid.multihash.bytes, 'base64');
|
|
57
|
+
let entry = this.wants.get(cidStr);
|
|
58
|
+
if (entry == null) {
|
|
59
|
+
entry = {
|
|
60
|
+
cid,
|
|
61
|
+
session: new PeerSet(),
|
|
62
|
+
priority: options.priority ?? 1,
|
|
63
|
+
wantType: options.wantType ?? WantType.WantBlock,
|
|
64
|
+
cancel: false,
|
|
65
|
+
sendDontHave: true,
|
|
66
|
+
blockWantListeners: [],
|
|
67
|
+
blockPresenceListeners: []
|
|
68
|
+
};
|
|
69
|
+
if (options.peerId != null) {
|
|
70
|
+
entry.session.add(options.peerId);
|
|
71
|
+
}
|
|
72
|
+
this.wants.set(cidStr, entry);
|
|
73
|
+
}
|
|
74
|
+
// upgrade want-have to want-block if the new want is a WantBlock but the
|
|
75
|
+
// previous want was a WantHave
|
|
76
|
+
if (entry.wantType === WantType.WantHave && options.wantType === WantType.WantBlock) {
|
|
77
|
+
entry.wantType = WantType.WantBlock;
|
|
78
|
+
}
|
|
79
|
+
// if this want was part of a session..
|
|
80
|
+
if (entry.session.size > 0) {
|
|
81
|
+
// if the new want is also part of a session, expand the want session to
|
|
82
|
+
// include both sets of peers
|
|
83
|
+
if (options.peerId != null) {
|
|
84
|
+
entry.session.add(options.peerId);
|
|
85
|
+
}
|
|
86
|
+
// if the new want is not part of a session, make this want a non-session
|
|
87
|
+
// want - nb. this will cause this WantList entry to be sent to every peer
|
|
88
|
+
// instead of just the ones in the session
|
|
89
|
+
if (options.peerId == null) {
|
|
90
|
+
entry.session.clear();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// add a promise that will be resolved or rejected when the response arrives
|
|
94
|
+
let deferred;
|
|
95
|
+
if (options.wantType === WantType.WantBlock) {
|
|
96
|
+
const p = deferred = pDefer();
|
|
97
|
+
entry.blockWantListeners.push(p);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const p = deferred = pDefer();
|
|
101
|
+
entry.blockPresenceListeners.push(p);
|
|
102
|
+
}
|
|
103
|
+
// reject the promise if the want is rejected
|
|
104
|
+
const abortListener = () => {
|
|
105
|
+
this.log('want for %c was aborted, cancelling want', cid);
|
|
106
|
+
if (entry != null) {
|
|
107
|
+
entry.cancel = true;
|
|
108
|
+
}
|
|
109
|
+
deferred.reject(new AbortError('Want was aborted'));
|
|
110
|
+
};
|
|
111
|
+
options.signal?.addEventListener('abort', abortListener);
|
|
112
|
+
// broadcast changes
|
|
113
|
+
clearTimeout(this.sendMessagesTimeout);
|
|
114
|
+
this.sendMessagesTimeout = setTimeout(() => {
|
|
115
|
+
void this.sendMessages()
|
|
116
|
+
.catch(err => {
|
|
117
|
+
this.log('error sending messages to peers', err);
|
|
118
|
+
});
|
|
119
|
+
}, this.sendMessagesDelay);
|
|
120
|
+
try {
|
|
121
|
+
return await deferred.promise;
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
// remove listener
|
|
125
|
+
options.signal?.removeEventListener('abort', abortListener);
|
|
126
|
+
// remove deferred promise
|
|
127
|
+
if (options.wantType === WantType.WantBlock) {
|
|
128
|
+
entry.blockWantListeners = entry.blockWantListeners.filter(recipient => recipient !== deferred);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
entry.blockPresenceListeners = entry.blockPresenceListeners.filter(recipient => recipient !== deferred);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async sendMessages() {
|
|
136
|
+
for (const [peerId, sentWants] of this.peers) {
|
|
137
|
+
const sent = new Set();
|
|
138
|
+
const message = {
|
|
139
|
+
wantlist: {
|
|
140
|
+
full: false,
|
|
141
|
+
entries: pipe(this.wants.entries(), (source) => filter(source, ([key, entry]) => {
|
|
142
|
+
// skip session-only wants
|
|
143
|
+
if (entry.session.size > 0 && !entry.session.has(peerId)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const sentPreviously = sentWants.has(key);
|
|
147
|
+
// don't cancel if we've not sent it to them before
|
|
148
|
+
if (entry.cancel) {
|
|
149
|
+
return sentPreviously;
|
|
150
|
+
}
|
|
151
|
+
// only send if we've not sent it to them before
|
|
152
|
+
return !sentPreviously;
|
|
153
|
+
}), (source) => map(source, ([key, entry]) => {
|
|
154
|
+
sent.add(key);
|
|
155
|
+
return {
|
|
156
|
+
cid: entry.cid.bytes,
|
|
157
|
+
priority: entry.priority,
|
|
158
|
+
wantType: entry.wantType,
|
|
159
|
+
cancel: entry.cancel,
|
|
160
|
+
sendDontHave: entry.sendDontHave
|
|
161
|
+
};
|
|
162
|
+
}), (source) => all(source))
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
if (message.wantlist?.entries.length === 0) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
// add message to send queue
|
|
169
|
+
try {
|
|
170
|
+
await this.network.sendMessage(peerId, message);
|
|
171
|
+
// update list of messages sent to remote
|
|
172
|
+
for (const key of sent) {
|
|
173
|
+
sentWants.add(key);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
this.log.error('error sending full wantlist to new peer', err);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// queued all message sends, remove cancelled wants from wantlist and sent
|
|
181
|
+
// wants
|
|
182
|
+
for (const [key, entry] of this.wants) {
|
|
183
|
+
if (entry.cancel) {
|
|
184
|
+
this.wants.delete(key);
|
|
185
|
+
for (const sentWants of this.peers.values()) {
|
|
186
|
+
sentWants.delete(key);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
has(cid) {
|
|
192
|
+
const cidStr = uint8ArrayToString(cid.multihash.bytes, 'base64');
|
|
193
|
+
return this.wants.has(cidStr);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Add a CID to the wantlist
|
|
197
|
+
*/
|
|
198
|
+
async wantPresence(cid, options = {}) {
|
|
199
|
+
if (options.peerId != null && this.peers.get(options.peerId) == null) {
|
|
200
|
+
const cidStr = uint8ArrayToString(cid.multihash.bytes, 'base64');
|
|
201
|
+
try {
|
|
202
|
+
// if we don't have them as a peer, add them
|
|
203
|
+
this.peers.set(options.peerId, new Set([cidStr]));
|
|
204
|
+
// sending WantHave directly to peer
|
|
205
|
+
await this.network.sendMessage(options.peerId, {
|
|
206
|
+
wantlist: {
|
|
207
|
+
full: false,
|
|
208
|
+
entries: [{
|
|
209
|
+
cid: cid.bytes,
|
|
210
|
+
sendDontHave: true,
|
|
211
|
+
wantType: WantType.WantHave,
|
|
212
|
+
priority: 1
|
|
213
|
+
}]
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
// sending failed, remove them as a peer
|
|
219
|
+
this.peers.delete(options.peerId);
|
|
220
|
+
throw err;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return this.addEntry(cid, {
|
|
224
|
+
...options,
|
|
225
|
+
wantType: WantType.WantHave
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Add a CID to the wantlist
|
|
230
|
+
*/
|
|
231
|
+
async wantBlock(cid, options = {}) {
|
|
232
|
+
return this.addEntry(cid, {
|
|
233
|
+
...options,
|
|
234
|
+
wantType: WantType.WantBlock
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Invoked when a message is received from a bitswap peer
|
|
239
|
+
*/
|
|
240
|
+
async receiveMessage(sender, message) {
|
|
241
|
+
this.log('received message from %p', sender);
|
|
242
|
+
// blocks received
|
|
243
|
+
const blockResults = [];
|
|
244
|
+
const presenceResults = [];
|
|
245
|
+
// process blocks
|
|
246
|
+
for (const block of message.blocks) {
|
|
247
|
+
if (block.prefix == null || block.data == null) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
this.log('received block');
|
|
251
|
+
const values = vd(block.prefix);
|
|
252
|
+
const cidVersion = values[0];
|
|
253
|
+
const multicodec = values[1];
|
|
254
|
+
const hashAlg = values[2];
|
|
255
|
+
// const hashLen = values[3] // We haven't need to use this so far
|
|
256
|
+
const hasher = hashAlg === sha256.code ? sha256 : await this.hashLoader?.getHasher(hashAlg);
|
|
257
|
+
if (hasher == null) {
|
|
258
|
+
this.log.error('unknown hash algorithm', hashAlg);
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
const hash = await hasher.digest(block.data);
|
|
262
|
+
const cid = CID.create(cidVersion === 0 ? 0 : 1, multicodec, hash);
|
|
263
|
+
this.log('received block from %p for %c', sender, cid);
|
|
264
|
+
blockResults.push({
|
|
265
|
+
sender,
|
|
266
|
+
cid,
|
|
267
|
+
block: block.data
|
|
268
|
+
});
|
|
269
|
+
presenceResults.push({
|
|
270
|
+
sender,
|
|
271
|
+
cid,
|
|
272
|
+
has: true
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
// process block presences
|
|
276
|
+
for (const { cid: cidBytes, type } of message.blockPresences) {
|
|
277
|
+
const cid = CID.decode(cidBytes);
|
|
278
|
+
this.log('received %s from %p for %c', type, sender, cid);
|
|
279
|
+
presenceResults.push({
|
|
280
|
+
sender,
|
|
281
|
+
cid,
|
|
282
|
+
has: type === BlockPresenceType.HaveBlock
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
for (const result of blockResults) {
|
|
286
|
+
const cidStr = uint8ArrayToString(result.cid.multihash.bytes, 'base64');
|
|
287
|
+
const entry = this.wants.get(cidStr);
|
|
288
|
+
if (entry == null) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const recipients = entry.blockWantListeners;
|
|
292
|
+
entry.blockWantListeners = [];
|
|
293
|
+
recipients.forEach((p) => {
|
|
294
|
+
p.resolve(result);
|
|
295
|
+
});
|
|
296
|
+
// since we received the block, flip the cancel flag to send cancels to
|
|
297
|
+
// any peers on the next message sending iteration, this will remove it
|
|
298
|
+
// from the internal want list
|
|
299
|
+
entry.cancel = true;
|
|
300
|
+
}
|
|
301
|
+
for (const result of presenceResults) {
|
|
302
|
+
const cidStr = uint8ArrayToString(result.cid.multihash.bytes, 'base64');
|
|
303
|
+
const entry = this.wants.get(cidStr);
|
|
304
|
+
if (entry == null) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const recipients = entry.blockPresenceListeners;
|
|
308
|
+
entry.blockPresenceListeners = [];
|
|
309
|
+
recipients.forEach((p) => {
|
|
310
|
+
p.resolve(result);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Invoked when the network topology notices a new peer that supports Bitswap
|
|
316
|
+
*/
|
|
317
|
+
async peerConnected(peerId) {
|
|
318
|
+
const sentWants = new Set();
|
|
319
|
+
// new peer, give them the full wantlist
|
|
320
|
+
const message = {
|
|
321
|
+
wantlist: {
|
|
322
|
+
full: true,
|
|
323
|
+
entries: pipe(this.wants.entries(), (source) => filter(source, ([key, entry]) => !entry.cancel && (entry.session.size > 0 && !entry.session.has(peerId))), (source) => filter(source, ([key, entry]) => !entry.cancel), (source) => map(source, ([key, entry]) => {
|
|
324
|
+
sentWants.add(key);
|
|
325
|
+
return {
|
|
326
|
+
cid: entry.cid.bytes,
|
|
327
|
+
priority: 1,
|
|
328
|
+
wantType: WantType.WantBlock,
|
|
329
|
+
cancel: false,
|
|
330
|
+
sendDontHave: false
|
|
331
|
+
};
|
|
332
|
+
}), (source) => all(source))
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
// only send the wantlist if we have something to send
|
|
336
|
+
if (message.wantlist?.entries.length === 0) {
|
|
337
|
+
this.peers.set(peerId, sentWants);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
await this.network.sendMessage(peerId, message);
|
|
342
|
+
this.peers.set(peerId, sentWants);
|
|
343
|
+
}
|
|
344
|
+
catch (err) {
|
|
345
|
+
this.log.error('error sending full wantlist to new peer %p', peerId, err);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Invoked when the network topology notices peer that supports Bitswap has
|
|
350
|
+
* disconnected
|
|
351
|
+
*/
|
|
352
|
+
peerDisconnected(peerId) {
|
|
353
|
+
this.peers.delete(peerId);
|
|
354
|
+
}
|
|
355
|
+
start() {
|
|
356
|
+
}
|
|
357
|
+
stop() {
|
|
358
|
+
this.peers.clear();
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
//# sourceMappingURL=want-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"want-list.js","sourceRoot":"","sources":["../../src/want-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAiG1C,MAAM,OAAO,QAAQ;IACnB;;OAEG;IACa,KAAK,CAAsB;IAC3B,KAAK,CAA4B;IAChC,OAAO,CAAS;IAChB,GAAG,CAAQ;IACX,iBAAiB,CAAQ;IAClC,mBAAmB,CAAgC;IAC1C,UAAU,CAAwB;IAEnD,YAAa,UAA8B,EAAE,OAAqB,EAA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AAG,CAAC,MAAM,CAAC,CACxB;aACF;SACF,CAAA;QAED,sDAAsD;QACtD,IAAI,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;YAEjC,OAAM;QACR,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YAE/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4CAA4C,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QAC3E,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAE,MAAc;QAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;IAED,KAAK;IAEL,CAAC;IAED,IAAI;QACF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@helia/bitswap",
|
|
3
|
+
"version": "0.0.0-329652a",
|
|
4
|
+
"description": "JavaScript implementation of the Bitswap data exchange protocol used by Helia",
|
|
5
|
+
"license": "Apache-2.0 OR MIT",
|
|
6
|
+
"homepage": "https://github.com/ipfs/helia/tree/main/packages/bitswap#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ipfs/helia.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ipfs/helia/issues"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"provenance": true
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"exchange",
|
|
20
|
+
"ipfs",
|
|
21
|
+
"libp2p",
|
|
22
|
+
"p2p"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"types": "./dist/src/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"src",
|
|
28
|
+
"dist",
|
|
29
|
+
"!dist/test",
|
|
30
|
+
"!**/*.tsbuildinfo"
|
|
31
|
+
],
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/src/index.d.ts",
|
|
35
|
+
"import": "./dist/src/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"eslintConfig": {
|
|
39
|
+
"extends": "ipfs",
|
|
40
|
+
"parserOptions": {
|
|
41
|
+
"project": true,
|
|
42
|
+
"sourceType": "module"
|
|
43
|
+
},
|
|
44
|
+
"ignorePatterns": [
|
|
45
|
+
"scripts/*",
|
|
46
|
+
"*.test-d.ts"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"release": {
|
|
50
|
+
"branches": [
|
|
51
|
+
"main"
|
|
52
|
+
],
|
|
53
|
+
"plugins": [
|
|
54
|
+
[
|
|
55
|
+
"@semantic-release/commit-analyzer",
|
|
56
|
+
{
|
|
57
|
+
"preset": "conventionalcommits",
|
|
58
|
+
"releaseRules": [
|
|
59
|
+
{
|
|
60
|
+
"breaking": true,
|
|
61
|
+
"release": "major"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"revert": true,
|
|
65
|
+
"release": "patch"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "feat",
|
|
69
|
+
"release": "minor"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "fix",
|
|
73
|
+
"release": "patch"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "docs",
|
|
77
|
+
"release": "patch"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "test",
|
|
81
|
+
"release": "patch"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "deps",
|
|
85
|
+
"release": "patch"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"scope": "no-release",
|
|
89
|
+
"release": false
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"@semantic-release/release-notes-generator",
|
|
96
|
+
{
|
|
97
|
+
"preset": "conventionalcommits",
|
|
98
|
+
"presetConfig": {
|
|
99
|
+
"types": [
|
|
100
|
+
{
|
|
101
|
+
"type": "feat",
|
|
102
|
+
"section": "Features"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "fix",
|
|
106
|
+
"section": "Bug Fixes"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"type": "chore",
|
|
110
|
+
"section": "Trivial Changes"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "docs",
|
|
114
|
+
"section": "Documentation"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "deps",
|
|
118
|
+
"section": "Dependencies"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "test",
|
|
122
|
+
"section": "Tests"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"@semantic-release/changelog",
|
|
129
|
+
"@semantic-release/npm",
|
|
130
|
+
"@semantic-release/github",
|
|
131
|
+
"@semantic-release/git"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"scripts": {
|
|
135
|
+
"clean": "aegir clean",
|
|
136
|
+
"lint": "aegir lint",
|
|
137
|
+
"build": "aegir build",
|
|
138
|
+
"release": "aegir release",
|
|
139
|
+
"test": "aegir test",
|
|
140
|
+
"test:node": "aegir test -t node --cov",
|
|
141
|
+
"test:chrome": "aegir test -t browser --cov",
|
|
142
|
+
"test:chrome-webworker": "aegir test -t webworker",
|
|
143
|
+
"test:firefox": "aegir test -t browser -- --browser firefox",
|
|
144
|
+
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
|
|
145
|
+
"test:electron-main": "aegir test -t electron-main",
|
|
146
|
+
"dep-check": "aegir dep-check -i protons -i events",
|
|
147
|
+
"generate": "protons ./src/pb/message.proto",
|
|
148
|
+
"docs": "aegir docs"
|
|
149
|
+
},
|
|
150
|
+
"dependencies": {
|
|
151
|
+
"@helia/interface": "4.1.0-329652a",
|
|
152
|
+
"@libp2p/interface": "^1.1.2",
|
|
153
|
+
"@libp2p/logger": "^4.0.5",
|
|
154
|
+
"@libp2p/peer-collections": "^5.1.6",
|
|
155
|
+
"@libp2p/utils": "^5.2.3",
|
|
156
|
+
"@multiformats/multiaddr": "^12.1.14",
|
|
157
|
+
"@multiformats/multiaddr-matcher": "^1.1.2",
|
|
158
|
+
"any-signal": "^4.1.1",
|
|
159
|
+
"debug": "^4.3.4",
|
|
160
|
+
"interface-blockstore": "^5.2.9",
|
|
161
|
+
"interface-store": "^5.1.7",
|
|
162
|
+
"it-all": "^3.0.4",
|
|
163
|
+
"it-drain": "^3.0.5",
|
|
164
|
+
"it-filter": "^3.0.4",
|
|
165
|
+
"it-length-prefixed": "^9.0.0",
|
|
166
|
+
"it-length-prefixed-stream": "^1.1.6",
|
|
167
|
+
"it-map": "^3.0.5",
|
|
168
|
+
"it-merge": "^3.0.3",
|
|
169
|
+
"it-pipe": "^3.0.1",
|
|
170
|
+
"it-take": "^3.0.1",
|
|
171
|
+
"multiformats": "^13.0.1",
|
|
172
|
+
"p-defer": "^4.0.0",
|
|
173
|
+
"progress-events": "^1.0.0",
|
|
174
|
+
"protons-runtime": "^5.0.0",
|
|
175
|
+
"race-event": "^1.2.0",
|
|
176
|
+
"uint8-varint": "^2.0.3",
|
|
177
|
+
"uint8arraylist": "^2.4.3",
|
|
178
|
+
"uint8arrays": "^5.0.1"
|
|
179
|
+
},
|
|
180
|
+
"devDependencies": {
|
|
181
|
+
"@libp2p/interface-compliance-tests": "^5.1.3",
|
|
182
|
+
"@libp2p/peer-id-factory": "^4.0.5",
|
|
183
|
+
"@types/sinon": "^17.0.3",
|
|
184
|
+
"aegir": "^42.2.2",
|
|
185
|
+
"blockstore-core": "^4.3.10",
|
|
186
|
+
"delay": "^6.0.0",
|
|
187
|
+
"it-pair": "^2.0.6",
|
|
188
|
+
"it-protobuf-stream": "^1.1.2",
|
|
189
|
+
"p-event": "^6.0.0",
|
|
190
|
+
"p-retry": "^6.2.0",
|
|
191
|
+
"p-wait-for": "^5.0.2",
|
|
192
|
+
"protons": "^7.0.2",
|
|
193
|
+
"sinon": "^17.0.1",
|
|
194
|
+
"sinon-ts": "^2.0.0"
|
|
195
|
+
},
|
|
196
|
+
"browser": {
|
|
197
|
+
"dist/test/utils/create-libp2p-node.js": false
|
|
198
|
+
},
|
|
199
|
+
"sideEffects": false
|
|
200
|
+
}
|