forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenesis.go
46 lines (39 loc) · 913 Bytes
/
genesis.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
package main
import (
"flag"
"github.com/gnolang/gno/tm2/pkg/commands"
)
func newGenesisCmd(io commands.IO) *commands.Command {
cmd := commands.NewCommand(
commands.Metadata{
Name: "genesis",
ShortUsage: "genesis <subcommand> [flags] [<arg>...]",
ShortHelp: "gno genesis manipulation suite",
LongHelp: "Gno genesis.json manipulation suite, for managing genesis parameters",
},
commands.NewEmptyConfig(),
commands.HelpExec,
)
cmd.AddSubCommands(
newGenerateCmd(io),
newValidatorCmd(io),
newVerifyCmd(io),
newBalancesCmd(io),
newTxsCmd(io),
)
return cmd
}
// commonCfg is the common
// configuration for genesis commands
// that require a genesis.json
type commonCfg struct {
genesisPath string
}
func (c *commonCfg) RegisterFlags(fs *flag.FlagSet) {
fs.StringVar(
&c.genesisPath,
"genesis-path",
"./genesis.json",
"the path to the genesis.json",
)
}