mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-18 15:41:20 +00:00
28 lines
533 B
Go
28 lines
533 B
Go
package commands
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"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, _ := json.MarshalIndent(privValidator, "", "\t")
|
|
fmt.Printf(`%v
|
|
`, string(privValidatorJSONBytes))
|
|
}
|