Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit 9f0efb9

Browse files
committed
wip
1 parent dcf934d commit 9f0efb9

18 files changed

+638
-488
lines changed

benchmarks/runner/benchmarks/utils/start-ipfs.js

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,28 @@ const IPFS = require('ipfs')
22
const IPFSRepo = require('ipfs-repo')
33
const DatastoreLevel = require('datastore-level')
44

5-
const startIpfs = (repoPath) => {
6-
return new Promise((resolve, reject) => {
7-
const repoConf = {
8-
storageBackends: {
9-
blocks: DatastoreLevel
10-
}
5+
const startIpfs = async (repoPath) => {
6+
const repoConf = {
7+
storageBackends: {
8+
blocks: DatastoreLevel
119
}
10+
}
1211

13-
const repo = new IPFSRepo(repoPath, repoConf)
12+
const repo = new IPFSRepo(repoPath, repoConf)
1413

15-
const ipfs = new IPFS({
16-
repo: repo,
17-
start: false,
18-
EXPERIMENTAL: {
19-
pubsub: true,
20-
sharding: false,
21-
dht: false
22-
}
23-
})
24-
25-
ipfs.on('error', (err) => {
26-
reject(err)
27-
})
28-
29-
ipfs.on('ready', () => {
30-
resolve({ ipfs, repo })
31-
})
14+
const ipfs = await IPFS.create({
15+
repo: repo,
16+
start: false,
17+
init: {
18+
emptyRepo: true
19+
},
20+
EXPERIMENTAL: {
21+
sharding: false,
22+
dht: false
23+
}
3224
})
25+
26+
return { ipfs, repo }
3327
}
3428

3529
module.exports = startIpfs

0 commit comments

Comments
 (0)