-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathindex.ts
More file actions
66 lines (64 loc) · 2.14 KB
/
index.ts
File metadata and controls
66 lines (64 loc) · 2.14 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { hideBin } from "yargs/helpers";
import Yargs from "yargs/yargs";
import { stressOptions } from "./stress";
import { redisReadCommand, redisInitCommand } from "./redis";
import { writeConfigCommand, writeGethGenesisCommand, writePrysmCommand, writeL2ChainConfigCommand, writeL3ChainConfigCommand } from "./config";
import {
printAddressCommand,
namedAccountHelpString,
writeAccountsCommand,
printPrivateKeyCommand,
} from "./accounts";
import {
bridgeFundsCommand,
bridgeNativeTokenToL3Command,
bridgeToL3Command,
createERC20Command,
sendL1Command,
sendL2Command,
sendL3Command,
sendRPCCommand,
transferL3ChainOwnershipCommand
} from "./ethcommands";
async function main() {
await Yargs(hideBin(process.argv))
.options({
redisUrl: { string: true, default: "redis://redis:6379" },
l1url: { string: true, default: "ws://geth:8546" },
l2url: { string: true, default: "ws://sequencer:8548" },
l3url: { string: true, default: "ws://l3node:3348" },
validationNodeUrl: { string: true, default: "ws://validation_node:8549" },
l2owner: { string: true, default: "0x0000000000000000000000000000000000000000" },
l3owner: { string: true, default: "0x0000000000000000000000000000000000000000" },
})
.options(stressOptions)
.command(bridgeFundsCommand)
.command(bridgeToL3Command)
.command(bridgeNativeTokenToL3Command)
.command(createERC20Command)
.command(sendL1Command)
.command(sendL2Command)
.command(sendL3Command)
.command(sendRPCCommand)
.command(transferL3ChainOwnershipCommand)
.command(writeConfigCommand)
.command(writeGethGenesisCommand)
.command(writeL2ChainConfigCommand)
.command(writeL3ChainConfigCommand)
.command(writePrysmCommand)
.command(writeAccountsCommand)
.command(printAddressCommand)
.command(printPrivateKeyCommand)
.command(redisReadCommand)
.command(redisInitCommand)
.strict()
.demandCommand(1, "a command must be specified")
.epilogue(namedAccountHelpString)
.help().argv;
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});