2018-02-22 07:17:19 -08:00
|
|
|
package keys
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
2019-12-11 01:45:26 -08:00
|
|
|
"github.com/spf13/viper"
|
2018-12-10 06:27:25 -08:00
|
|
|
|
2019-05-28 01:44:04 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
2018-02-22 07:17:19 -08:00
|
|
|
)
|
|
|
|
|
2018-02-22 08:20:25 -08:00
|
|
|
// Commands registers a sub-tree of commands to interact with
|
|
|
|
// local private key storage.
|
|
|
|
func Commands() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "keys",
|
|
|
|
Short: "Add or view local private keys",
|
|
|
|
Long: `Keys allows you to manage your local keystore for tendermint.
|
2018-02-22 07:17:19 -08:00
|
|
|
|
2018-02-22 08:20:25 -08:00
|
|
|
These keys may be in any format supported by go-crypto and can be
|
|
|
|
used by light-clients, full nodes, or any other application that
|
|
|
|
needs to sign with a private key.`,
|
|
|
|
}
|
|
|
|
cmd.AddCommand(
|
2019-12-12 13:52:24 -08:00
|
|
|
MnemonicKeyCommand(),
|
|
|
|
AddKeyCommand(),
|
|
|
|
ExportKeyCommand(),
|
|
|
|
ImportKeyCommand(),
|
|
|
|
ListKeysCmd(),
|
|
|
|
ShowKeysCmd(),
|
2019-05-28 01:44:04 -07:00
|
|
|
flags.LineBreak,
|
2019-12-12 13:52:24 -08:00
|
|
|
DeleteKeyCommand(),
|
|
|
|
UpdateKeyCommand(),
|
|
|
|
ParseKeyStringCommand(),
|
|
|
|
MigrateCommand(),
|
2018-02-22 08:20:25 -08:00
|
|
|
)
|
2019-12-11 01:45:26 -08:00
|
|
|
cmd.PersistentFlags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
|
|
|
|
viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend))
|
2018-02-22 08:20:25 -08:00
|
|
|
return cmd
|
2018-02-22 07:17:19 -08:00
|
|
|
}
|