helia 2.0.3 → 2.1.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/README.md +17 -8
- package/dist/index.min.js +40 -41
- package/dist/src/block-brokers/bitswap.d.ts +19 -0
- package/dist/src/block-brokers/bitswap.d.ts.map +1 -0
- package/dist/src/block-brokers/bitswap.js +48 -0
- package/dist/src/block-brokers/bitswap.js.map +1 -0
- package/dist/src/block-brokers/index.d.ts +3 -0
- package/dist/src/block-brokers/index.d.ts.map +1 -0
- package/dist/src/block-brokers/index.js +3 -0
- package/dist/src/block-brokers/index.js.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/broker.d.ts +14 -0
- package/dist/src/block-brokers/trustless-gateway/broker.d.ts.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/broker.js +55 -0
- package/dist/src/block-brokers/trustless-gateway/broker.js.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/index.d.ts +9 -0
- package/dist/src/block-brokers/trustless-gateway/index.d.ts.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/index.js +15 -0
- package/dist/src/block-brokers/trustless-gateway/index.js.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/trustless-gateway.d.ts +31 -0
- package/dist/src/block-brokers/trustless-gateway/trustless-gateway.d.ts.map +1 -0
- package/dist/src/block-brokers/trustless-gateway/trustless-gateway.js +114 -0
- package/dist/src/block-brokers/trustless-gateway/trustless-gateway.js.map +1 -0
- package/dist/src/helia.d.ts +0 -1
- package/dist/src/helia.d.ts.map +1 -1
- package/dist/src/helia.js +19 -25
- package/dist/src/helia.js.map +1 -1
- package/dist/src/index.d.ts +13 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/storage.d.ts +7 -2
- package/dist/src/storage.d.ts.map +1 -1
- package/dist/src/storage.js +14 -0
- package/dist/src/storage.js.map +1 -1
- package/dist/src/utils/default-hashers.d.ts +3 -0
- package/dist/src/utils/default-hashers.d.ts.map +1 -0
- package/dist/src/utils/default-hashers.js +11 -0
- package/dist/src/utils/default-hashers.js.map +1 -0
- package/dist/src/utils/libp2p-defaults.browser.d.ts +1 -0
- package/dist/src/utils/libp2p-defaults.browser.d.ts.map +1 -1
- package/dist/src/utils/libp2p-defaults.browser.js +2 -4
- package/dist/src/utils/libp2p-defaults.browser.js.map +1 -1
- package/dist/src/utils/libp2p-defaults.d.ts +1 -0
- package/dist/src/utils/libp2p-defaults.d.ts.map +1 -1
- package/dist/src/utils/libp2p-defaults.js +3 -4
- package/dist/src/utils/libp2p-defaults.js.map +1 -1
- package/dist/src/utils/networked-storage.d.ts +17 -9
- package/dist/src/utils/networked-storage.d.ts.map +1 -1
- package/dist/src/utils/networked-storage.js +109 -15
- package/dist/src/utils/networked-storage.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/typedoc-urls.json +10 -6
- package/package.json +32 -6
- package/src/block-brokers/bitswap.ts +78 -0
- package/src/block-brokers/index.ts +2 -0
- package/src/block-brokers/trustless-gateway/broker.ts +65 -0
- package/src/block-brokers/trustless-gateway/index.ts +28 -0
- package/src/block-brokers/trustless-gateway/trustless-gateway.ts +126 -0
- package/src/helia.ts +20 -30
- package/src/index.ts +14 -9
- package/src/storage.ts +19 -2
- package/src/utils/default-hashers.ts +12 -0
- package/src/utils/libp2p-defaults.browser.ts +3 -4
- package/src/utils/libp2p-defaults.ts +4 -4
- package/src/utils/networked-storage.ts +134 -23
- package/src/version.ts +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BlockBroker } from '@helia/interface/blocks';
|
|
2
|
+
import type { Libp2p } from '@libp2p/interface';
|
|
3
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
4
|
+
import type { BitswapOptions } from 'ipfs-bitswap';
|
|
5
|
+
import type { MultihashHasher } from 'multiformats/hashes/interface';
|
|
6
|
+
interface BitswapComponents {
|
|
7
|
+
libp2p: Libp2p;
|
|
8
|
+
blockstore: Blockstore;
|
|
9
|
+
hashers: MultihashHasher[];
|
|
10
|
+
}
|
|
11
|
+
export interface BitswapInit extends BitswapOptions {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A helper factory for users who want to override Helia `blockBrokers` but
|
|
15
|
+
* still want to use the default `BitswapBlockBroker`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bitswap(init?: BitswapInit): (components: BitswapComponents) => BlockBroker;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=bitswap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitswap.d.ts","sourceRoot":"","sources":["../../../src/block-brokers/bitswap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,WAAW,EAAyC,MAAM,yBAAyB,CAAA;AACjH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAwC,cAAc,EAAkC,MAAM,cAAc,CAAA;AAExH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAGpE,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc;CAElD;AAqDD;;;GAGG;AACH,wBAAgB,OAAO,CAAE,IAAI,GAAE,WAAgB,GAAG,CAAC,UAAU,EAAE,iBAAiB,KAAK,WAAW,CAE/F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createBitswap } from 'ipfs-bitswap';
|
|
2
|
+
class BitswapBlockBroker {
|
|
3
|
+
bitswap;
|
|
4
|
+
started;
|
|
5
|
+
constructor(components, init = {}) {
|
|
6
|
+
const { libp2p, blockstore, hashers } = components;
|
|
7
|
+
this.bitswap = createBitswap(libp2p, blockstore, {
|
|
8
|
+
hashLoader: {
|
|
9
|
+
getHasher: async (codecOrName) => {
|
|
10
|
+
const hasher = hashers.find(hasher => {
|
|
11
|
+
return hasher.code === codecOrName || hasher.name === codecOrName;
|
|
12
|
+
});
|
|
13
|
+
if (hasher != null) {
|
|
14
|
+
return hasher;
|
|
15
|
+
}
|
|
16
|
+
throw new Error(`Could not load hasher for code/name "${codecOrName}"`);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
...init
|
|
20
|
+
});
|
|
21
|
+
this.started = false;
|
|
22
|
+
}
|
|
23
|
+
isStarted() {
|
|
24
|
+
return this.started;
|
|
25
|
+
}
|
|
26
|
+
async start() {
|
|
27
|
+
await this.bitswap.start();
|
|
28
|
+
this.started = true;
|
|
29
|
+
}
|
|
30
|
+
async stop() {
|
|
31
|
+
await this.bitswap.stop();
|
|
32
|
+
this.started = false;
|
|
33
|
+
}
|
|
34
|
+
announce(cid, block, options) {
|
|
35
|
+
this.bitswap.notify(cid, block, options);
|
|
36
|
+
}
|
|
37
|
+
async retrieve(cid, { validateFn, ...options } = {}) {
|
|
38
|
+
return this.bitswap.want(cid, options);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A helper factory for users who want to override Helia `blockBrokers` but
|
|
43
|
+
* still want to use the default `BitswapBlockBroker`.
|
|
44
|
+
*/
|
|
45
|
+
export function bitswap(init = {}) {
|
|
46
|
+
return (components) => new BitswapBlockBroker(components, init);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=bitswap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitswap.js","sourceRoot":"","sources":["../../../src/block-brokers/bitswap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAoB5C,MAAM,kBAAkB;IAGL,OAAO,CAAS;IACzB,OAAO,CAAS;IAExB,YAAa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AAO,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAE,OAAoB,EAAE;IAC7C,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/block-brokers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/block-brokers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TrustlessGatewayBlockBrokerInit, TrustlessGatewayGetBlockProgressEvents } from './index.js';
|
|
2
|
+
import type { BlockRetrievalOptions, BlockRetriever } from '@helia/interface/blocks';
|
|
3
|
+
import type { CID } from 'multiformats/cid';
|
|
4
|
+
import type { ProgressOptions } from 'progress-events';
|
|
5
|
+
/**
|
|
6
|
+
* A class that accepts a list of trustless gateways that are queried
|
|
7
|
+
* for blocks.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TrustlessGatewayBlockBroker implements BlockRetriever<ProgressOptions<TrustlessGatewayGetBlockProgressEvents>> {
|
|
10
|
+
private readonly gateways;
|
|
11
|
+
constructor(init?: TrustlessGatewayBlockBrokerInit);
|
|
12
|
+
retrieve(cid: CID, options?: BlockRetrievalOptions<ProgressOptions<TrustlessGatewayGetBlockProgressEvents>>): Promise<Uint8Array>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=broker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.d.ts","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-gateway/broker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,+BAA+B,EAAE,sCAAsC,EAAE,MAAM,YAAY,CAAA;AACzG,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAItD;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,cAAc,CAClE,eAAe,CAAC,sCAAsC,CAAC,CACtD;IACC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;gBAEhC,IAAI,GAAE,+BAAoC;IAOjD,QAAQ,CAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,qBAAqB,CAAC,eAAe,CAAC,sCAAsC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAsC7I"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { logger } from '@libp2p/logger';
|
|
2
|
+
import { TrustlessGateway } from './trustless-gateway.js';
|
|
3
|
+
import { DEFAULT_TRUSTLESS_GATEWAYS } from './index.js';
|
|
4
|
+
const log = logger('helia:trustless-gateway-block-broker');
|
|
5
|
+
/**
|
|
6
|
+
* A class that accepts a list of trustless gateways that are queried
|
|
7
|
+
* for blocks.
|
|
8
|
+
*/
|
|
9
|
+
export class TrustlessGatewayBlockBroker {
|
|
10
|
+
gateways;
|
|
11
|
+
constructor(init = {}) {
|
|
12
|
+
this.gateways = (init.gateways ?? DEFAULT_TRUSTLESS_GATEWAYS)
|
|
13
|
+
.map((gatewayOrUrl) => {
|
|
14
|
+
return new TrustlessGateway(gatewayOrUrl);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async retrieve(cid, options = {}) {
|
|
18
|
+
// Loop through the gateways until we get a block or run out of gateways
|
|
19
|
+
// TODO: switch to toSorted when support is better
|
|
20
|
+
const sortedGateways = this.gateways.sort((a, b) => b.reliability() - a.reliability());
|
|
21
|
+
const aggregateErrors = [];
|
|
22
|
+
for (const gateway of sortedGateways) {
|
|
23
|
+
log('getting block for %c from %s', cid, gateway.url);
|
|
24
|
+
try {
|
|
25
|
+
const block = await gateway.getRawBlock(cid, options.signal);
|
|
26
|
+
log.trace('got block for %c from %s', cid, gateway.url);
|
|
27
|
+
try {
|
|
28
|
+
await options.validateFn?.(block);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
log.error('failed to validate block for %c from %s', cid, gateway.url, err);
|
|
32
|
+
gateway.incrementInvalidBlocks();
|
|
33
|
+
throw new Error(`unable to validate block for CID ${cid} from gateway ${gateway.url}`);
|
|
34
|
+
}
|
|
35
|
+
return block;
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
log.error('failed to get block for %c from %s', cid, gateway.url, err);
|
|
39
|
+
if (err instanceof Error) {
|
|
40
|
+
aggregateErrors.push(err);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
aggregateErrors.push(new Error(`unable to fetch raw block for CID ${cid} from gateway ${gateway.url}`));
|
|
44
|
+
}
|
|
45
|
+
// if signal was aborted, exit the loop
|
|
46
|
+
if (options.signal?.aborted === true) {
|
|
47
|
+
log.trace('request aborted while fetching raw block for CID %c from gateway %s', cid, gateway.url);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
throw new AggregateError(aggregateErrors, `unable to fetch raw block for CID ${cid} from any gateway`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=broker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.js","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-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O,GAAG,EAAE;oBACZ,GAAG,CAAC,KAAK,CAAC,yCAAyC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;oBAC3E,OAAO,CAAC,sBAAsB,EAAE,CAAA;oBAEhC,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,iBAAiB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;iBACvF;gBAED,OAAO,KAAK,CAAA;aACb;YAAC,OAAO,GAAY,EAAE;gBACrB,GAAG,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;gBACtE,IAAI,GAAG,YAAY,KAAK,EAAE;oBACxB,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;iBAC1B;qBAAM;oBACL,eAAe,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,qCAAqC,GAAG,iBAAiB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;iBACxG;gBACD,uCAAuC;gBACvC,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE;oBACpC,GAAG,CAAC,KAAK,CAAC,qEAAqE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;oBAClG,MAAK;iBACN;aACF;SACF;QAED,MAAM,IAAI,cAAc,CAAC,eAAe,EAAE,qCAAqC,GAAG,mBAAmB,CAAC,CAAA;IACxG,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BlockRetriever } from '@helia/interface/src/blocks.js';
|
|
2
|
+
import type { ProgressEvent } from 'progress-events';
|
|
3
|
+
export declare const DEFAULT_TRUSTLESS_GATEWAYS: string[];
|
|
4
|
+
export type TrustlessGatewayGetBlockProgressEvents = ProgressEvent<'trustless-gateway:get-block:fetch', URL>;
|
|
5
|
+
export interface TrustlessGatewayBlockBrokerInit {
|
|
6
|
+
gateways?: Array<string | URL>;
|
|
7
|
+
}
|
|
8
|
+
export declare function trustlessGateway(init?: TrustlessGatewayBlockBrokerInit): () => BlockRetriever;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-gateway/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,eAAO,MAAM,0BAA0B,UAYtC,CAAA;AAED,MAAM,MAAM,sCAAsC,GAChD,aAAa,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAA;AAEzD,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;CAC/B;AAED,wBAAgB,gBAAgB,CAAE,IAAI,GAAE,+BAAoC,GAAG,MAAM,cAAc,CAElG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TrustlessGatewayBlockBroker } from './broker.js';
|
|
2
|
+
export const DEFAULT_TRUSTLESS_GATEWAYS = [
|
|
3
|
+
// 2023-10-03: IPNS, Origin, and Block/CAR support from https://ipfs-public-gateway-checker.on.fleek.co/
|
|
4
|
+
'https://dweb.link',
|
|
5
|
+
// 2023-10-03: IPNS, Origin, and Block/CAR support from https://ipfs-public-gateway-checker.on.fleek.co/
|
|
6
|
+
'https://cf-ipfs.com',
|
|
7
|
+
// 2023-10-03: IPNS, Origin, and Block/CAR support from https://ipfs-public-gateway-checker.on.fleek.co/
|
|
8
|
+
'https://4everland.io',
|
|
9
|
+
// 2023-10-03: IPNS, Origin, and Block/CAR support from https://ipfs-public-gateway-checker.on.fleek.co/
|
|
10
|
+
'https://w3s.link'
|
|
11
|
+
];
|
|
12
|
+
export function trustlessGateway(init = {}) {
|
|
13
|
+
return () => new TrustlessGatewayBlockBroker(init);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,wGAAwG;IACxG,mBAAmB;IAEnB,wGAAwG;IACxG,qBAAqB;IAErB,wGAAwG;IACxG,sBAAsB;IAEtB,wGAAwG;IACxG,kBAAkB;CACnB,CAAA;AASD,MAAM,UAAU,gBAAgB,CAAE,OAAwC,EAAE;IAC1E,OAAO,GAAG,EAAE,CAAC,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CID } from 'multiformats/cid';
|
|
2
|
+
/**
|
|
3
|
+
* A `TrustlessGateway` keeps track of the number of attempts, errors, and
|
|
4
|
+
* successes for a given gateway url so that we can prioritize gateways that
|
|
5
|
+
* have been more reliable in the past, and ensure that requests are distributed
|
|
6
|
+
* across all gateways within a given `TrustlessGatewayBlockBroker` instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TrustlessGateway {
|
|
9
|
+
#private;
|
|
10
|
+
readonly url: URL;
|
|
11
|
+
constructor(url: URL | string);
|
|
12
|
+
/**
|
|
13
|
+
* Fetch a raw block from `this.url` following the specification defined at
|
|
14
|
+
* https://specs.ipfs.tech/http-gateways/trustless-gateway/
|
|
15
|
+
*/
|
|
16
|
+
getRawBlock(cid: CID, signal?: AbortSignal): Promise<Uint8Array>;
|
|
17
|
+
/**
|
|
18
|
+
* Encapsulate the logic for determining whether a gateway is considered
|
|
19
|
+
* reliable, for prioritization. This is based on the number of successful attempts made
|
|
20
|
+
* and the number of errors encountered.
|
|
21
|
+
*
|
|
22
|
+
* Unused gateways have 100% reliability; They will be prioritized over
|
|
23
|
+
* gateways with a 100% success rate to ensure that we attempt all gateways.
|
|
24
|
+
*/
|
|
25
|
+
reliability(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Increment the number of invalid blocks returned by this gateway.
|
|
28
|
+
*/
|
|
29
|
+
incrementInvalidBlocks(): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=trustless-gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustless-gateway.d.ts","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-gateway/trustless-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;;;;GAKG;AACH,qBAAa,gBAAgB;;IAC3B,SAAgB,GAAG,EAAE,GAAG,CAAA;gBA6BX,GAAG,EAAE,GAAG,GAAG,MAAM;IAI9B;;;OAGG;IACG,WAAW,CAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAwCvE;;;;;;;OAOG;IACH,WAAW,IAAK,MAAM;IAyBtB;;OAEG;IACH,sBAAsB,IAAK,IAAI;CAGhC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `TrustlessGateway` keeps track of the number of attempts, errors, and
|
|
3
|
+
* successes for a given gateway url so that we can prioritize gateways that
|
|
4
|
+
* have been more reliable in the past, and ensure that requests are distributed
|
|
5
|
+
* across all gateways within a given `TrustlessGatewayBlockBroker` instance.
|
|
6
|
+
*/
|
|
7
|
+
export class TrustlessGateway {
|
|
8
|
+
url;
|
|
9
|
+
/**
|
|
10
|
+
* The number of times this gateway has been attempted to be used to fetch a
|
|
11
|
+
* block. This includes successful, errored, and aborted attempts. By counting
|
|
12
|
+
* even aborted attempts, slow gateways that are out-raced by others will be
|
|
13
|
+
* considered less reliable.
|
|
14
|
+
*/
|
|
15
|
+
#attempts = 0;
|
|
16
|
+
/**
|
|
17
|
+
* The number of times this gateway has errored while attempting to fetch a
|
|
18
|
+
* block. This includes `response.ok === false` and any other errors that
|
|
19
|
+
* throw while attempting to fetch a block. This does not include aborted
|
|
20
|
+
* attempts.
|
|
21
|
+
*/
|
|
22
|
+
#errors = 0;
|
|
23
|
+
/**
|
|
24
|
+
* The number of times this gateway has returned an invalid block. A gateway
|
|
25
|
+
* that returns the wrong blocks for a CID should be considered for removal
|
|
26
|
+
* from the list of gateways to fetch blocks from.
|
|
27
|
+
*/
|
|
28
|
+
#invalidBlocks = 0;
|
|
29
|
+
/**
|
|
30
|
+
* The number of times this gateway has successfully fetched a block.
|
|
31
|
+
*/
|
|
32
|
+
#successes = 0;
|
|
33
|
+
constructor(url) {
|
|
34
|
+
this.url = url instanceof URL ? url : new URL(url);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Fetch a raw block from `this.url` following the specification defined at
|
|
38
|
+
* https://specs.ipfs.tech/http-gateways/trustless-gateway/
|
|
39
|
+
*/
|
|
40
|
+
async getRawBlock(cid, signal) {
|
|
41
|
+
const gwUrl = this.url;
|
|
42
|
+
gwUrl.pathname = `/ipfs/${cid.toString()}`;
|
|
43
|
+
// necessary as not every gateway supports dag-cbor, but every should support
|
|
44
|
+
// sending raw block as-is
|
|
45
|
+
gwUrl.search = '?format=raw';
|
|
46
|
+
if (signal?.aborted === true) {
|
|
47
|
+
throw new Error(`Signal to fetch raw block for CID ${cid} from gateway ${this.url} was aborted prior to fetch`);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
this.#attempts++;
|
|
51
|
+
const res = await fetch(gwUrl.toString(), {
|
|
52
|
+
signal,
|
|
53
|
+
headers: {
|
|
54
|
+
// also set header, just in case ?format= is filtered out by some
|
|
55
|
+
// reverse proxy
|
|
56
|
+
Accept: 'application/vnd.ipld.raw'
|
|
57
|
+
},
|
|
58
|
+
cache: 'force-cache'
|
|
59
|
+
});
|
|
60
|
+
if (!res.ok) {
|
|
61
|
+
this.#errors++;
|
|
62
|
+
throw new Error(`unable to fetch raw block for CID ${cid} from gateway ${this.url}`);
|
|
63
|
+
}
|
|
64
|
+
this.#successes++;
|
|
65
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
66
|
+
}
|
|
67
|
+
catch (cause) {
|
|
68
|
+
// @ts-expect-error - TS thinks signal?.aborted can only be false now
|
|
69
|
+
// because it was checked for true above.
|
|
70
|
+
if (signal?.aborted === true) {
|
|
71
|
+
throw new Error(`fetching raw block for CID ${cid} from gateway ${this.url} was aborted`);
|
|
72
|
+
}
|
|
73
|
+
this.#errors++;
|
|
74
|
+
throw new Error(`unable to fetch raw block for CID ${cid}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Encapsulate the logic for determining whether a gateway is considered
|
|
79
|
+
* reliable, for prioritization. This is based on the number of successful attempts made
|
|
80
|
+
* and the number of errors encountered.
|
|
81
|
+
*
|
|
82
|
+
* Unused gateways have 100% reliability; They will be prioritized over
|
|
83
|
+
* gateways with a 100% success rate to ensure that we attempt all gateways.
|
|
84
|
+
*/
|
|
85
|
+
reliability() {
|
|
86
|
+
/**
|
|
87
|
+
* if we have never tried to use this gateway, it is considered the most
|
|
88
|
+
* reliable until we determine otherwise (prioritize unused gateways)
|
|
89
|
+
*/
|
|
90
|
+
if (this.#attempts === 0) {
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
if (this.#invalidBlocks > 0) {
|
|
94
|
+
// this gateway may not be trustworthy..
|
|
95
|
+
return -Infinity;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* We have attempted the gateway, so we need to calculate the reliability
|
|
99
|
+
* based on the number of attempts, errors, and successes. Gateways that
|
|
100
|
+
* return a single error should drop their reliability score more than a
|
|
101
|
+
* single success increases it.
|
|
102
|
+
*
|
|
103
|
+
* Play around with the below reliability function at https://www.desmos.com/calculator/d6hfhf5ukm
|
|
104
|
+
*/
|
|
105
|
+
return this.#successes / (this.#attempts + (this.#errors * 3));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Increment the number of invalid blocks returned by this gateway.
|
|
109
|
+
*/
|
|
110
|
+
incrementInvalidBlocks() {
|
|
111
|
+
this.#invalidBlocks++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=trustless-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustless-gateway.js","sourceRoot":"","sources":["../../../../src/block-brokers/trustless-gateway/trustless-gateway.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IACX,GAAG,CAAK;IACxB;;;;;OAKG;IACH,SAAS,GAAG,CAAC,CAAA;IAEb;;;;;OAKG;IACH,OAAO,GAAG,CAAC,CAAA;IAEX;;;;OAIG;IACH,cAAc,GAAG,CAAC,CAAA;IAElB;;OAEG;IACH,UAAU,GAAG,CAAC,CAAA;IAEd,YAAa,GAAiB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;IACpD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAE,GAAQ,EAAE,MAAoB;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAA;QACtB,KAAK,CAAC,QAAQ,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAA;QAE1C,6EAA6E;QAC7E,0BAA0B;QAC1B,KAAK,CAAC,MAAM,GAAG,aAAa,CAAA;QAE5B,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,qCAAqC,GAAG,iBAAiB,IAAI,CAAC,GAAG,6BAA6B,CAAC,CAAA;SAChH;QAED,IAAI;YACF,IAAI,CAAC,SAAS,EAAE,CAAA;YAChB,MAAM,GAAG,GAAG,MA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
package/dist/src/helia.d.ts
CHANGED
package/dist/src/helia.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helia.d.ts","sourceRoot":"","sources":["../../src/helia.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helia.d.ts","sourceRoot":"","sources":["../../src/helia.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,CAAA;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAKpD,UAAU,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACrE,MAAM,EAAE,CAAC,CAAA;IACT,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;CACrB;AAED,qBAAa,SAAU,YAAW,KAAK;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,YAAY,CAAA;IACxB,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,IAAI,CAAA;gBAEJ,IAAI,EAAE,aAAa;IA+B1B,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAMvB,IAAI,IAAK,OAAO,CAAC,IAAI,CAAC;IAKtB,EAAE,CAAE,OAAO,GAAE,SAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+BlD"}
|
package/dist/src/helia.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { start, stop } from '@libp2p/interface/startable';
|
|
1
2
|
import { logger } from '@libp2p/logger';
|
|
2
|
-
import { createBitswap } from 'ipfs-bitswap';
|
|
3
3
|
import drain from 'it-drain';
|
|
4
|
-
import { identity } from 'multiformats/hashes/identity';
|
|
5
|
-
import { sha256, sha512 } from 'multiformats/hashes/sha2';
|
|
6
4
|
import { CustomProgressEvent } from 'progress-events';
|
|
5
|
+
import { bitswap, trustlessGateway } from './block-brokers/index.js';
|
|
7
6
|
import { PinsImpl } from './pins.js';
|
|
8
7
|
import { BlockStorage } from './storage.js';
|
|
9
8
|
import { assertDatastoreVersionIsCurrent } from './utils/datastore-version.js';
|
|
9
|
+
import { defaultHashers } from './utils/default-hashers.js';
|
|
10
10
|
import { NetworkedStorage } from './utils/networked-storage.js';
|
|
11
11
|
const log = logger('helia');
|
|
12
12
|
export class HeliaImpl {
|
|
@@ -14,29 +14,23 @@ export class HeliaImpl {
|
|
|
14
14
|
blockstore;
|
|
15
15
|
datastore;
|
|
16
16
|
pins;
|
|
17
|
-
#bitswap;
|
|
18
17
|
constructor(init) {
|
|
19
|
-
const hashers =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const hashers = defaultHashers(init.hashers);
|
|
19
|
+
const components = {
|
|
20
|
+
blockstore: init.blockstore,
|
|
21
|
+
datastore: init.datastore,
|
|
22
|
+
libp2p: init.libp2p,
|
|
23
|
+
hashers
|
|
24
|
+
};
|
|
25
|
+
const blockBrokers = init.blockBrokers?.map((fn) => {
|
|
26
|
+
return fn(components);
|
|
27
|
+
}) ?? [
|
|
28
|
+
bitswap()(components),
|
|
29
|
+
trustlessGateway()()
|
|
24
30
|
];
|
|
25
|
-
this.#bitswap = createBitswap(init.libp2p, init.blockstore, {
|
|
26
|
-
hashLoader: {
|
|
27
|
-
getHasher: async (codecOrName) => {
|
|
28
|
-
const hasher = hashers.find(hasher => {
|
|
29
|
-
return hasher.code === codecOrName || hasher.name === codecOrName;
|
|
30
|
-
});
|
|
31
|
-
if (hasher != null) {
|
|
32
|
-
return hasher;
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`Could not load hasher for code/name "${codecOrName}"`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
31
|
const networkedStorage = new NetworkedStorage(init.blockstore, {
|
|
39
|
-
|
|
32
|
+
blockBrokers,
|
|
33
|
+
hashers
|
|
40
34
|
});
|
|
41
35
|
this.pins = new PinsImpl(init.datastore, networkedStorage, init.dagWalkers ?? []);
|
|
42
36
|
this.libp2p = init.libp2p;
|
|
@@ -47,12 +41,12 @@ export class HeliaImpl {
|
|
|
47
41
|
}
|
|
48
42
|
async start() {
|
|
49
43
|
await assertDatastoreVersionIsCurrent(this.datastore);
|
|
50
|
-
await
|
|
44
|
+
await start(this.blockstore);
|
|
51
45
|
await this.libp2p.start();
|
|
52
46
|
}
|
|
53
47
|
async stop() {
|
|
54
48
|
await this.libp2p.stop();
|
|
55
|
-
await
|
|
49
|
+
await stop(this.blockstore);
|
|
56
50
|
}
|
|
57
51
|
async gc(options = {}) {
|
|
58
52
|
const releaseLock = await this.blockstore.lock.writeLock();
|
package/dist/src/helia.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helia.js","sourceRoot":"","sources":["../../src/helia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helia.js","sourceRoot":"","sources":["../../src/helia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;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AO,CAAC,UAAU,EAAE,CAAC,IAAI,mBAAmB,CAAQ,gBAAgB,EAAE,GAAG,CAAC,CAAC,CAAA;qBAC5E;iBACF;YACH,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;SACP;gBAAS;YACR,WAAW,EAAE,CAAA;SACd;QAED,GAAG,CAAC,aAAa,CAAC,CAAA;IACpB,CAAC;CACF"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Exports a `createHelia` function that returns an object that implements the {@link Helia} API.
|
|
5
|
+
*
|
|
6
|
+
* Pass it to other modules like {@link https://www.npmjs.com/package/@helia/unixfs | @helia/unixfs} to make files available on the distributed web.
|
|
5
7
|
*
|
|
6
8
|
* @example
|
|
7
9
|
*
|
|
8
10
|
* ```typescript
|
|
9
|
-
* import { MemoryDatastore } from 'datastore-core'
|
|
10
|
-
* import { MemoryBlockstore } from 'blockstore-core'
|
|
11
11
|
* import { createHelia } from 'helia'
|
|
12
12
|
* import { unixfs } from '@helia/unixfs'
|
|
13
13
|
* import { CID } from 'multiformats/cid'
|
|
14
14
|
*
|
|
15
|
-
* const
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* })
|
|
19
|
-
* const fs = unixfs(node)
|
|
15
|
+
* const helia = await createHelia()
|
|
16
|
+
*
|
|
17
|
+
* const fs = unixfs(helia)
|
|
20
18
|
* fs.cat(CID.parse('bafyFoo'))
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
21
|
import type { DefaultLibp2pServices } from './utils/libp2p-defaults.js';
|
|
24
22
|
import type { Helia } from '@helia/interface';
|
|
23
|
+
import type { BlockBroker } from '@helia/interface/blocks';
|
|
25
24
|
import type { Libp2p } from '@libp2p/interface';
|
|
26
25
|
import type { Blockstore } from 'interface-blockstore';
|
|
27
26
|
import type { Datastore } from 'interface-datastore';
|
|
@@ -36,7 +35,7 @@ export * from '@helia/interface/pins';
|
|
|
36
35
|
*/
|
|
37
36
|
export interface DAGWalker {
|
|
38
37
|
codec: number;
|
|
39
|
-
walk
|
|
38
|
+
walk(block: Uint8Array): AsyncGenerator<CID, void, undefined>;
|
|
40
39
|
}
|
|
41
40
|
/**
|
|
42
41
|
* Options used to create a Helia node.
|
|
@@ -72,6 +71,11 @@ export interface HeliaInit<T extends Libp2p = Libp2p> {
|
|
|
72
71
|
* encoded within that block.
|
|
73
72
|
*/
|
|
74
73
|
dagWalkers?: DAGWalker[];
|
|
74
|
+
/**
|
|
75
|
+
* A list of strategies used to fetch blocks when they are not present in
|
|
76
|
+
* the local blockstore
|
|
77
|
+
*/
|
|
78
|
+
blockBrokers?: Array<(components: any) => BlockBroker>;
|
|
75
79
|
/**
|
|
76
80
|
* Pass `false` to not start the Helia node
|
|
77
81
|
*/
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB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,22 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Exports a `createHelia` function that returns an object that implements the {@link Helia} API.
|
|
5
|
+
*
|
|
6
|
+
* Pass it to other modules like {@link https://www.npmjs.com/package/@helia/unixfs | @helia/unixfs} to make files available on the distributed web.
|
|
5
7
|
*
|
|
6
8
|
* @example
|
|
7
9
|
*
|
|
8
10
|
* ```typescript
|
|
9
|
-
* import { MemoryDatastore } from 'datastore-core'
|
|
10
|
-
* import { MemoryBlockstore } from 'blockstore-core'
|
|
11
11
|
* import { createHelia } from 'helia'
|
|
12
12
|
* import { unixfs } from '@helia/unixfs'
|
|
13
13
|
* import { CID } from 'multiformats/cid'
|
|
14
14
|
*
|
|
15
|
-
* const
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* })
|
|
19
|
-
* const fs = unixfs(node)
|
|
15
|
+
* const helia = await createHelia()
|
|
16
|
+
*
|
|
17
|
+
* const fs = unixfs(helia)
|
|
20
18
|
* fs.cat(CID.parse('bafyFoo'))
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,OAAO,EA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AAC,CAAC,KAAK,UAAU,CAAC,CAAA;AACvD,CAAC;AAED,SAAS,sBAAsB,CAAE,KAAiB;IAChD,6BAA6B;IAC7B,IAAI;QACF,MAAM,oBAAoB,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAA;QAE7E,IAAI,oBAAoB,CAAC,KAAK,CAAC,sCAAsC,CAAC,IAAI,IAAI,EAAE;YAC9E,qCAAqC;YACrC,OAAM;SACP;QAED,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,GAAG,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;KAC5H;IAAC,OAAO,GAAG,EAAE;QACZ,GAAG,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAA;KACvD;AACH,CAAC"}
|
package/dist/src/storage.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Startable } from '@libp2p/interface/startable';
|
|
1
2
|
import type { Blocks, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions } from '@helia/interface/blocks';
|
|
2
3
|
import type { Pins } from '@helia/interface/pins';
|
|
3
4
|
import type { AbortOptions } from '@libp2p/interface';
|
|
@@ -10,21 +11,25 @@ export interface BlockStorageInit {
|
|
|
10
11
|
holdGcLock?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export interface GetOptions extends AbortOptions {
|
|
13
|
-
progress
|
|
14
|
+
progress?(evt: Event): void;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* BlockStorage is a hybrid blockstore that puts/gets blocks from a configured
|
|
17
18
|
* blockstore (that may be on disk, s3, or something else). If the blocks are
|
|
18
19
|
* not present Bitswap will be used to fetch them from network peers.
|
|
19
20
|
*/
|
|
20
|
-
export declare class BlockStorage implements Blocks {
|
|
21
|
+
export declare class BlockStorage implements Blocks, Startable {
|
|
21
22
|
lock: Mortice;
|
|
22
23
|
private readonly child;
|
|
23
24
|
private readonly pins;
|
|
25
|
+
private started;
|
|
24
26
|
/**
|
|
25
27
|
* Create a new BlockStorage
|
|
26
28
|
*/
|
|
27
29
|
constructor(blockstore: Blockstore, pins: Pins, options?: BlockStorageInit);
|
|
30
|
+
isStarted(): boolean;
|
|
31
|
+
start(): Promise<void>;
|
|
32
|
+
stop(): Promise<void>;
|
|
28
33
|
unwrap(): Blockstore;
|
|
29
34
|
/**
|
|
30
35
|
* Put a block to the underlying datastore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC/Q,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA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