Rename seeds command to commits
This commit is contained in:
parent
9442e7e04a
commit
6f87b0a42f
|
@ -1,4 +1,4 @@
|
||||||
package seeds
|
package commits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
@ -12,21 +12,21 @@ import (
|
||||||
|
|
||||||
var exportCmd = &cobra.Command{
|
var exportCmd = &cobra.Command{
|
||||||
Use: "export <file>",
|
Use: "export <file>",
|
||||||
Short: "Export selected seeds to given file",
|
Short: "Export selected commits to given file",
|
||||||
Long: `Exports the most recent seed to a binary file.
|
Long: `Exports the most recent commit to a binary file.
|
||||||
If desired, you can select by an older height or validator hash.
|
If desired, you can select by an older height or validator hash.
|
||||||
`,
|
`,
|
||||||
RunE: commands.RequireInit(exportSeed),
|
RunE: commands.RequireInit(exportCommit),
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
exportCmd.Flags().Int(heightFlag, 0, "Show the seed with closest height to this")
|
exportCmd.Flags().Int(heightFlag, 0, "Show the commit with closest height to this")
|
||||||
exportCmd.Flags().String(hashFlag, "", "Show the seed matching the validator hash")
|
exportCmd.Flags().String(hashFlag, "", "Show the commit matching the validator hash")
|
||||||
RootCmd.AddCommand(exportCmd)
|
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 {
|
if len(args) != 1 || len(args[0]) == 0 {
|
||||||
return errors.New("You must provide a filepath to output")
|
return errors.New("You must provide a filepath to output")
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package seeds
|
package commits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -18,9 +18,9 @@ const (
|
||||||
|
|
||||||
var importCmd = &cobra.Command{
|
var importCmd = &cobra.Command{
|
||||||
Use: "import <file>",
|
Use: "import <file>",
|
||||||
Short: "Imports a new seed from the given file",
|
Short: "Imports a new commit from the given file",
|
||||||
Long: `Validate this file and update to the given seed if secure.`,
|
Long: `Validate this file and update to the given commit if secure.`,
|
||||||
RunE: commands.RequireInit(importSeed),
|
RunE: commands.RequireInit(importCommit),
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ func init() {
|
||||||
RootCmd.AddCommand(importCmd)
|
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 {
|
if len(args) != 1 || len(args[0]) == 0 {
|
||||||
return errors.New("You must provide an input file")
|
return errors.New("You must provide an input file")
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
package seeds
|
package commits
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
import "github.com/spf13/cobra"
|
||||||
|
|
||||||
// RootCmd represents the base command when called without any subcommands
|
// RootCmd represents the base command when called without any subcommands
|
||||||
var RootCmd = &cobra.Command{
|
var RootCmd = &cobra.Command{
|
||||||
Use: "seeds",
|
Use: "commits",
|
||||||
Short: "Verify seeds from your local store",
|
Short: "Verify commits from your local store",
|
||||||
Long: `Seeds allows you to inspect and update the validator set for the chain.
|
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
|
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.
|
is used to verify all header and merkle proofs.
|
||||||
`,
|
`,
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package seeds
|
package commits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
@ -31,9 +31,9 @@ If desired, you can select by height, validator hash, or a file.
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
showCmd.Flags().Int(heightFlag, 0, "Show the seed with closest height to this")
|
showCmd.Flags().Int(heightFlag, 0, "Show the commit with closest height to this")
|
||||||
showCmd.Flags().String(hashFlag, "", "Show the seed matching the validator hash")
|
showCmd.Flags().String(hashFlag, "", "Show the commit matching the validator hash")
|
||||||
showCmd.Flags().String(fileFlag, "", "Show the seed stored in the given file")
|
showCmd.Flags().String(fileFlag, "", "Show the commit stored in the given file")
|
||||||
RootCmd.AddCommand(showCmd)
|
RootCmd.AddCommand(showCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package seeds
|
package commits
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -9,11 +9,11 @@ import (
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands"
|
"github.com/cosmos/cosmos-sdk/client/commands"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/auto"
|
"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/keys"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
|
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
||||||
rpccmd "github.com/cosmos/cosmos-sdk/client/commands/rpc"
|
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"
|
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
|
||||||
authcmd "github.com/cosmos/cosmos-sdk/modules/auth/commands"
|
authcmd "github.com/cosmos/cosmos-sdk/modules/auth/commands"
|
||||||
basecmd "github.com/cosmos/cosmos-sdk/modules/base/commands"
|
basecmd "github.com/cosmos/cosmos-sdk/modules/base/commands"
|
||||||
|
@ -77,7 +77,7 @@ func main() {
|
||||||
commands.InitCmd,
|
commands.InitCmd,
|
||||||
commands.ResetCmd,
|
commands.ResetCmd,
|
||||||
keys.RootCmd,
|
keys.RootCmd,
|
||||||
seeds.RootCmd,
|
commits.RootCmd,
|
||||||
rpccmd.RootCmd,
|
rpccmd.RootCmd,
|
||||||
query.RootCmd,
|
query.RootCmd,
|
||||||
txcmd.RootCmd,
|
txcmd.RootCmd,
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"github.com/tendermint/tmlibs/cli"
|
"github.com/tendermint/tmlibs/cli"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands"
|
"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/keys"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
|
"github.com/cosmos/cosmos-sdk/client/commands/proxy"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
"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"
|
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
|
||||||
bcount "github.com/cosmos/cosmos-sdk/examples/counter/cmd/countercli/commands"
|
bcount "github.com/cosmos/cosmos-sdk/examples/counter/cmd/countercli/commands"
|
||||||
|
@ -74,7 +74,7 @@ func main() {
|
||||||
commands.ResetCmd,
|
commands.ResetCmd,
|
||||||
commands.VersionCmd,
|
commands.VersionCmd,
|
||||||
keys.RootCmd,
|
keys.RootCmd,
|
||||||
seeds.RootCmd,
|
commits.RootCmd,
|
||||||
query.RootCmd,
|
query.RootCmd,
|
||||||
txcmd.RootCmd,
|
txcmd.RootCmd,
|
||||||
proxy.RootCmd,
|
proxy.RootCmd,
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands"
|
"github.com/cosmos/cosmos-sdk/client/commands"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/auto"
|
"github.com/cosmos/cosmos-sdk/client/commands/auto"
|
||||||
|
"github.com/cosmos/cosmos-sdk/client/commands/commits"
|
||||||
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
"github.com/cosmos/cosmos-sdk/client/commands/query"
|
||||||
rpccmd "github.com/cosmos/cosmos-sdk/client/commands/rpc"
|
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"
|
txcmd "github.com/cosmos/cosmos-sdk/client/commands/txs"
|
||||||
eyescmd "github.com/cosmos/cosmos-sdk/modules/eyes/commands"
|
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
|
// we use out own init command to not require address arg
|
||||||
commands.InitCmd,
|
commands.InitCmd,
|
||||||
commands.ResetCmd,
|
commands.ResetCmd,
|
||||||
seeds.RootCmd,
|
commits.RootCmd,
|
||||||
rpccmd.RootCmd,
|
rpccmd.RootCmd,
|
||||||
query.RootCmd,
|
query.RootCmd,
|
||||||
txcmd.RootCmd,
|
txcmd.RootCmd,
|
||||||
|
|
Loading…
Reference in New Issue