forked from ChainSafe/ChainBridge
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflags.go
103 lines (89 loc) · 2.18 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: LGPL-3.0-only
package config
import (
log "github.com/ChainSafe/log15"
"github.com/urfave/cli/v2"
)
// Env vars
var (
HealthBlockTimeout = "BLOCK_TIMEOUT"
)
var (
ConfigFileFlag = &cli.StringFlag{
Name: "config",
Usage: "JSON configuration file",
}
VerbosityFlag = &cli.StringFlag{
Name: "verbosity",
Usage: "Supports levels crit (silent) to trce (trace)",
Value: log.LvlInfo.String(),
}
KeystorePathFlag = &cli.StringFlag{
Name: "keystore",
Usage: "Path to keystore directory",
Value: DefaultKeystorePath,
}
BlockstorePathFlag = &cli.StringFlag{
Name: "blockstore",
Usage: "Specify path for blockstore",
Value: "", // Empty will use home dir
}
FreshStartFlag = &cli.BoolFlag{
Name: "fresh",
Usage: "Disables loading from blockstore at start. Opts will still be used if specified.",
}
LatestBlockFlag = &cli.BoolFlag{
Name: "latest",
Usage: "Overrides blockstore and start block, starts from latest block",
}
)
// Metrics flags
var (
MetricsFlag = &cli.BoolFlag{
Name: "metrics",
Usage: "Enables metric server",
}
MetricsPort = &cli.IntFlag{
Name: "metricsPort",
Usage: "Port to serve metrics on",
Value: 8001,
}
)
// Generate subcommand flags
var (
PasswordFlag = &cli.StringFlag{
Name: "password",
Usage: "Password used to encrypt the keystore. Used with --generate, --import, or --unlock",
}
Sr25519Flag = &cli.BoolFlag{
Name: "sr25519",
Usage: "Specify account/key type as sr25519.",
}
Secp256k1Flag = &cli.BoolFlag{
Name: "secp256k1",
Usage: "Specify account/key type as secp256k1.",
}
)
var (
EthereumImportFlag = &cli.BoolFlag{
Name: "ethereum",
Usage: "Import an existing ethereum keystore, such as from geth.",
}
PrivateKeyFlag = &cli.StringFlag{
Name: "privateKey",
Usage: "Import a hex representation of a private key into a keystore.",
}
SubkeyNetworkFlag = &cli.UintFlag{
Name: "network",
Usage: "Specify the network to use for the address encoding (42/1/36)",
Value: 42,
}
)
// Test Setting Flags
var (
TestKeyFlag = &cli.StringFlag{
Name: "testkey",
Usage: "Applies a predetermined test keystore to the chains.",
}
)