From 4ab69f33db490e9c3d78b3816217c0bd818bac9e Mon Sep 17 00:00:00 2001 From: rhuairahrighairigh Date: Thu, 20 Jun 2019 18:08:58 +0100 Subject: [PATCH] rename cli and daemon binaries --- app/app.go | 4 ++-- app/app_test.go | 2 +- app/invariants.go | 2 +- cmd/gaiacli/main.go | 4 ++-- cmd/gaiad/main.go | 8 ++++---- init/genesis_accts.go | 4 ++-- init/gentx.go | 8 ++++---- init/testnet.go | 12 ++++++------ init/validate_genesis.go | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/app.go b/app/app.go index 317a931e..d5d94d42 100644 --- a/app/app.go +++ b/app/app.go @@ -33,8 +33,8 @@ const ( // default home directories for expected binaries var ( - DefaultCLIHome = os.ExpandEnv("$HOME/.gaiacli") - DefaultNodeHome = os.ExpandEnv("$HOME/.gaiad") + DefaultCLIHome = os.ExpandEnv("$HOME/.kvcli") + DefaultNodeHome = os.ExpandEnv("$HOME/.kvd") ) // Extended ABCI application diff --git a/app/app_test.go b/app/app_test.go index 9694fcbb..0378705f 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -53,7 +53,7 @@ func setGenesis(gapp *App, accs ...*auth.BaseAccount) error { return nil } -func TestGaiadExport(t *testing.T) { +func TestExport(t *testing.T) { db := db.NewMemDB() gapp := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0) setGenesis(gapp) diff --git a/app/invariants.go b/app/invariants.go index 0365dc4d..6cfbe16a 100644 --- a/app/invariants.go +++ b/app/invariants.go @@ -21,7 +21,7 @@ func (app *App) assertRuntimeInvariantsOnContext(ctx sdk.Context) { if err := ir.Invar(ctx); err != nil { panic(fmt.Errorf("invariant broken: %s\n"+ "\tCRITICAL please submit the following transaction:\n"+ - "\t\t gaiacli tx crisis invariant-broken %v %v", err, ir.ModuleName, ir.Route)) + "\t\t kvcli tx crisis invariant-broken %v %v", err, ir.ModuleName, ir.Route)) } } end := time.Now() diff --git a/cmd/gaiacli/main.go b/cmd/gaiacli/main.go index e0e9de2e..cf99c730 100644 --- a/cmd/gaiacli/main.go +++ b/cmd/gaiacli/main.go @@ -79,8 +79,8 @@ func main() { } rootCmd := &cobra.Command{ - Use: "gaiacli", - Short: "Command line interface for interacting with gaiad", + Use: "kvcli", + Short: "Command line interface for interacting with kvd", } // Add --chain-id to persistent flags and mark it required diff --git a/cmd/gaiad/main.go b/cmd/gaiad/main.go index 36fe1b24..076016ff 100644 --- a/cmd/gaiad/main.go +++ b/cmd/gaiad/main.go @@ -15,14 +15,14 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/kava-labs/kava/app" - gaiaInit "github.com/kava-labs/kava/init" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/kava-labs/kava/app" + gaiaInit "github.com/kava-labs/kava/init" ) -// gaiad custom flags +// kvd custom flags const flagInvCheckPeriod = "inv-check-period" var invCheckPeriod uint @@ -39,7 +39,7 @@ func main() { ctx := server.NewDefaultContext() cobra.EnableCommandSorting = false rootCmd := &cobra.Command{ - Use: "gaiad", + Use: "kvd", Short: "Gaia Daemon (server)", PersistentPreRunE: server.PersistentPreRunEFn(ctx), } diff --git a/init/genesis_accts.go b/init/genesis_accts.go index ef408dc8..161f405e 100644 --- a/init/genesis_accts.go +++ b/init/genesis_accts.go @@ -9,11 +9,11 @@ import ( "github.com/tendermint/tendermint/libs/common" "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/kava-labs/kava/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/kava-labs/kava/app" ) // AddGenesisAccountCmd returns add-genesis-account cobra Command. @@ -55,7 +55,7 @@ func AddGenesisAccountCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command genFile := config.GenesisFile() if !common.FileExists(genFile) { - return fmt.Errorf("%s does not exist, run `gaiad init` first", genFile) + return fmt.Errorf("%s does not exist, run `kvd init` first", genFile) } genDoc, err := LoadGenesisDoc(cdc, genFile) diff --git a/init/gentx.go b/init/gentx.go index 39b50722..8c66cf16 100644 --- a/init/gentx.go +++ b/init/gentx.go @@ -22,7 +22,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/utils" - "github.com/kava-labs/kava/app" "github.com/cosmos/cosmos-sdk/codec" kbkeys "github.com/cosmos/cosmos-sdk/crypto/keys" "github.com/cosmos/cosmos-sdk/server" @@ -30,6 +29,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth" authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" + "github.com/kava-labs/kava/app" ) var ( @@ -41,14 +41,14 @@ var ( defaultMinSelfDelegation = "1" ) -// GenTxCmd builds the gaiad gentx command. +// GenTxCmd builds the kvd gentx command. // nolint: errcheck func GenTxCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "gentx", Short: "Generate a genesis tx carrying a self delegation", Args: cobra.NoArgs, - Long: fmt.Sprintf(`This command is an alias of the 'gaiad tx create-validator' command'. + Long: fmt.Sprintf(`This command is an alias of the 'kvd tx create-validator' command'. It creates a genesis piece carrying a self delegation with the following delegation and commission default parameters: @@ -153,7 +153,7 @@ following delegation and commission default parameters: } if info.GetType() == kbkeys.TypeOffline || info.GetType() == kbkeys.TypeMulti { - fmt.Println("Offline key passed in. Use `gaiacli tx sign` command to sign:") + fmt.Println("Offline key passed in. Use `kvcli tx sign` command to sign:") return utils.PrintUnsignedStdTx(txBldr, cliCtx, []sdk.Msg{msg}, true) } diff --git a/init/testnet.go b/init/testnet.go index 143dc43a..cde2fed4 100644 --- a/init/testnet.go +++ b/init/testnet.go @@ -12,13 +12,13 @@ import ( "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client" - "github.com/kava-labs/kava/app" "github.com/cosmos/cosmos-sdk/codec" srvconfig "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" authtx "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder" "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/kava-labs/kava/app" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -47,14 +47,14 @@ func TestnetFilesCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "testnet", - Short: "Initialize files for a Gaiad testnet", + Short: "Initialize files for a testnet", Long: `testnet will create "v" number of directories and populate each with necessary files (private validator, genesis, config, etc.). Note, strict routability for addresses is turned off in the config file. Example: - gaiad testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + kvd testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 `, RunE: func(_ *cobra.Command, _ []string) error { config := ctx.Config @@ -71,10 +71,10 @@ Example: cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix the directory name for each node with (node results in node0, node1, ...)", ) - cmd.Flags().String(flagNodeDaemonHome, "gaiad", + cmd.Flags().String(flagNodeDaemonHome, "kvd", "Home directory of the node's daemon configuration", ) - cmd.Flags().String(flagNodeCliHome, "gaiacli", + cmd.Flags().String(flagNodeCliHome, "kvcli", "Home directory of the node's cli configuration", ) cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", @@ -236,7 +236,7 @@ func initTestnet(config *tmconfig.Config, cdc *codec.Codec) error { return err } - gaiaConfigFilePath := filepath.Join(nodeDir, "config/gaiad.toml") + gaiaConfigFilePath := filepath.Join(nodeDir, "config/kvd.toml") srvconfig.WriteConfigFile(gaiaConfigFilePath, gaiaConfig) } diff --git a/init/validate_genesis.go b/init/validate_genesis.go index 537a883e..852c8761 100644 --- a/init/validate_genesis.go +++ b/init/validate_genesis.go @@ -4,9 +4,9 @@ import ( "fmt" "os" - "github.com/kava-labs/kava/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" + "github.com/kava-labs/kava/app" "github.com/spf13/cobra" "github.com/tendermint/tendermint/types" ) @@ -44,7 +44,7 @@ func ValidateGenesisCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command { return fmt.Errorf("Error validating genesis file %s: %s", genesis, err.Error()) } - fmt.Printf("File at %s is a valid genesis file for gaiad\n", genesis) + fmt.Printf("File at %s is a valid genesis file for kvd\n", genesis) return nil }, }