-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
48 lines (41 loc) · 1.03 KB
/
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
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
import prompts from "prompts";
import argv from "minimist";
import {
commands,
string,
logo,
parseArgv,
deployTab,
startTab,
} from "./utils/cli.js";
import {
deploy as deployHub,
start as startQourier,
module as requiredModules,
} from "./lib/ethers/index.js";
let a = parseArgv(argv(process.argv.slice(2), { string }));
prompts.override(a);
(async () => {
console.log(logo);
const first = await prompts(commands.script);
if (!first || !Object.keys(first).length) return;
const last = await prompts(commands[first.script]);
let address = last.address || "";
if (first.script === "deploy") {
if (deployTab(a)) console.log("");
address = await deployHub(
first.network,
first.key,
last.price,
last.module,
last.personal
);
}
if (first.script === "start" || last.start) {
if (startTab(a)) console.log("");
await requiredModules(first.network, first.key, address);
await startQourier(first.network, first.key, address);
} else {
process.exit(0);
}
})();