package commands import ( "encoding/hex" "encoding/json" "fmt" "io/ioutil" "os" "strings" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tmlibs/common" ) var ( // InitCmd - node initialization command InitCmd = GetInitCmd("mycoin", []string{}) //nolint - flags FlagChainID = "chain-id" //TODO group with other flags or remove? is this already a flag here? FlagDenom = "denom" //TODO group with other flags or remove? is this already a flag here? FlagOption = "option" FlagStatic = "static" ) // GetInitCmd - get the node initialization command, with a custom genesis account denom func GetInitCmd(defaultDenom string, options []string) *cobra.Command { initCmd := &cobra.Command{ Use: "init [address]", Short: "Initialize genesis files for a blockchain", RunE: initCmd, } initCmd.Flags().String(FlagChainID, "test_chain_id", "Chain ID") initCmd.Flags().String(FlagDenom, defaultDenom, "Coin denomination for genesis account") initCmd.Flags().StringSliceP(FlagOption, "p", options, "Genesis option in the format /