mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 16:25:21 +00:00
rename cli and daemon binaries
This commit is contained in:
parent
ec312fefc8
commit
4ab69f33db
@ -33,8 +33,8 @@ const (
|
|||||||
|
|
||||||
// default home directories for expected binaries
|
// default home directories for expected binaries
|
||||||
var (
|
var (
|
||||||
DefaultCLIHome = os.ExpandEnv("$HOME/.gaiacli")
|
DefaultCLIHome = os.ExpandEnv("$HOME/.kvcli")
|
||||||
DefaultNodeHome = os.ExpandEnv("$HOME/.gaiad")
|
DefaultNodeHome = os.ExpandEnv("$HOME/.kvd")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Extended ABCI application
|
// Extended ABCI application
|
||||||
|
@ -53,7 +53,7 @@ func setGenesis(gapp *App, accs ...*auth.BaseAccount) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGaiadExport(t *testing.T) {
|
func TestExport(t *testing.T) {
|
||||||
db := db.NewMemDB()
|
db := db.NewMemDB()
|
||||||
gapp := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0)
|
gapp := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0)
|
||||||
setGenesis(gapp)
|
setGenesis(gapp)
|
||||||
|
@ -21,7 +21,7 @@ func (app *App) assertRuntimeInvariantsOnContext(ctx sdk.Context) {
|
|||||||
if err := ir.Invar(ctx); err != nil {
|
if err := ir.Invar(ctx); err != nil {
|
||||||
panic(fmt.Errorf("invariant broken: %s\n"+
|
panic(fmt.Errorf("invariant broken: %s\n"+
|
||||||
"\tCRITICAL please submit the following transaction:\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()
|
end := time.Now()
|
||||||
|
@ -79,8 +79,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := &cobra.Command{
|
||||||
Use: "gaiacli",
|
Use: "kvcli",
|
||||||
Short: "Command line interface for interacting with gaiad",
|
Short: "Command line interface for interacting with kvd",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add --chain-id to persistent flags and mark it required
|
// Add --chain-id to persistent flags and mark it required
|
||||||
|
@ -15,14 +15,14 @@ import (
|
|||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"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/server"
|
||||||
"github.com/cosmos/cosmos-sdk/store"
|
"github.com/cosmos/cosmos-sdk/store"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
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"
|
const flagInvCheckPeriod = "inv-check-period"
|
||||||
|
|
||||||
var invCheckPeriod uint
|
var invCheckPeriod uint
|
||||||
@ -39,7 +39,7 @@ func main() {
|
|||||||
ctx := server.NewDefaultContext()
|
ctx := server.NewDefaultContext()
|
||||||
cobra.EnableCommandSorting = false
|
cobra.EnableCommandSorting = false
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := &cobra.Command{
|
||||||
Use: "gaiad",
|
Use: "kvd",
|
||||||
Short: "Gaia Daemon (server)",
|
Short: "Gaia Daemon (server)",
|
||||||
PersistentPreRunE: server.PersistentPreRunEFn(ctx),
|
PersistentPreRunE: server.PersistentPreRunEFn(ctx),
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@ import (
|
|||||||
"github.com/tendermint/tendermint/libs/common"
|
"github.com/tendermint/tendermint/libs/common"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||||
"github.com/kava-labs/kava/app"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
"github.com/cosmos/cosmos-sdk/server"
|
"github.com/cosmos/cosmos-sdk/server"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
|
"github.com/kava-labs/kava/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddGenesisAccountCmd returns add-genesis-account cobra Command.
|
// AddGenesisAccountCmd returns add-genesis-account cobra Command.
|
||||||
@ -55,7 +55,7 @@ func AddGenesisAccountCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command
|
|||||||
|
|
||||||
genFile := config.GenesisFile()
|
genFile := config.GenesisFile()
|
||||||
if !common.FileExists(genFile) {
|
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)
|
genDoc, err := LoadGenesisDoc(cdc, genFile)
|
||||||
|
@ -22,7 +22,6 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/kava-labs/kava/app"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
kbkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
kbkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
"github.com/cosmos/cosmos-sdk/server"
|
"github.com/cosmos/cosmos-sdk/server"
|
||||||
@ -30,6 +29,7 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
"github.com/cosmos/cosmos-sdk/x/staking/client/cli"
|
"github.com/cosmos/cosmos-sdk/x/staking/client/cli"
|
||||||
|
"github.com/kava-labs/kava/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -41,14 +41,14 @@ var (
|
|||||||
defaultMinSelfDelegation = "1"
|
defaultMinSelfDelegation = "1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenTxCmd builds the gaiad gentx command.
|
// GenTxCmd builds the kvd gentx command.
|
||||||
// nolint: errcheck
|
// nolint: errcheck
|
||||||
func GenTxCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command {
|
func GenTxCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "gentx",
|
Use: "gentx",
|
||||||
Short: "Generate a genesis tx carrying a self delegation",
|
Short: "Generate a genesis tx carrying a self delegation",
|
||||||
Args: cobra.NoArgs,
|
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
|
It creates a genesis piece carrying a self delegation with the
|
||||||
following delegation and commission default parameters:
|
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 {
|
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)
|
return utils.PrintUnsignedStdTx(txBldr, cliCtx, []sdk.Msg{msg}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,13 +12,13 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
"github.com/kava-labs/kava/app"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authtx "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtx "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||||
|
"github.com/kava-labs/kava/app"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@ -47,14 +47,14 @@ func TestnetFilesCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command {
|
|||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "testnet",
|
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
|
Long: `testnet will create "v" number of directories and populate each with
|
||||||
necessary files (private validator, genesis, config, etc.).
|
necessary files (private validator, genesis, config, etc.).
|
||||||
|
|
||||||
Note, strict routability for addresses is turned off in the config file.
|
Note, strict routability for addresses is turned off in the config file.
|
||||||
|
|
||||||
Example:
|
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 {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
config := ctx.Config
|
config := ctx.Config
|
||||||
@ -71,10 +71,10 @@ Example:
|
|||||||
cmd.Flags().String(flagNodeDirPrefix, "node",
|
cmd.Flags().String(flagNodeDirPrefix, "node",
|
||||||
"Prefix the directory name for each node with (node results in node0, node1, ...)",
|
"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",
|
"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",
|
"Home directory of the node's cli configuration",
|
||||||
)
|
)
|
||||||
cmd.Flags().String(flagStartingIPAddress, "192.168.0.1",
|
cmd.Flags().String(flagStartingIPAddress, "192.168.0.1",
|
||||||
@ -236,7 +236,7 @@ func initTestnet(config *tmconfig.Config, cdc *codec.Codec) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
gaiaConfigFilePath := filepath.Join(nodeDir, "config/gaiad.toml")
|
gaiaConfigFilePath := filepath.Join(nodeDir, "config/kvd.toml")
|
||||||
srvconfig.WriteConfigFile(gaiaConfigFilePath, gaiaConfig)
|
srvconfig.WriteConfigFile(gaiaConfigFilePath, gaiaConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/kava-labs/kava/app"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
"github.com/cosmos/cosmos-sdk/server"
|
"github.com/cosmos/cosmos-sdk/server"
|
||||||
|
"github.com/kava-labs/kava/app"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/tendermint/tendermint/types"
|
"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())
|
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
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user