@helia/interop 8.0.0 → 8.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/dist/index.min.js +1 -0
- package/dist/index.min.js.map +7 -0
- package/dist/src/helia-blockstore-sessions.spec.d.ts +2 -0
- package/dist/src/helia-blockstore-sessions.spec.d.ts.map +1 -0
- package/dist/src/helia-blockstore-sessions.spec.js +50 -0
- package/dist/src/helia-blockstore-sessions.spec.js.map +1 -0
- package/dist/src/helia-blockstore.spec.js +4 -1
- package/dist/src/helia-blockstore.spec.js.map +1 -1
- package/package.json +14 -14
- package/src/helia-blockstore-sessions.spec.ts +64 -0
- package/src/helia-blockstore.spec.ts +5 -2
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.HeliaInterop = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
2
|
"use strict";var HeliaInterop=(()=>{var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e,x,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!c.call(o,p)&&p!==x&&t(o,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return o};var f=o=>d(t({},"__esModule",{value:!0}),o);var g={};return f(g);})();
|
|
3
3
|
return HeliaInterop}));
|
|
4
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @packageDocumentation\n *\n * Runs interop tests between Helia and Kubo.\n *\n * @example Testing a new Kubo release\n *\n * ```console\n * $ npm i @helia/interop\n * $ KUBO_BINARY=/path/to/kubo helia-interop\n * ```\n */\n\nexport {}\n"],
|
|
5
|
+
"mappings": ";sYAAA,IAAAA,EAAA",
|
|
6
|
+
"names": ["index_exports"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helia-blockstore-sessions.spec.d.ts","sourceRoot":"","sources":["../../src/helia-blockstore-sessions.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-env mocha */
|
|
2
|
+
import { multiaddr } from '@multiformats/multiaddr';
|
|
3
|
+
import { expect } from 'aegir/chai';
|
|
4
|
+
import { CID } from 'multiformats/cid';
|
|
5
|
+
import { createHeliaNode } from './fixtures/create-helia.js';
|
|
6
|
+
import { createKuboNode } from './fixtures/create-kubo.js';
|
|
7
|
+
describe('helia - blockstore sessions', () => {
|
|
8
|
+
let helia;
|
|
9
|
+
let kubo;
|
|
10
|
+
let kuboInfo;
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
helia = await createHeliaNode();
|
|
13
|
+
kubo = await createKuboNode();
|
|
14
|
+
kuboInfo = await kubo.info();
|
|
15
|
+
});
|
|
16
|
+
afterEach(async () => {
|
|
17
|
+
if (helia != null) {
|
|
18
|
+
await helia.stop();
|
|
19
|
+
}
|
|
20
|
+
if (kubo != null) {
|
|
21
|
+
await kubo.stop();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
it('should be able to receive a block from a peer', async () => {
|
|
25
|
+
const input = Uint8Array.from([0, 1, 2, 3, 4]);
|
|
26
|
+
const { cid } = await kubo.api.add({ content: input }, {
|
|
27
|
+
cidVersion: 1,
|
|
28
|
+
rawLeaves: true
|
|
29
|
+
});
|
|
30
|
+
await helia.libp2p.dial(kuboInfo.multiaddrs.map(str => multiaddr(str)));
|
|
31
|
+
const output = await helia.blockstore.get(CID.parse(cid.toString()));
|
|
32
|
+
expect(output).to.equalBytes(input);
|
|
33
|
+
});
|
|
34
|
+
it('should be able to receive a block from a session provider', async () => {
|
|
35
|
+
const input = Uint8Array.from([0, 1, 2, 3, 4]);
|
|
36
|
+
const { cid } = await kubo.api.add({ content: input }, {
|
|
37
|
+
cidVersion: 1,
|
|
38
|
+
rawLeaves: true
|
|
39
|
+
});
|
|
40
|
+
const root = CID.parse(cid.toString());
|
|
41
|
+
const session = helia.blockstore.createSession(root, {
|
|
42
|
+
providers: [
|
|
43
|
+
kuboInfo.multiaddrs.map(str => multiaddr(str))
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
const output = await session.get(root);
|
|
47
|
+
expect(output).to.equalBytes(input);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=helia-blockstore-sessions.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helia-blockstore-sessions.spec.js","sourceRoot":"","sources":["../../src/helia-blockstore-sessions.spec.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI1D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,IAAI,KAAkB,CAAA;IACtB,IAAI,IAAc,CAAA;IAClB,IAAI,QAAkB,CAAA;IAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QAC/B,IAAI,GAAG,MAAM,cAAc,EAAE,CAAA;QAC7B,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;IAC9B,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;QAC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;QACF,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;QAEtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE;YACnD,SAAS,EAAE;gBACT,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;aAC/C;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEtC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-env mocha */
|
|
2
|
+
import { multiaddr } from '@multiformats/multiaddr';
|
|
2
3
|
import { expect } from 'aegir/chai';
|
|
3
4
|
import toBuffer from 'it-to-buffer';
|
|
4
5
|
import { CID } from 'multiformats/cid';
|
|
@@ -9,11 +10,13 @@ import { createKuboNode } from './fixtures/create-kubo.js';
|
|
|
9
10
|
describe('helia - blockstore', () => {
|
|
10
11
|
let helia;
|
|
11
12
|
let kubo;
|
|
13
|
+
let kuboInfo;
|
|
12
14
|
beforeEach(async () => {
|
|
13
15
|
helia = await createHeliaNode();
|
|
14
16
|
kubo = await createKuboNode();
|
|
17
|
+
kuboInfo = await kubo.info();
|
|
15
18
|
// connect the two nodes
|
|
16
|
-
await helia.libp2p.dial((
|
|
19
|
+
await helia.libp2p.dial(kuboInfo.multiaddrs.map(str => multiaddr(str)));
|
|
17
20
|
});
|
|
18
21
|
afterEach(async () => {
|
|
19
22
|
if (helia != null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helia-blockstore.spec.js","sourceRoot":"","sources":["../../src/helia-blockstore.spec.ts"],"names":[],"mappings":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,CAAC,CAAC,CAAC,CAAA;QAC9C,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;YACrD,UAAU,EAAE,CAAC;YACb,SAAS,EAAE,IAAI;SAChB,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAEpE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/interop",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
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",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@chainsafe/libp2p-gossipsub": "^14.1.0",
|
|
62
|
-
"@helia/block-brokers": "^4.
|
|
63
|
-
"@helia/car": "^4.0
|
|
64
|
-
"@helia/dag-cbor": "^4.0.
|
|
65
|
-
"@helia/dag-json": "^4.0.
|
|
66
|
-
"@helia/http": "^2.0
|
|
67
|
-
"@helia/interface": "^5.
|
|
68
|
-
"@helia/ipns": "^8.2.
|
|
69
|
-
"@helia/json": "^4.0.
|
|
70
|
-
"@helia/mfs": "^5.0.
|
|
71
|
-
"@helia/routers": "^3.0
|
|
72
|
-
"@helia/strings": "^4.0.
|
|
73
|
-
"@helia/unixfs": "^5.0.
|
|
62
|
+
"@helia/block-brokers": "^4.2.0",
|
|
63
|
+
"@helia/car": "^4.1.0",
|
|
64
|
+
"@helia/dag-cbor": "^4.0.4",
|
|
65
|
+
"@helia/dag-json": "^4.0.4",
|
|
66
|
+
"@helia/http": "^2.1.0",
|
|
67
|
+
"@helia/interface": "^5.3.0",
|
|
68
|
+
"@helia/ipns": "^8.2.1",
|
|
69
|
+
"@helia/json": "^4.0.4",
|
|
70
|
+
"@helia/mfs": "^5.0.1",
|
|
71
|
+
"@helia/routers": "^3.1.0",
|
|
72
|
+
"@helia/strings": "^4.0.4",
|
|
73
|
+
"@helia/unixfs": "^5.0.1",
|
|
74
74
|
"@ipld/car": "^5.3.3",
|
|
75
75
|
"@ipld/dag-cbor": "^9.2.2",
|
|
76
76
|
"@ipld/dag-pb": "^4.1.3",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@multiformats/multiaddr": "^12.4.0",
|
|
84
84
|
"@multiformats/sha3": "^3.0.2",
|
|
85
85
|
"aegir": "^45.1.1",
|
|
86
|
-
"helia": "^5.
|
|
86
|
+
"helia": "^5.4.0",
|
|
87
87
|
"ipfs-unixfs-importer": "^15.3.1",
|
|
88
88
|
"ipfsd-ctl": "^15.0.2",
|
|
89
89
|
"ipns": "^10.0.0",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-env mocha */
|
|
2
|
+
|
|
3
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
|
4
|
+
import { expect } from 'aegir/chai'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { createHeliaNode } from './fixtures/create-helia.js'
|
|
7
|
+
import { createKuboNode } from './fixtures/create-kubo.js'
|
|
8
|
+
import type { HeliaLibp2p } from 'helia'
|
|
9
|
+
import type { KuboInfo, KuboNode } from 'ipfsd-ctl'
|
|
10
|
+
|
|
11
|
+
describe('helia - blockstore sessions', () => {
|
|
12
|
+
let helia: HeliaLibp2p
|
|
13
|
+
let kubo: KuboNode
|
|
14
|
+
let kuboInfo: KuboInfo
|
|
15
|
+
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
helia = await createHeliaNode()
|
|
18
|
+
kubo = await createKuboNode()
|
|
19
|
+
kuboInfo = await kubo.info()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
afterEach(async () => {
|
|
23
|
+
if (helia != null) {
|
|
24
|
+
await helia.stop()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (kubo != null) {
|
|
28
|
+
await kubo.stop()
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('should be able to receive a block from a peer', async () => {
|
|
33
|
+
const input = Uint8Array.from([0, 1, 2, 3, 4])
|
|
34
|
+
const { cid } = await kubo.api.add({ content: input }, {
|
|
35
|
+
cidVersion: 1,
|
|
36
|
+
rawLeaves: true
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
await helia.libp2p.dial(kuboInfo.multiaddrs.map(str => multiaddr(str)))
|
|
40
|
+
|
|
41
|
+
const output = await helia.blockstore.get(CID.parse(cid.toString()))
|
|
42
|
+
|
|
43
|
+
expect(output).to.equalBytes(input)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('should be able to receive a block from a session provider', async () => {
|
|
47
|
+
const input = Uint8Array.from([0, 1, 2, 3, 4])
|
|
48
|
+
const { cid } = await kubo.api.add({ content: input }, {
|
|
49
|
+
cidVersion: 1,
|
|
50
|
+
rawLeaves: true
|
|
51
|
+
})
|
|
52
|
+
const root = CID.parse(cid.toString())
|
|
53
|
+
|
|
54
|
+
const session = helia.blockstore.createSession(root, {
|
|
55
|
+
providers: [
|
|
56
|
+
kuboInfo.multiaddrs.map(str => multiaddr(str))
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const output = await session.get(root)
|
|
61
|
+
|
|
62
|
+
expect(output).to.equalBytes(input)
|
|
63
|
+
})
|
|
64
|
+
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-env mocha */
|
|
2
2
|
|
|
3
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
|
3
4
|
import { expect } from 'aegir/chai'
|
|
4
5
|
import toBuffer from 'it-to-buffer'
|
|
5
6
|
import { CID } from 'multiformats/cid'
|
|
@@ -8,18 +9,20 @@ import { sha256 } from 'multiformats/hashes/sha2'
|
|
|
8
9
|
import { createHeliaNode } from './fixtures/create-helia.js'
|
|
9
10
|
import { createKuboNode } from './fixtures/create-kubo.js'
|
|
10
11
|
import type { HeliaLibp2p } from 'helia'
|
|
11
|
-
import type { KuboNode } from 'ipfsd-ctl'
|
|
12
|
+
import type { KuboInfo, KuboNode } from 'ipfsd-ctl'
|
|
12
13
|
|
|
13
14
|
describe('helia - blockstore', () => {
|
|
14
15
|
let helia: HeliaLibp2p
|
|
15
16
|
let kubo: KuboNode
|
|
17
|
+
let kuboInfo: KuboInfo
|
|
16
18
|
|
|
17
19
|
beforeEach(async () => {
|
|
18
20
|
helia = await createHeliaNode()
|
|
19
21
|
kubo = await createKuboNode()
|
|
22
|
+
kuboInfo = await kubo.info()
|
|
20
23
|
|
|
21
24
|
// connect the two nodes
|
|
22
|
-
await helia.libp2p.dial((
|
|
25
|
+
await helia.libp2p.dial(kuboInfo.multiaddrs.map(str => multiaddr(str)))
|
|
23
26
|
})
|
|
24
27
|
|
|
25
28
|
afterEach(async () => {
|