added use of Cobra CLI

squash
This commit is contained in:
rigelrozanski
2017-02-23 00:21:13 -05:00
parent d4f6254551
commit 569fd474c2
13 changed files with 246 additions and 169 deletions

View File

@ -0,0 +1,27 @@
package commands
import (
"fmt"
"github.com/spf13/cobra"
"github.com/tendermint/go-wire"
"github.com/tendermint/tendermint/types"
)
var genValidatorCmd = &cobra.Command{
Use: "gen_validator",
Short: "Generate new validator keypair",
Run: genValidator,
}
func init() {
RootCmd.AddCommand(genValidatorCmd)
}
func genValidator(cmd *cobra.Command, args []string) {
privValidator := types.GenPrivValidator()
privValidatorJSONBytes := wire.JSONBytesPretty(privValidator)
fmt.Printf(`%v
`, string(privValidatorJSONBytes))
}