@helia/interop 5.0.0-8a5bc6f → 5.0.0-917a1bc
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 +2 -0
- package/dist/src/ipns-pubsub.spec.js +1 -1
- package/dist/src/ipns-pubsub.spec.js.map +1 -1
- package/package.json +31 -32
- package/src/ipns-pubsub.spec.ts +1 -1
- package/dist/src/verified-fetch-json.spec.d.ts +0 -2
- package/dist/src/verified-fetch-json.spec.d.ts.map +0 -1
- package/dist/src/verified-fetch-json.spec.js +0 -44
- package/dist/src/verified-fetch-json.spec.js.map +0 -1
- package/dist/src/verified-fetch-unixfs-dir.spec.d.ts +0 -2
- package/dist/src/verified-fetch-unixfs-dir.spec.d.ts.map +0 -1
- package/dist/src/verified-fetch-unixfs-dir.spec.js +0 -67
- package/dist/src/verified-fetch-unixfs-dir.spec.js.map +0 -1
- package/dist/src/verified-fetch-websites.spec.d.ts +0 -2
- package/dist/src/verified-fetch-websites.spec.d.ts.map +0 -1
- package/dist/src/verified-fetch-websites.spec.js +0 -78
- package/dist/src/verified-fetch-websites.spec.js.map +0 -1
- package/src/verified-fetch-json.spec.ts +0 -48
- package/src/verified-fetch-unixfs-dir.spec.ts +0 -76
- package/src/verified-fetch-websites.spec.ts +0 -87
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
+
# @helia/interop
|
|
8
|
+
|
|
7
9
|
[](https://ipfs.tech)
|
|
8
10
|
[](https://discuss.ipfs.tech)
|
|
9
11
|
[](https://codecov.io/gh/ipfs/helia)
|
|
@@ -63,7 +63,7 @@ keyTypes.filter(keyType => keyType !== 'RSA').forEach(keyType => {
|
|
|
63
63
|
}
|
|
64
64
|
// first publish should fail because kubo isn't subscribed to key update channel
|
|
65
65
|
await expect(name.publish(peerId, cid)).to.eventually.be.rejected()
|
|
66
|
-
.with.property('message', 'PublishError.
|
|
66
|
+
.with.property('message', 'PublishError.NoPeersSubscribedToTopic');
|
|
67
67
|
// should fail to resolve the first time as kubo was not subscribed to the pubsub channel
|
|
68
68
|
// @ts-expect-error kubo deps are out of date
|
|
69
69
|
await expect(last(kubo.api.name.resolve(peerId, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipns-pubsub.spec.js","sourceRoot":"","sources":["../../src/ipns-pubsub.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,+CAA+C;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,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AAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/interop",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-917a1bc",
|
|
4
4
|
"description": "Interop tests for Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/interop#readme",
|
|
@@ -57,45 +57,44 @@
|
|
|
57
57
|
"test:electron-main": "aegir test -t electron-main"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@chainsafe/libp2p-gossipsub": "^
|
|
61
|
-
"@helia/block-brokers": "2.0.1-
|
|
62
|
-
"@helia/car": "3.0.0-
|
|
63
|
-
"@helia/dag-cbor": "3.0.0-
|
|
64
|
-
"@helia/dag-json": "3.0.0-
|
|
65
|
-
"@helia/http": "1.0.1-
|
|
66
|
-
"@helia/interface": "4.0.0-
|
|
67
|
-
"@helia/ipns": "6.0.0-
|
|
68
|
-
"@helia/json": "3.0.0-
|
|
69
|
-
"@helia/mfs": "3.0.0-
|
|
70
|
-
"@helia/routers": "1.0.0-
|
|
71
|
-
"@helia/strings": "3.0.0-
|
|
72
|
-
"@helia/unixfs": "3.0.0-
|
|
73
|
-
"@
|
|
74
|
-
"@ipld/
|
|
75
|
-
"@
|
|
76
|
-
"@libp2p/
|
|
77
|
-
"@libp2p/
|
|
78
|
-
"@libp2p/
|
|
79
|
-
"@libp2p/peer-id": "^4.0.
|
|
80
|
-
"@libp2p/
|
|
81
|
-
"@
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"helia": "4.0.1-8a5bc6f",
|
|
60
|
+
"@chainsafe/libp2p-gossipsub": "^13.0.0",
|
|
61
|
+
"@helia/block-brokers": "2.0.1-917a1bc",
|
|
62
|
+
"@helia/car": "3.0.0-917a1bc",
|
|
63
|
+
"@helia/dag-cbor": "3.0.0-917a1bc",
|
|
64
|
+
"@helia/dag-json": "3.0.0-917a1bc",
|
|
65
|
+
"@helia/http": "1.0.1-917a1bc",
|
|
66
|
+
"@helia/interface": "4.0.0-917a1bc",
|
|
67
|
+
"@helia/ipns": "6.0.0-917a1bc",
|
|
68
|
+
"@helia/json": "3.0.0-917a1bc",
|
|
69
|
+
"@helia/mfs": "3.0.0-917a1bc",
|
|
70
|
+
"@helia/routers": "1.0.0-917a1bc",
|
|
71
|
+
"@helia/strings": "3.0.0-917a1bc",
|
|
72
|
+
"@helia/unixfs": "3.0.0-917a1bc",
|
|
73
|
+
"@ipld/car": "^5.3.0",
|
|
74
|
+
"@ipld/dag-cbor": "^9.2.0",
|
|
75
|
+
"@libp2p/interface": "^1.1.4",
|
|
76
|
+
"@libp2p/kad-dht": "^12.0.8",
|
|
77
|
+
"@libp2p/keychain": "^4.0.9",
|
|
78
|
+
"@libp2p/peer-id": "^4.0.7",
|
|
79
|
+
"@libp2p/peer-id-factory": "^4.0.7",
|
|
80
|
+
"@libp2p/websockets": "^8.0.16",
|
|
81
|
+
"@multiformats/sha3": "^3.0.2",
|
|
82
|
+
"aegir": "^42.2.5",
|
|
83
|
+
"helia": "4.0.1-917a1bc",
|
|
85
84
|
"ipfs-core-types": "^0.14.1",
|
|
86
|
-
"ipfs-unixfs-importer": "^15.2.
|
|
85
|
+
"ipfs-unixfs-importer": "^15.2.4",
|
|
87
86
|
"ipfsd-ctl": "^13.0.0",
|
|
88
87
|
"it-all": "^3.0.4",
|
|
89
88
|
"it-drain": "^3.0.5",
|
|
90
89
|
"it-last": "^3.0.4",
|
|
91
90
|
"it-map": "^3.0.5",
|
|
92
|
-
"it-to-buffer": "^4.0.
|
|
91
|
+
"it-to-buffer": "^4.0.5",
|
|
93
92
|
"kubo": "^0.26.0",
|
|
94
|
-
"kubo-rpc-client": "^3.0.
|
|
95
|
-
"libp2p": "^1.2.
|
|
96
|
-
"multiformats": "^13.
|
|
93
|
+
"kubo-rpc-client": "^3.0.3",
|
|
94
|
+
"libp2p": "^1.2.4",
|
|
95
|
+
"multiformats": "^13.1.0",
|
|
97
96
|
"p-defer": "^4.0.0",
|
|
98
|
-
"uint8arrays": "^5.0.
|
|
97
|
+
"uint8arrays": "^5.0.2",
|
|
99
98
|
"wherearewe": "^2.0.1"
|
|
100
99
|
},
|
|
101
100
|
"browser": {
|
package/src/ipns-pubsub.spec.ts
CHANGED
|
@@ -80,7 +80,7 @@ keyTypes.filter(keyType => keyType !== 'RSA').forEach(keyType => {
|
|
|
80
80
|
|
|
81
81
|
// first publish should fail because kubo isn't subscribed to key update channel
|
|
82
82
|
await expect(name.publish(peerId, cid)).to.eventually.be.rejected()
|
|
83
|
-
.with.property('message', 'PublishError.
|
|
83
|
+
.with.property('message', 'PublishError.NoPeersSubscribedToTopic')
|
|
84
84
|
|
|
85
85
|
// should fail to resolve the first time as kubo was not subscribed to the pubsub channel
|
|
86
86
|
// @ts-expect-error kubo deps are out of date
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-json.spec.d.ts","sourceRoot":"","sources":["../../src/verified-fetch-json.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch';
|
|
3
|
-
import { expect } from 'aegir/chai';
|
|
4
|
-
import { CID } from 'multiformats/cid';
|
|
5
|
-
import { createKuboNode } from './fixtures/create-kubo.js';
|
|
6
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js';
|
|
7
|
-
describe('@helia/verified-fetch - json', () => {
|
|
8
|
-
describe('unixfs - multiblock', () => {
|
|
9
|
-
let controller;
|
|
10
|
-
let verifiedFetch;
|
|
11
|
-
before(async () => {
|
|
12
|
-
controller = await createKuboNode();
|
|
13
|
-
await controller.start();
|
|
14
|
-
// As of 2024-01-18, https://cloudflare-ipfs.com/ipns/tokens.uniswap.org resolves to:
|
|
15
|
-
// root: QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr
|
|
16
|
-
// child1: QmNik5N4ryNwzzXYq5hCYKGcRjAf9QtigxtiJh9o8aXXbG // partial JSON
|
|
17
|
-
// child2: QmWNBJX6fZyNTLWNYBHxAHpBctCP43R2zeqV2G8uavqFZn // partial JSON
|
|
18
|
-
await loadFixtureDataCar(controller, 'QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr-tokens.uniswap.org-2024-01-18.car');
|
|
19
|
-
verifiedFetch = await createVerifiedFetch({
|
|
20
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
21
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
22
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
after(async () => {
|
|
26
|
-
await controller.stop();
|
|
27
|
-
await verifiedFetch.stop();
|
|
28
|
-
});
|
|
29
|
-
it('handles UnixFS-chunked JSON file', async () => {
|
|
30
|
-
const resp = await verifiedFetch(CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'));
|
|
31
|
-
expect(resp).to.be.ok();
|
|
32
|
-
const jsonObj = await resp.json();
|
|
33
|
-
expect(jsonObj).to.be.ok();
|
|
34
|
-
expect(jsonObj).to.have.property('name').equal('Uniswap Labs Default');
|
|
35
|
-
expect(jsonObj).to.have.property('timestamp').equal('2023-12-13T18:25:25.830Z');
|
|
36
|
-
expect(jsonObj).to.have.property('version').to.deep.equal({ major: 11, minor: 11, patch: 0 });
|
|
37
|
-
expect(jsonObj).to.have.property('tags');
|
|
38
|
-
expect(jsonObj).to.have.property('logoURI').equal('ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir');
|
|
39
|
-
expect(jsonObj).to.have.property('keywords').to.deep.equal(['uniswap', 'default']);
|
|
40
|
-
expect(jsonObj.tokens).to.be.an('array').of.length(767);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=verified-fetch-json.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-json.spec.js","sourceRoot":"","sources":["../../src/verified-fetch-json.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAGpE,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,IAAI,UAA4B,CAAA;QAChC,IAAI,aAA8D,CAAA;QAElE,MAAM,CAAC,KAAK,IAAI,EAAE;YAChB,UAAU,GAAG,MAAM,cAAc,EAAE,CAAA;YACnC,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;YACxB,qFAAqF;YACrF,uDAAuD;YACvD,yEAAyE;YACzE,yEAAyE;YACzE,MAAM,kBAAkB,CAAC,UAAU,EAAE,kFAAkF,CAAC,CAAA;YACxH,aAAa,GAAG,MAAM,mBAAmB,CAAC;gBACxC,QAAQ,EAAE,CAAC,UAAU,UAAU,CAAC,GAAG,CAAC,WAAW,IAAI,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBAChF,gJAAgJ;gBAChJ,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,UAAU,CAAC,GAAG,CAA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AAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAA;YAC1G,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;YAClF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACzD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-unixfs-dir.spec.d.ts","sourceRoot":"","sources":["../../src/verified-fetch-unixfs-dir.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch';
|
|
3
|
-
import { expect } from 'aegir/chai';
|
|
4
|
-
import { createKuboNode } from './fixtures/create-kubo.js';
|
|
5
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js';
|
|
6
|
-
describe('@helia/verified-fetch - unixfs directory', () => {
|
|
7
|
-
let controller;
|
|
8
|
-
let verifiedFetch;
|
|
9
|
-
before(async () => {
|
|
10
|
-
controller = await createKuboNode();
|
|
11
|
-
await controller.start();
|
|
12
|
-
verifiedFetch = await createVerifiedFetch({
|
|
13
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
14
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
15
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
after(async () => {
|
|
19
|
-
await controller.stop();
|
|
20
|
-
await verifiedFetch.stop();
|
|
21
|
-
});
|
|
22
|
-
describe('XKCD Barrel Part 1', () => {
|
|
23
|
-
before(async () => {
|
|
24
|
-
// This is the content of https://explore.ipld.io/#/explore/QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm/1%20-%20Barrel%20-%20Part%201
|
|
25
|
-
await loadFixtureDataCar(controller, 'QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR-xkcd-Barrel-part-1.car');
|
|
26
|
-
});
|
|
27
|
-
it('fails to load when passed the root', async () => {
|
|
28
|
-
// The spec says we should generate HTML with directory listings, but we don't do that yet, so expect a failure
|
|
29
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR');
|
|
30
|
-
expect(resp).to.be.ok();
|
|
31
|
-
expect(resp.status).to.equal(501); // TODO: we should do a directory listing instead
|
|
32
|
-
});
|
|
33
|
-
it('can return a string for unixfs pathed data', async () => {
|
|
34
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR/1 - Barrel - Part 1 - alt.txt');
|
|
35
|
-
expect(resp).to.be.ok();
|
|
36
|
-
const text = await resp.text();
|
|
37
|
-
expect(text).to.equal('Don\'t we all.');
|
|
38
|
-
expect(resp.headers.get('content-type')).to.equal('text/plain');
|
|
39
|
-
});
|
|
40
|
-
it('can return an image for unixfs pathed data', async () => {
|
|
41
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR/1 - Barrel - Part 1.png');
|
|
42
|
-
expect(resp).to.be.ok();
|
|
43
|
-
expect(resp.headers.get('content-type')).to.equal('image/png');
|
|
44
|
-
const imgData = await resp.blob();
|
|
45
|
-
expect(imgData).to.be.ok();
|
|
46
|
-
expect(imgData.size).to.equal(24848);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
// TODO: find a smaller car file so the test doesn't timeout locally or flake on CI
|
|
50
|
-
describe.skip('HAMT-sharded directory', () => {
|
|
51
|
-
before(async () => {
|
|
52
|
-
// from https://github.com/ipfs/gateway-conformance/blob/193833b91f2e9b17daf45c84afaeeae61d9d7c7e/fixtures/trustless_gateway_car/single-layer-hamt-with-multi-block-files.car
|
|
53
|
-
await loadFixtureDataCar(controller, 'bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i-single-layer-hamt-with-multi-block-files.car');
|
|
54
|
-
});
|
|
55
|
-
it('loads path /ipfs/bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt', async () => {
|
|
56
|
-
const resp = await verifiedFetch('ipfs://bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt');
|
|
57
|
-
expect(resp).to.be.ok();
|
|
58
|
-
expect(resp.headers.get('content-type')).to.equal('text/plain');
|
|
59
|
-
const text = await resp.text();
|
|
60
|
-
// npx kubo@0.25.0 cat '/ipfs/bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt'
|
|
61
|
-
expect(text).to.equal(`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc non imperdiet nunc. Proin ac quam ut nibh eleifend aliquet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed ligula dolor, imperdiet sagittis arcu et, semper tincidunt urna. Donec et tempor augue, quis sollicitudin metus. Curabitur semper ullamcorper aliquet. Mauris hendrerit sodales lectus eget fermentum. Proin sollicitudin vestibulum commodo. Vivamus nec lectus eu augue aliquet dignissim nec condimentum justo. In hac habitasse platea dictumst. Mauris vel sem neque.
|
|
62
|
-
|
|
63
|
-
Vivamus finibus, enim at lacinia semper, arcu erat gravida lacus, sit amet gravida magna orci sit amet est. Sed non leo lacus. Nullam viverra ipsum a tincidunt dapibus. Nulla pulvinar ligula sit amet ante ultrices tempus. Proin purus urna, semper sed lobortis quis, gravida vitae ipsum. Aliquam mi urna, pulvinar eu bibendum quis, convallis ac dolor. In gravida justo sed risus ullamcorper, vitae luctus massa hendrerit. Pellentesque habitant amet.`);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=verified-fetch-unixfs-dir.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-unixfs-dir.spec.js","sourceRoot":"","sources":["../../src/verified-fetch-unixfs-dir.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAGpE,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,IAAI,UAAsB,CAAA;IAC1B,IAAI,aAA8D,CAAA;IAElE,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,UAAU,GAAG,MAAM,cAAc,EAAE,CAAA;QACnC,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;QACxB,aAAa,GAAG,MAAM,mBAAmB,CAAC;YACxC,QAAQ,EAAE,CAAC,UAAU,UAAU,CAAC,GAAG,CAAC,WAAW,IAAI,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YAChF,gJAAgJ;YAChJ,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,UAAU,CAAC,GAAG,CAAC,WAAW,IAAI,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC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a,CAAC,CAAA;QAC9b,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-websites.spec.d.ts","sourceRoot":"","sources":["../../src/verified-fetch-websites.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch';
|
|
3
|
-
import { expect } from 'aegir/chai';
|
|
4
|
-
import { createKuboNode } from './fixtures/create-kubo.js';
|
|
5
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js';
|
|
6
|
-
describe('@helia/verified-fetch - websites', () => {
|
|
7
|
-
describe('helia-identify.on.fleek.co', () => {
|
|
8
|
-
let controller;
|
|
9
|
-
let verifiedFetch;
|
|
10
|
-
before(async () => {
|
|
11
|
-
controller = await createKuboNode();
|
|
12
|
-
await controller.start();
|
|
13
|
-
// 2024-01-22 CID for _dnslink.helia-identify.on.fleek.co
|
|
14
|
-
await loadFixtureDataCar(controller, 'QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv-helia-identify-website.car');
|
|
15
|
-
verifiedFetch = await createVerifiedFetch({
|
|
16
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
17
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
18
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
after(async () => {
|
|
22
|
-
await controller.stop();
|
|
23
|
-
await verifiedFetch.stop();
|
|
24
|
-
});
|
|
25
|
-
it('loads index.html when passed helia-identify.on.fleek.co root CID', async () => {
|
|
26
|
-
const resp = await verifiedFetch('ipfs://QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv');
|
|
27
|
-
expect(resp).to.be.ok();
|
|
28
|
-
const html = await resp.text();
|
|
29
|
-
expect(html).to.be.ok();
|
|
30
|
-
expect(html).to.include('<title>Run Identify on a remote node with Helia</title>');
|
|
31
|
-
});
|
|
32
|
-
it('loads helia-identify.on.fleek.co index.html directly ', async () => {
|
|
33
|
-
const resp = await verifiedFetch('ipfs://QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv/index.html');
|
|
34
|
-
expect(resp).to.be.ok();
|
|
35
|
-
const html = await resp.text();
|
|
36
|
-
expect(html).to.be.ok();
|
|
37
|
-
expect(html).to.include('<title>Run Identify on a remote node with Helia</title>');
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* Created on 2024-01-23. /ipns/blog.libp2p.io/index.html resolved to QmVZNGy6SPvUbvQCXXaGDdp8kvfJm9MMozjU12dyzH6hKf
|
|
43
|
-
*
|
|
44
|
-
* ```shell
|
|
45
|
-
* mkdir fake-blog.libp2p.io
|
|
46
|
-
* npx kubo@0.25.0 cat '/ipfs/QmVZNGy6SPvUbvQCXXaGDdp8kvfJm9MMozjU12dyzH6hKf' > fake-blog.libp2p.io/index.html
|
|
47
|
-
* npx kubo@0.25.0 add -r fake-blog.libp2p.io
|
|
48
|
-
* npx kubo@0.25.0 dag export QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw > QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw-fake-blog.libp2p.io.car
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
describe('fake blog.libp2p.io', () => {
|
|
52
|
-
let controller;
|
|
53
|
-
let verifiedFetch;
|
|
54
|
-
before(async () => {
|
|
55
|
-
controller = await createKuboNode();
|
|
56
|
-
await controller.start();
|
|
57
|
-
await loadFixtureDataCar(controller, 'QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw-fake-blog.libp2p.io.car');
|
|
58
|
-
verifiedFetch = await createVerifiedFetch({
|
|
59
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
60
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
61
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
after(async () => {
|
|
65
|
-
await controller.stop();
|
|
66
|
-
await verifiedFetch.stop();
|
|
67
|
-
});
|
|
68
|
-
it('loads index.html when passed fake-blog.libp2p.io root CID', async () => {
|
|
69
|
-
const resp = await verifiedFetch('ipfs://QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw');
|
|
70
|
-
expect(resp).to.be.ok();
|
|
71
|
-
const html = await resp.text();
|
|
72
|
-
expect(html).to.be.ok();
|
|
73
|
-
expect(html).to.include('<title>Home | libp2p Blog & News</title>');
|
|
74
|
-
expect(html).to.include('<link href="https://libp2p.io/" rel="canonical">');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=verified-fetch-websites.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-fetch-websites.spec.js","sourceRoot":"","sources":["../../src/verified-fetch-websites.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAGpE,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,QAAQ,C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AM,UAAU,CAAC,IAAI,EAAE,CAAA;YACvB,MAAM,aAAa,CAAC,IAAI,EAAE,CAAA;QAC5B,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;YACzE,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,uDAAuD,CAAC,CAAA;YACzF,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;YACvB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;YACvB,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAA;YACxE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAA;QAC7E,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
3
|
-
import { expect } from 'aegir/chai'
|
|
4
|
-
import { CID } from 'multiformats/cid'
|
|
5
|
-
import { createKuboNode } from './fixtures/create-kubo.js'
|
|
6
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js'
|
|
7
|
-
import type { Controller } from 'ipfsd-ctl'
|
|
8
|
-
|
|
9
|
-
describe('@helia/verified-fetch - json', () => {
|
|
10
|
-
describe('unixfs - multiblock', () => {
|
|
11
|
-
let controller: Controller<'go'>
|
|
12
|
-
let verifiedFetch: Awaited<ReturnType<typeof createVerifiedFetch>>
|
|
13
|
-
|
|
14
|
-
before(async () => {
|
|
15
|
-
controller = await createKuboNode()
|
|
16
|
-
await controller.start()
|
|
17
|
-
// As of 2024-01-18, https://cloudflare-ipfs.com/ipns/tokens.uniswap.org resolves to:
|
|
18
|
-
// root: QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr
|
|
19
|
-
// child1: QmNik5N4ryNwzzXYq5hCYKGcRjAf9QtigxtiJh9o8aXXbG // partial JSON
|
|
20
|
-
// child2: QmWNBJX6fZyNTLWNYBHxAHpBctCP43R2zeqV2G8uavqFZn // partial JSON
|
|
21
|
-
await loadFixtureDataCar(controller, 'QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr-tokens.uniswap.org-2024-01-18.car')
|
|
22
|
-
verifiedFetch = await createVerifiedFetch({
|
|
23
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
24
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
25
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
after(async () => {
|
|
30
|
-
await controller.stop()
|
|
31
|
-
await verifiedFetch.stop()
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('handles UnixFS-chunked JSON file', async () => {
|
|
35
|
-
const resp = await verifiedFetch(CID.parse('QmQJ8fxavY54CUsxMSx9aE9Rdcmvhx8awJK2jzJp4iAqCr'))
|
|
36
|
-
expect(resp).to.be.ok()
|
|
37
|
-
const jsonObj = await resp.json()
|
|
38
|
-
expect(jsonObj).to.be.ok()
|
|
39
|
-
expect(jsonObj).to.have.property('name').equal('Uniswap Labs Default')
|
|
40
|
-
expect(jsonObj).to.have.property('timestamp').equal('2023-12-13T18:25:25.830Z')
|
|
41
|
-
expect(jsonObj).to.have.property('version').to.deep.equal({ major: 11, minor: 11, patch: 0 })
|
|
42
|
-
expect(jsonObj).to.have.property('tags')
|
|
43
|
-
expect(jsonObj).to.have.property('logoURI').equal('ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir')
|
|
44
|
-
expect(jsonObj).to.have.property('keywords').to.deep.equal(['uniswap', 'default'])
|
|
45
|
-
expect(jsonObj.tokens).to.be.an('array').of.length(767)
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
})
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
3
|
-
import { expect } from 'aegir/chai'
|
|
4
|
-
import { createKuboNode } from './fixtures/create-kubo.js'
|
|
5
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js'
|
|
6
|
-
import type { Controller } from 'ipfsd-ctl'
|
|
7
|
-
|
|
8
|
-
describe('@helia/verified-fetch - unixfs directory', () => {
|
|
9
|
-
let controller: Controller
|
|
10
|
-
let verifiedFetch: Awaited<ReturnType<typeof createVerifiedFetch>>
|
|
11
|
-
|
|
12
|
-
before(async () => {
|
|
13
|
-
controller = await createKuboNode()
|
|
14
|
-
await controller.start()
|
|
15
|
-
verifiedFetch = await createVerifiedFetch({
|
|
16
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
17
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
18
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
after(async () => {
|
|
23
|
-
await controller.stop()
|
|
24
|
-
await verifiedFetch.stop()
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
describe('XKCD Barrel Part 1', () => {
|
|
28
|
-
before(async () => {
|
|
29
|
-
// This is the content of https://explore.ipld.io/#/explore/QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm/1%20-%20Barrel%20-%20Part%201
|
|
30
|
-
await loadFixtureDataCar(controller, 'QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR-xkcd-Barrel-part-1.car')
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('fails to load when passed the root', async () => {
|
|
34
|
-
// The spec says we should generate HTML with directory listings, but we don't do that yet, so expect a failure
|
|
35
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR')
|
|
36
|
-
expect(resp).to.be.ok()
|
|
37
|
-
expect(resp.status).to.equal(501) // TODO: we should do a directory listing instead
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('can return a string for unixfs pathed data', async () => {
|
|
41
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR/1 - Barrel - Part 1 - alt.txt')
|
|
42
|
-
expect(resp).to.be.ok()
|
|
43
|
-
const text = await resp.text()
|
|
44
|
-
expect(text).to.equal('Don\'t we all.')
|
|
45
|
-
expect(resp.headers.get('content-type')).to.equal('text/plain')
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('can return an image for unixfs pathed data', async () => {
|
|
49
|
-
const resp = await verifiedFetch('ipfs://QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR/1 - Barrel - Part 1.png')
|
|
50
|
-
expect(resp).to.be.ok()
|
|
51
|
-
expect(resp.headers.get('content-type')).to.equal('image/png')
|
|
52
|
-
const imgData = await resp.blob()
|
|
53
|
-
expect(imgData).to.be.ok()
|
|
54
|
-
expect(imgData.size).to.equal(24848)
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
// TODO: find a smaller car file so the test doesn't timeout locally or flake on CI
|
|
59
|
-
describe.skip('HAMT-sharded directory', () => {
|
|
60
|
-
before(async () => {
|
|
61
|
-
// from https://github.com/ipfs/gateway-conformance/blob/193833b91f2e9b17daf45c84afaeeae61d9d7c7e/fixtures/trustless_gateway_car/single-layer-hamt-with-multi-block-files.car
|
|
62
|
-
await loadFixtureDataCar(controller, 'bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i-single-layer-hamt-with-multi-block-files.car')
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('loads path /ipfs/bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt', async () => {
|
|
66
|
-
const resp = await verifiedFetch('ipfs://bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt')
|
|
67
|
-
expect(resp).to.be.ok()
|
|
68
|
-
expect(resp.headers.get('content-type')).to.equal('text/plain')
|
|
69
|
-
const text = await resp.text()
|
|
70
|
-
// npx kubo@0.25.0 cat '/ipfs/bafybeidbclfqleg2uojchspzd4bob56dqetqjsj27gy2cq3klkkgxtpn4i/685.txt'
|
|
71
|
-
expect(text).to.equal(`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc non imperdiet nunc. Proin ac quam ut nibh eleifend aliquet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed ligula dolor, imperdiet sagittis arcu et, semper tincidunt urna. Donec et tempor augue, quis sollicitudin metus. Curabitur semper ullamcorper aliquet. Mauris hendrerit sodales lectus eget fermentum. Proin sollicitudin vestibulum commodo. Vivamus nec lectus eu augue aliquet dignissim nec condimentum justo. In hac habitasse platea dictumst. Mauris vel sem neque.
|
|
72
|
-
|
|
73
|
-
Vivamus finibus, enim at lacinia semper, arcu erat gravida lacus, sit amet gravida magna orci sit amet est. Sed non leo lacus. Nullam viverra ipsum a tincidunt dapibus. Nulla pulvinar ligula sit amet ante ultrices tempus. Proin purus urna, semper sed lobortis quis, gravida vitae ipsum. Aliquam mi urna, pulvinar eu bibendum quis, convallis ac dolor. In gravida justo sed risus ullamcorper, vitae luctus massa hendrerit. Pellentesque habitant amet.`)
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
})
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/* eslint-env mocha */
|
|
2
|
-
import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
3
|
-
import { expect } from 'aegir/chai'
|
|
4
|
-
import { createKuboNode } from './fixtures/create-kubo.js'
|
|
5
|
-
import { loadFixtureDataCar } from './fixtures/load-fixture-data.js'
|
|
6
|
-
import type { Controller } from 'ipfsd-ctl'
|
|
7
|
-
|
|
8
|
-
describe('@helia/verified-fetch - websites', () => {
|
|
9
|
-
describe('helia-identify.on.fleek.co', () => {
|
|
10
|
-
let controller: Controller<'go'>
|
|
11
|
-
let verifiedFetch: Awaited<ReturnType<typeof createVerifiedFetch>>
|
|
12
|
-
|
|
13
|
-
before(async () => {
|
|
14
|
-
controller = await createKuboNode()
|
|
15
|
-
await controller.start()
|
|
16
|
-
// 2024-01-22 CID for _dnslink.helia-identify.on.fleek.co
|
|
17
|
-
await loadFixtureDataCar(controller, 'QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv-helia-identify-website.car')
|
|
18
|
-
verifiedFetch = await createVerifiedFetch({
|
|
19
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
20
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
21
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
after(async () => {
|
|
26
|
-
await controller.stop()
|
|
27
|
-
await verifiedFetch.stop()
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('loads index.html when passed helia-identify.on.fleek.co root CID', async () => {
|
|
31
|
-
const resp = await verifiedFetch('ipfs://QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv')
|
|
32
|
-
expect(resp).to.be.ok()
|
|
33
|
-
const html = await resp.text()
|
|
34
|
-
expect(html).to.be.ok()
|
|
35
|
-
expect(html).to.include('<title>Run Identify on a remote node with Helia</title>')
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('loads helia-identify.on.fleek.co index.html directly ', async () => {
|
|
39
|
-
const resp = await verifiedFetch('ipfs://QmbxpRxwKXxnJQjnPqm1kzDJSJ8YgkLxH23mcZURwPHjGv/index.html')
|
|
40
|
-
expect(resp).to.be.ok()
|
|
41
|
-
const html = await resp.text()
|
|
42
|
-
expect(html).to.be.ok()
|
|
43
|
-
expect(html).to.include('<title>Run Identify on a remote node with Helia</title>')
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* Created on 2024-01-23. /ipns/blog.libp2p.io/index.html resolved to QmVZNGy6SPvUbvQCXXaGDdp8kvfJm9MMozjU12dyzH6hKf
|
|
50
|
-
*
|
|
51
|
-
* ```shell
|
|
52
|
-
* mkdir fake-blog.libp2p.io
|
|
53
|
-
* npx kubo@0.25.0 cat '/ipfs/QmVZNGy6SPvUbvQCXXaGDdp8kvfJm9MMozjU12dyzH6hKf' > fake-blog.libp2p.io/index.html
|
|
54
|
-
* npx kubo@0.25.0 add -r fake-blog.libp2p.io
|
|
55
|
-
* npx kubo@0.25.0 dag export QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw > QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw-fake-blog.libp2p.io.car
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
describe('fake blog.libp2p.io', () => {
|
|
59
|
-
let controller: Controller<'go'>
|
|
60
|
-
let verifiedFetch: Awaited<ReturnType<typeof createVerifiedFetch>>
|
|
61
|
-
|
|
62
|
-
before(async () => {
|
|
63
|
-
controller = await createKuboNode()
|
|
64
|
-
await controller.start()
|
|
65
|
-
await loadFixtureDataCar(controller, 'QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw-fake-blog.libp2p.io.car')
|
|
66
|
-
verifiedFetch = await createVerifiedFetch({
|
|
67
|
-
gateways: [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`],
|
|
68
|
-
// Temporarily disabling delegated routers in browser until CORS issue is fixed. see https://github.com/ipshipyard/waterworks-community/issues/4
|
|
69
|
-
routers: process.env.RUNNER_ENV === 'node' ? [`http://${controller.api.gatewayHost}:${controller.api.gatewayPort}`] : []
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
after(async () => {
|
|
74
|
-
await controller.stop()
|
|
75
|
-
await verifiedFetch.stop()
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
it('loads index.html when passed fake-blog.libp2p.io root CID', async () => {
|
|
79
|
-
const resp = await verifiedFetch('ipfs://QmeiDMLtPUS3RT2xAcUwsNyZz169wPke2q7im9vZpVLSYw')
|
|
80
|
-
expect(resp).to.be.ok()
|
|
81
|
-
const html = await resp.text()
|
|
82
|
-
expect(html).to.be.ok()
|
|
83
|
-
expect(html).to.include('<title>Home | libp2p Blog & News</title>')
|
|
84
|
-
expect(html).to.include('<link href="https://libp2p.io/" rel="canonical">')
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})
|