/
flags.go
55 lines (46 loc) · 1.14 KB
/
flags.go
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
package cmd
import (
"github.com/urfave/cli/v2"
"os"
"path/filepath"
)
var chainIDFlag = &cli.IntFlag{
Name: "chain-id",
Usage: "Chain id you'd like to select an rpc for",
Required: true,
}
var portFlag = &cli.IntFlag{
Name: "port",
Usage: "port to run the omniproxy on",
}
var maxSubmitAhead = &cli.IntFlag{
Name: "max-submit-ahead",
Usage: "max number of blocks to submit ahead",
Value: 0,
}
// set the default dir to the users home path/omnirpc.yaml.
func init() {
// user must set manually if this errors anyway
homeDir, _ := os.UserHomeDir()
defaultConfig := filepath.Join(homeDir, "omnirpc.yaml")
outputFlag.Value = defaultConfig
configFlag.Value = defaultConfig
}
var outputFlag = &cli.StringFlag{
Name: "output",
Usage: "path to output the new config file",
}
var configFlag = &cli.StringFlag{
Name: "config",
Usage: "path to output the new config file",
}
var fileFlag = &cli.StringFlag{
Name: "file",
Usage: "path to json file to debug",
}
var rpcFlag = &cli.StringFlag{
Name: "rpc",
Usage: "rpc url to rewrite requests from",
// --rpc-url is used by cast so we alias it here.
Aliases: []string{"rpc-url"},
}