2018-02-22 07:17:19 -08:00
|
|
|
// Copyright © 2017 Ethan Frey
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package keys
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2018-02-22 08:20:25 -08:00
|
|
|
var lineBreak = &cobra.Command{Run: func(*cobra.Command, []string) {}}
|
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(
|
|
|
|
addKeyCommand(),
|
|
|
|
listKeysCmd,
|
|
|
|
showKeysCmd,
|
|
|
|
lineBreak,
|
|
|
|
deleteKeyCommand(),
|
|
|
|
updateKeyCommand(),
|
|
|
|
)
|
|
|
|
return cmd
|
2018-02-22 07:17:19 -08:00
|
|
|
}
|