forked from daostack/alchemy-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
23 lines (21 loc) · 754 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const Ganache = require('ganache-cli')
const path = require('path')
const defaults = {
db_path: path.normalize(path.join(__dirname, './db')),
seed: 'TestRPC is awesome!' // default ganache-cli mnemonic (https://github.com/trufflesuite/ganache-cli/blob/develop/cli.js#L45)
}
const migration = require(path.normalize(path.join(__dirname, './migration.json')))
module.exports = {
Ganache: {
server: opts => Ganache.server({ ...defaults, ...opts }),
provider: opts => Ganache.provider({ ...defaults, ...opts })
},
migration: network => {
if (network in migration) {
return migration[network]
} else {
throw new Error(`Could not retrieve migration result for network ${network}`)
}
},
...require('./migrate')
}