This repository was archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathstart.js
More file actions
49 lines (46 loc) · 1.39 KB
/
Copy pathstart.js
File metadata and controls
49 lines (46 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const program = require('commander')
const start = require('./index.js')
program
.option('-g, --ganache', 'Start Ganache')
.option('-i, --ipfs', 'Start IPFS')
.option('-p, --populate-ipfs', 'Populate IPFS')
.option('-f, --fixtures', 'Deploy contracts and push IPFS fixtures')
.option('-s, --setup', 'Write contracts, populate IPFS fixtures, then exit')
.option('-t, --truffle', 'Write contract addresses to Truffle json')
.option('-x, --ssl-proxy', 'Start SSL proxy')
.option('-r, --relayer', 'Start Relayer')
.option('-q, --graphql', 'Start GraphQL Server (Performance)')
.option('-l, --listener', 'Start Listener')
.option('-d, --discovery', 'Start Discovery server')
.option('-q, --quiet', 'Quiet')
.parse(process.argv)
async function setup() {
const stop = await start({
ganache: true,
deployContracts: true,
ipfs: true,
populate: true,
writeTruffle: true
})
stop()
}
if (!process.argv.slice(2).length) {
program.outputHelp()
process.exit(1)
} else if (program.setup) {
setup()
} else {
start({
ganache: program.ganache,
deployContracts: program.fixtures,
ipfs: program.ipfs,
populate: program.populateIpfs,
writeTruffle: program.truffle,
sslProxy: program.sslProxy,
relayer: program.relayer,
graphqlServer: program.graphql,
listener: program.listener,
discovery: program.discovery,
quiet: program.quiet
})
}