Skip to content

Commit

Permalink
deps: bump ipfsd-ctl from 13.0.0 to 14.0.0 (#505)
Browse files Browse the repository at this point in the history
* deps: bump ipfsd-ctl from 13.0.0 to 14.0.0

Bumps [ipfsd-ctl](https://github.com/ipfs/js-ipfsd-ctl) from 13.0.0 to 14.0.0.
- [Release notes](https://github.com/ipfs/js-ipfsd-ctl/releases)
- [Changelog](https://github.com/ipfs/js-ipfsd-ctl/blob/master/CHANGELOG.md)
- [Commits](ipfs/js-ipfsd-ctl@v13.0.0...v14.0.0)

---
updated-dependencies:
- dependency-name: ipfsd-ctl
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: update dep versions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
  • Loading branch information
dependabot[bot] and achingbrain committed Apr 19, 2024
1 parent 13daa26 commit 97fb1a7
Show file tree
Hide file tree
Showing 34 changed files with 123 additions and 292 deletions.
2 changes: 0 additions & 2 deletions benchmarks/add-dir/README.md
Expand Up @@ -14,8 +14,6 @@ Warning! It can take a long time to run against folders with a very large number

Example, running against `/node_modules` takes Helia 13 minutes for a single run.

You can speed things up by removing js-ipfs from the `impls` array.

To run:

1. Add `benchmarks/*` to the `workspaces` entry in the root `package.json` of this repo
Expand Down
15 changes: 7 additions & 8 deletions benchmarks/add-dir/package.json
Expand Up @@ -12,26 +12,25 @@
"start": "npm run build && node dist/src/index.js"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^14.1.0",
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/libp2p-yamux": "^6.0.1",
"@helia/unixfs": "^1.4.0",
"@helia/unixfs": "^3.0.4",
"@ipld/dag-pb": "^4.0.2",
"@libp2p/websockets": "^8.0.9",
"aegir": "^42.1.0",
"blockstore-fs": "^1.0.1",
"datastore-level": "^10.0.1",
"execa": "^8.0.1",
"helia": "^2.1.0",
"ipfs-core": "^0.18.0",
"helia": "^4.1.1",
"ipfs-unixfs-importer": "^15.1.5",
"ipfsd-ctl": "^13.0.0",
"ipfsd-ctl": "^14.0.0",
"it-all": "^3.0.4",
"it-drain": "^3.0.5",
"it-map": "^3.0.5",
"kubo": "^0.25.0",
"kubo-rpc-client": "^3.0.1",
"kubo": "^0.28.0",
"kubo-rpc-client": "^4.0.0",
"libp2p": "^1.1.0",
"multiformats": "^13.0.0",
"multiformats": "^13.1.0",
"tinybench": "^2.4.0"
}
}
15 changes: 1 addition & 14 deletions benchmarks/add-dir/src/helia.ts
Expand Up @@ -2,27 +2,17 @@ import fs, { promises as fsPromises } from 'node:fs'
import os from 'node:os'
import nodePath from 'node:path'
import { type AddOptions, unixfs, globSource } from '@helia/unixfs'
import * as dagPb from '@ipld/dag-pb'
import { MemoryBlockstore } from 'blockstore-core'
import { FsBlockstore } from 'blockstore-fs'
import { MemoryDatastore } from 'datastore-core'
import { LevelDatastore } from 'datastore-level'
import { createHelia, type DAGWalker } from 'helia'
import { createHelia } from 'helia'
import { fixedSize } from 'ipfs-unixfs-importer/chunker'
import { balanced } from 'ipfs-unixfs-importer/layout'
import last from 'it-last'
import type { AddDirBenchmark } from './index.js'
import type { CID } from 'multiformats/cid'

const dagPbWalker: DAGWalker = {
codec: dagPb.code,
async * walk (block) {
const node = dagPb.decode(block)

yield * node.Links.map(l => l.Hash)
}
}

const unixFsAddOptions: Partial<AddOptions> = {
// default kubo options
cidVersion: 0,
Expand All @@ -45,9 +35,6 @@ export async function createHeliaBenchmark ({ blockstoreType = 'fs', datastoreTy
const helia = await createHelia({
blockstore: blockstoreType === 'fs' ? new FsBlockstore(`${repoPath}/blocks`) : new MemoryBlockstore(),
datastore: datastoreType === 'fs' ? new LevelDatastore(`${repoPath}/data`) : new MemoryDatastore(),
dagWalkers: [
dagPbWalker
],
start: false
})
const unixFs = unixfs(helia)
Expand Down
6 changes: 0 additions & 6 deletions benchmarks/add-dir/src/index.ts
Expand Up @@ -5,7 +5,6 @@ import debug from 'debug'
import { CID } from 'multiformats/cid'
import { Bench } from 'tinybench'
import { createHeliaBenchmark } from './helia.js'
import { createIpfsBenchmark } from './ipfs.js'
import { createKuboDirectBenchmark } from './kubo-direct.js'
import { createKuboBenchmark } from './kubo.js'

Expand Down Expand Up @@ -45,11 +44,6 @@ const impls: Array<{ name: string, create: () => Promise<AddDirBenchmark>, resul
create: async () => createHeliaBenchmark({ blockstoreType: 'mem', datastoreType: 'mem' }),
results: getDefaultResults()
},
{
name: 'ipfs',
create: async () => createIpfsBenchmark(),
results: getDefaultResults()
},
{
name: 'kubo',
create: async () => createKuboBenchmark(),
Expand Down
46 changes: 0 additions & 46 deletions benchmarks/add-dir/src/ipfs.ts

This file was deleted.

26 changes: 15 additions & 11 deletions benchmarks/add-dir/src/kubo.ts
@@ -1,26 +1,30 @@
import { createController } from 'ipfsd-ctl'
import { createNode } from 'ipfsd-ctl'
import last from 'it-last'
import { path as kuboPath } from 'kubo'
import * as goRpcClient from 'kubo-rpc-client'
import { create as kuboRpcClient } from 'kubo-rpc-client'
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<AddDirBenchmark> {
const controller = await createController({
type: 'go',
const controller = await createNode({
type: 'kubo',
test: true,
ipfsBin: kuboPath(),
kuboRpcModule: goRpcClient,
ipfsOptions: {
init: {
emptyRepo: true
}
bin: kuboPath(),
rpc: kuboRpcClient,
init: {
emptyRepo: true
}
})

const addFile = async (path: string): Promise<CID> => (await controller.api.add({ path: nodePath.relative(process.cwd(), path), content: fs.createReadStream(path) }, { cidVersion: 1, pin: false })).cid
const addFile = async (path: string): Promise<CID> => (await controller.api.add({
path: nodePath.relative(process.cwd(),path),
content: fs.createReadStream(path)
}, {
cidVersion: 1,
pin: false
})).cid

const addDir = async function (dir: string): Promise<CID> {
// @ts-expect-error types are messed up
Expand Down
5 changes: 1 addition & 4 deletions benchmarks/add-dir/tsconfig.json
@@ -1,10 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"]
"outDir": "dist"
},
"include": [
"src",
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/gc/README.md
Expand Up @@ -11,8 +11,6 @@ All three implementations use on-disk block/datastores to ensure a reasonable ba

Warning! It can take a long time with realistic pinset sizes - on the order of a whole day.

You can speed things up by removing js-ipfs from the `impls` array.

To run:

1. Add `benchmarks/*` to the `workspaces` entry in the root `package.json` of this repo
Expand Down
11 changes: 5 additions & 6 deletions benchmarks/gc/package.json
Expand Up @@ -11,18 +11,17 @@
},
"devDependencies": {
"@ipld/dag-pb": "^4.0.6",
"aegir": "^42.1.0",
"aegir": "^42.2.5",
"blockstore-fs": "^1.1.8",
"datastore-level": "^10.1.5",
"execa": "^8.0.1",
"helia": "^2.1.0",
"ipfs-core": "^0.18.0",
"ipfsd-ctl": "^13.0.0",
"helia": "^4.1.1",
"ipfsd-ctl": "^14.0.0",
"it-all": "^3.0.4",
"it-drain": "^3.0.5",
"it-map": "^3.0.5",
"kubo": "^0.25.0",
"kubo-rpc-client": "^3.0.2",
"kubo": "^0.28.0",
"kubo-rpc-client": "^4.0.0",
"multiformats": "^13.0.0",
"tinybench": "^2.5.1"
},
Expand Down
19 changes: 3 additions & 16 deletions benchmarks/gc/src/helia.ts
@@ -1,23 +1,13 @@
import os from 'node:os'
import path from 'node:path'
import * as dagPb from '@ipld/dag-pb'
import { FsBlockstore } from 'blockstore-fs'
import { LevelDatastore } from 'datastore-level'
import { createHelia, type DAGWalker } from 'helia'
import { createHelia } from 'helia'
import all from 'it-all'
import drain from 'it-drain'
import map from 'it-map'
import type { GcBenchmark } from './index.js'

const dagPbWalker: DAGWalker = {
codec: dagPb.code,
async * walk (block) {
const node = dagPb.decode(block)

yield * node.Links.map(l => l.Hash)
}
}

export async function createHeliaBenchmark (): Promise<GcBenchmark> {
const repoPath = path.join(os.tmpdir(), `helia-${Math.random()}`)

Expand All @@ -29,9 +19,6 @@ export async function createHeliaBenchmark (): Promise<GcBenchmark> {
listen: []
}
},
dagWalkers: [
dagPbWalker
],
start: false
})

Expand All @@ -43,7 +30,7 @@ export async function createHeliaBenchmark (): Promise<GcBenchmark> {
await drain(helia.blockstore.putMany(map(blocks, ({ key, value }) => ({ cid: key, block: value }))))
},
async pin (cid) {
await all(helia.pins.add(cid))
await helia.pins.add(cid)
},
async teardown () {
await helia.stop()
Expand All @@ -52,7 +39,7 @@ export async function createHeliaBenchmark (): Promise<GcBenchmark> {
const pins = await all(helia.pins.ls())

for (const pin of pins) {
await all(helia.pins.rm(pin.cid))
await helia.pins.rm(pin.cid)
}

return pins.length
Expand Down
10 changes: 0 additions & 10 deletions benchmarks/gc/src/index.ts
Expand Up @@ -6,7 +6,6 @@ import { CID } from 'multiformats/cid'
import { sha256 } from 'multiformats/hashes/sha2'
import { Bench } from 'tinybench'
import { createHeliaBenchmark } from './helia.js'
import { createIpfsBenchmark } from './ipfs.js'
import { createKuboBenchmark } from './kubo.js'

const PINNED_DAG_COUNT = parseInt(process.env.INCREMENT ?? '10000')
Expand Down Expand Up @@ -101,15 +100,6 @@ const impls: Array<{ name: string, create: () => Promise<GcBenchmark>, results:
addedBlocks: [],
pinnedBlocks: []
}
}, {
name: 'ipfs',
create: async () => createIpfsBenchmark(),
results: {
gc: [],
clearedPins: [],
addedBlocks: [],
pinnedBlocks: []
}
}, {
name: 'kubo',
create: async () => createKuboBenchmark(),
Expand Down
68 changes: 0 additions & 68 deletions benchmarks/gc/src/ipfs.ts

This file was deleted.

0 comments on commit 97fb1a7

Please sign in to comment.