diff --git a/benchmarks/add-dir/package.json b/benchmarks/add-dir/package.json index 85bd519a..8f655f9a 100644 --- a/benchmarks/add-dir/package.json +++ b/benchmarks/add-dir/package.json @@ -21,7 +21,6 @@ "blockstore-fs": "^1.0.1", "datastore-level": "^10.0.1", "execa": "^7.0.0", - "go-ipfs": "^0.19.0", "helia": "^1.0.0", "ipfs-core": "^0.18.0", "ipfs-unixfs-importer": "^15.1.5", @@ -29,6 +28,7 @@ "it-all": "^2.0.0", "it-drain": "^2.0.0", "it-map": "^2.0.1", + "kubo": "^0.22.0", "kubo-rpc-client": "^3.0.1", "libp2p": "^0.43.0", "multiformats": "^11.0.1", diff --git a/benchmarks/add-dir/src/kubo-direct.ts b/benchmarks/add-dir/src/kubo-direct.ts index bb0ae242..705c07f8 100644 --- a/benchmarks/add-dir/src/kubo-direct.ts +++ b/benchmarks/add-dir/src/kubo-direct.ts @@ -1,19 +1,18 @@ +import { execa } from 'execa' +import { path as kuboPath } from 'kubo' +import { CID } from 'multiformats/cid' import { promises as fsPromises } from 'node:fs' import os from 'node:os' import nodePath from 'node:path' -import { execa } from 'execa' -// @ts-expect-error no types -import * as goIpfs from 'go-ipfs' -import { CID } from 'multiformats/cid' import type { AddDirBenchmark } from './index.js' export async function createKuboDirectBenchmark (): Promise { const repoDir = nodePath.join(os.tmpdir(), 'kubo-direct') - await execa(goIpfs.path(), ['--repo-dir', repoDir, 'init']) + await execa(kuboPath(), ['--repo-dir', repoDir, 'init']) const addDir = async function (dir: string): Promise { - const { stdout } = await execa(goIpfs.path(), ['--repo-dir', repoDir, 'add', '-r', '--pin=false', dir]) + const { stdout } = await execa(kuboPath(), ['--repo-dir', repoDir, 'add', '-r', '--pin=false', dir]) const lines = stdout.split('\n') const lastLine = lines.pop() const cid = CID.parse(lastLine?.split(' ')[1] as string) diff --git a/benchmarks/add-dir/src/kubo.ts b/benchmarks/add-dir/src/kubo.ts index e0d8552a..d0d10535 100644 --- a/benchmarks/add-dir/src/kubo.ts +++ b/benchmarks/add-dir/src/kubo.ts @@ -1,18 +1,17 @@ -import fs, { promises as fsPromises } from 'node:fs' -import nodePath from 'node:path' -// @ts-expect-error no types -import * as goIpfs from 'go-ipfs' import { createController } from 'ipfsd-ctl' import last from 'it-last' +import { path as kuboPath } from 'kubo' import * as goRpcClient from 'kubo-rpc-client' -import type { AddDirBenchmark } from './index.js' import type { CID } from 'multiformats/cid' +import fs, { promises as fsPromises } from 'node:fs' +import nodePath from 'node:path' +import type { AddDirBenchmark } from './index.js' export async function createKuboBenchmark (): Promise { const controller = await createController({ type: 'go', test: true, - ipfsBin: goIpfs.path(), + ipfsBin: kuboPath(), kuboRpcModule: goRpcClient, ipfsOptions: { init: { diff --git a/benchmarks/gc/package.json b/benchmarks/gc/package.json index c7ebea4f..199747ba 100644 --- a/benchmarks/gc/package.json +++ b/benchmarks/gc/package.json @@ -18,13 +18,13 @@ "blockstore-fs": "^1.0.1", "datastore-level": "^10.0.1", "execa": "^7.0.0", - "go-ipfs": "^0.20.0", "helia": "^1.0.0", "ipfs-core": "^0.18.0", "ipfsd-ctl": "^13.0.0", "it-all": "^3.0.2", "it-drain": "^3.0.1", "it-map": "^3.0.3", + "kubo": "^0.22.0", "kubo-rpc-client": "^3.0.1", "libp2p": "^0.45.2", "multiformats": "^11.0.1", diff --git a/benchmarks/gc/src/kubo.ts b/benchmarks/gc/src/kubo.ts index c6befd0c..a8863ab4 100644 --- a/benchmarks/gc/src/kubo.ts +++ b/benchmarks/gc/src/kubo.ts @@ -1,10 +1,9 @@ /* eslint-disable no-console */ -// @ts-expect-error no types -import * as goIpfs from 'go-ipfs' import { createController } from 'ipfsd-ctl' import all from 'it-all' import drain from 'it-drain' +import { path as kuboPath } from 'kubo' import * as goRpcClient from 'kubo-rpc-client' import type { GcBenchmark } from './index.js' @@ -12,7 +11,7 @@ export async function createKuboBenchmark (): Promise { const controller = await createController({ type: 'go', test: true, - ipfsBin: goIpfs.path(), + ipfsBin: kuboPath(), ipfsHttpModule: goRpcClient, ipfsOptions: { init: { diff --git a/packages/interop/.aegir.js b/packages/interop/.aegir.js index c6e4ebd3..7f567dc8 100644 --- a/packages/interop/.aegir.js +++ b/packages/interop/.aegir.js @@ -12,7 +12,7 @@ export default { host: '127.0.0.1', port: ipfsdPort }, { - ipfsBin: (await import('go-ipfs')).default.path(), + ipfsBin: (await import('kubo')).default.path(), kuboRpcModule: kuboRpcClient, ipfsOptions: { config: { diff --git a/packages/interop/package.json b/packages/interop/package.json index 968fe4cd..d7353971 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -57,11 +57,11 @@ "aegir": "^40.0.8", "blockstore-core": "^4.0.0", "datastore-core": "^9.0.0", - "go-ipfs": "^0.22.0", "helia": "^2.0.1", "ipfsd-ctl": "^13.0.0", "it-all": "^3.0.2", "it-to-buffer": "^4.0.1", + "kubo": "^0.22.0", "kubo-rpc-client": "^3.0.1", "libp2p": "^0.46.6", "multiformats": "^12.0.1" @@ -69,6 +69,6 @@ "browser": { "./dist/test/fixtures/create-helia.js": "./dist/test/fixtures/create-helia.browser.js", "./dist/test/fixtures/create-kubo.js": "./dist/test/fixtures/create-kubo.browser.js", - "go-ipfs": false + "kubo": false } } diff --git a/packages/interop/test/fixtures/create-kubo.ts b/packages/interop/test/fixtures/create-kubo.ts index 6b7d8e55..5e012b54 100644 --- a/packages/interop/test/fixtures/create-kubo.ts +++ b/packages/interop/test/fixtures/create-kubo.ts @@ -1,13 +1,12 @@ /* eslint-disable @typescript-eslint/ban-ts-comment,@typescript-eslint/prefer-ts-expect-error */ -// @ts-ignore no types - TODO: remove me once the next version of npm-go-ipfs has shipped -import * as goIpfs from 'go-ipfs' -import { type Controller, createController } from 'ipfsd-ctl' +import { createController, type Controller } from 'ipfsd-ctl' +import { path as kuboPath } from 'kubo' import * as kuboRpcClient from 'kubo-rpc-client' export async function createKuboNode (): Promise { return createController({ kuboRpcModule: kuboRpcClient, - ipfsBin: goIpfs.path(), + ipfsBin: kuboPath(), test: true, ipfsOptions: { config: {