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

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mistakia committed May 12, 2020
1 parent dcf934d commit 39b893d
Show file tree
Hide file tree
Showing 18 changed files with 638 additions and 488 deletions.
42 changes: 18 additions & 24 deletions benchmarks/runner/benchmarks/utils/start-ipfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@ const IPFS = require('ipfs')
const IPFSRepo = require('ipfs-repo')
const DatastoreLevel = require('datastore-level')

const startIpfs = (repoPath) => {
return new Promise((resolve, reject) => {
const repoConf = {
storageBackends: {
blocks: DatastoreLevel
}
const startIpfs = async (repoPath) => {
const repoConf = {
storageBackends: {
blocks: DatastoreLevel
}
}

const repo = new IPFSRepo(repoPath, repoConf)
const repo = new IPFSRepo(repoPath, repoConf)

const ipfs = new IPFS({
repo: repo,
start: false,
EXPERIMENTAL: {
pubsub: true,
sharding: false,
dht: false
}
})

ipfs.on('error', (err) => {
reject(err)
})

ipfs.on('ready', () => {
resolve({ ipfs, repo })
})
const ipfs = await IPFS.create({
repo: repo,
start: false,
init: {
emptyRepo: true
},
EXPERIMENTAL: {
sharding: false,
dht: false
}
})

return { ipfs, repo }
}

module.exports = startIpfs
Loading

0 comments on commit 39b893d

Please sign in to comment.