Merge pull request #764 from cosmos/bucky/cli

remove --testnet flag. just output all info on init
This commit is contained in:
Ethan Buchman 2018-04-01 21:49:47 +03:00 committed by GitHub
commit ac4409d432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 22 deletions

View File

@ -6,7 +6,6 @@ import (
"io/ioutil" "io/ioutil"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper"
cmn "github.com/tendermint/tmlibs/common" cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log" "github.com/tendermint/tmlibs/log"
@ -17,10 +16,6 @@ import (
tmtypes "github.com/tendermint/tendermint/types" tmtypes "github.com/tendermint/tendermint/types"
) )
const (
flagTestnet = "testnet"
)
type testnetInformation struct { type testnetInformation struct {
Secret string `json:"secret"` Secret string `json:"secret"`
Account string `json:"account"` Account string `json:"account"`
@ -43,11 +38,10 @@ func InitCmd(gen GenAppState, logger log.Logger) *cobra.Command {
Short: "Initialize genesis files", Short: "Initialize genesis files",
RunE: cmd.run, RunE: cmd.run,
} }
cobraCmd.Flags().Bool(flagTestnet, false, "Output testnet information in JSON")
return &cobraCmd return &cobraCmd
} }
// GenAppState can parse command-line and flag to // GenAppState can parse command-line to
// generate default app_state for the genesis file. // generate default app_state for the genesis file.
// Also must return generated seed and address // Also must return generated seed and address
// This is application-specific // This is application-specific
@ -62,10 +56,6 @@ func (c initCmd) run(cmd *cobra.Command, args []string) error {
// Store testnet information as we go // Store testnet information as we go
var testnetInfo testnetInformation var testnetInfo testnetInformation
if viper.GetBool(flagTestnet) {
c.logger = log.NewFilter(c.logger, log.AllowError())
}
// Run the basic tendermint initialization, // Run the basic tendermint initialization,
// set up a default genesis with no app_options // set up a default genesis with no app_options
config, err := tcmd.ParseConfig() config, err := tcmd.ParseConfig()
@ -97,7 +87,6 @@ func (c initCmd) run(cmd *cobra.Command, args []string) error {
return err return err
} }
if viper.GetBool(flagTestnet) {
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
if err != nil { if err != nil {
return err return err
@ -108,7 +97,6 @@ func (c initCmd) run(cmd *cobra.Command, args []string) error {
return err return err
} }
fmt.Println(string(out)) fmt.Println(string(out))
}
return nil return nil
} }