Rename seeds command to commits

This commit is contained in:
Ethan Frey 2017-10-23 19:30:36 +02:00
parent 9442e7e04a
commit 6f87b0a42f
8 changed files with 28 additions and 28 deletions

View File

@ -1,4 +1,4 @@
package seeds
package commits
import (
"github.com/pkg/errors"
@ -12,21 +12,21 @@ import (
var exportCmd = &cobra.Command{
Use: "export <file>",
Short: "Export selected seeds to given file",
Long: `Exports the most recent seed to a binary file.
Short: "Export selected commits to given file",
Long: `Exports the most recent commit to a binary file.
If desired, you can select by an older height or validator hash.
`,
RunE: commands.RequireInit(exportSeed),
RunE: commands.RequireInit(exportCommit),
SilenceUsage: true,
}
func init() {
exportCmd.Flags().Int(heightFlag, 0, "Show the seed with closest height to this")
exportCmd.Flags().String(hashFlag, "", "Show the seed matching the validator hash")
exportCmd.Flags().Int(heightFlag, 0, "Show the commit with closest height to this")
exportCmd.Flags().String(hashFlag, "", "Show the commit matching the validator hash")
RootCmd.AddCommand(exportCmd)
}
func exportSeed(cmd *cobra.Command, args []string) error {
func exportCommit(cmd *cobra.Command, args []string) error {
if len(args) != 1 || len(args[0]) == 0 {
return errors.New("You must provide a filepath to output")
}

View File

@ -1,4 +1,4 @@
package seeds
package commits
import (
"fmt"
@ -18,9 +18,9 @@ const (
var importCmd = &cobra.Command{
Use: "import <file>",
Short: "Imports a new seed from the given file",
Long: `Validate this file and update to the given seed if secure.`,
RunE: commands.RequireInit(importSeed),
Short: "Imports a new commit from the given file",
Long: `Validate this file and update to the given commit if secure.`,
RunE: commands.RequireInit(importCommit),
SilenceUsage: true,
}
@ -29,7 +29,7 @@ func init() {
RootCmd.AddCommand(importCmd)
}
func importSeed(cmd *cobra.Command, args []string) error {
func importCommit(cmd *cobra.Command, args []string) error {
if len(args) != 1 || len(args[0]) == 0 {
return errors.New("You must provide an input file")
}

View File

@ -1,15 +1,15 @@
package seeds
package commits
import "github.com/spf13/cobra"
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "seeds",
Short: "Verify seeds from your local store",
Long: `Seeds allows you to inspect and update the validator set for the chain.
Use: "commits",
Short: "Verify commits from your local store",
Long: `Commits allows you to inspect and update the validator set for the chain.
Since all security in a PoS system is based on having the correct validator
set, it is important to inspect the seeds to maintain the security, which
set, it is important to inspect the commits to maintain the security, which
is used to verify all header and merkle proofs.
`,
}

View File

@ -1,4 +1,4 @@
package seeds
package commits
import (
"encoding/hex"
@ -31,9 +31,9 @@ If desired, you can select by height, validator hash, or a file.
}
func init() {
showCmd.Flags().Int(heightFlag, 0, "Show the seed with closest height to this")
showCmd.Flags().String(hashFlag, "", "Show the seed matching the validator hash")
showCmd.Flags().String(fileFlag, "", "Show the seed stored in the given file")
showCmd.Flags().Int(heightFlag, 0, "Show the commit with closest height to this")
showCmd.Flags().String(hashFlag, "", "Show the commit matching the validator hash")
showCmd.Flags().String(fileFlag, "", "Show the commit stored in the given file")
RootCmd.AddCommand(showCmd)
}

View File

@ -1,4 +1,4 @@
package seeds
package commits
import (
"fmt"

View File

@ -9,11 +9,11 @@ import (
"github.com/cosmos/cosmos-sdk/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands/auto"
"github.com/cosmos/cosmos-sdk/client/commands/commits"
"github.com/cosmos/cosmos-sdk/client/commands/keys"
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
"github.com/cosmos/cosmos-sdk/client/commands/query"
rpccmd "github.com/cosmos/cosmos-sdk/client/commands/rpc"
"github.com/cosmos/cosmos-sdk/client/commands/seeds"
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
authcmd "github.com/cosmos/cosmos-sdk/modules/auth/commands"
basecmd "github.com/cosmos/cosmos-sdk/modules/base/commands"
@ -77,7 +77,7 @@ func main() {
commands.InitCmd,
commands.ResetCmd,
keys.RootCmd,
seeds.RootCmd,
commits.RootCmd,
rpccmd.RootCmd,
query.RootCmd,
txcmd.RootCmd,

View File

@ -8,10 +8,10 @@ import (
"github.com/tendermint/tmlibs/cli"
"github.com/cosmos/cosmos-sdk/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands/commits"
"github.com/cosmos/cosmos-sdk/client/commands/keys"
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
"github.com/cosmos/cosmos-sdk/client/commands/query"
"github.com/cosmos/cosmos-sdk/client/commands/seeds"
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
bcount "github.com/cosmos/cosmos-sdk/examples/counter/cmd/countercli/commands"
@ -74,7 +74,7 @@ func main() {
commands.ResetCmd,
commands.VersionCmd,
keys.RootCmd,
seeds.RootCmd,
commits.RootCmd,
query.RootCmd,
txcmd.RootCmd,
proxy.RootCmd,

View File

@ -9,9 +9,9 @@ import (
"github.com/cosmos/cosmos-sdk/client/commands"
"github.com/cosmos/cosmos-sdk/client/commands/auto"
"github.com/cosmos/cosmos-sdk/client/commands/commits"
"github.com/cosmos/cosmos-sdk/client/commands/query"
rpccmd "github.com/cosmos/cosmos-sdk/client/commands/rpc"
"github.com/cosmos/cosmos-sdk/client/commands/seeds"
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
eyescmd "github.com/cosmos/cosmos-sdk/modules/eyes/commands"
)
@ -50,7 +50,7 @@ func main() {
// we use out own init command to not require address arg
commands.InitCmd,
commands.ResetCmd,
seeds.RootCmd,
commits.RootCmd,
rpccmd.RootCmd,
query.RootCmd,
txcmd.RootCmd,