forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genesis_validator.go
49 lines (39 loc) · 882 Bytes
/
genesis_validator.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
package main
import (
"flag"
"github.com/gnolang/gno/tm2/pkg/commands"
)
type validatorCfg struct {
commonCfg
address string
}
// newValidatorCmd creates the genesis validator subcommand
func newValidatorCmd(io commands.IO) *commands.Command {
cfg := &validatorCfg{
commonCfg: commonCfg{},
}
cmd := commands.NewCommand(
commands.Metadata{
Name: "validator",
ShortUsage: "validator <subcommand> [flags]",
ShortHelp: "validator set management in genesis.json",
LongHelp: "Manipulates the genesis.json validator set",
},
cfg,
commands.HelpExec,
)
cmd.AddSubCommands(
newValidatorAddCmd(cfg, io),
newValidatorRemoveCmd(cfg, io),
)
return cmd
}
func (c *validatorCfg) RegisterFlags(fs *flag.FlagSet) {
c.commonCfg.RegisterFlags(fs)
fs.StringVar(
&c.address,
"address",
"",
"the gno bech32 address of the validator",
)
}