revise file structure in cmd

This commit is contained in:
Solovyov1796 2024-05-01 12:26:39 +08:00 committed by 0g-wh
parent ea01bc63be
commit ed275dcdae
18 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,5 +1,5 @@
// Sourced from https://github.com/evmos/ethermint/blob/main/cmd/ethermintd/genaccounts.go // Sourced from https://github.com/evmos/ethermint/blob/main/cmd/ethermintd/genaccounts.go
package cmd package main
import ( import (
"bufio" "bufio"

View File

@ -6,14 +6,16 @@ import (
"github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/0glabs/0g-chain/app" "github.com/0glabs/0g-chain/chaincfg"
"github.com/0glabs/0g-chain/cmd/kava/cmd"
) )
func main() { func main() {
rootCmd := cmd.NewRootCmd() chaincfg.SetSDKConfig().Seal()
chaincfg.RegisterDenoms()
if err := svrcmd.Execute(rootCmd, cmd.EnvPrefix, app.DefaultNodeHome); err != nil { rootCmd := NewRootCmd()
if err := svrcmd.Execute(rootCmd, chaincfg.EnvPrefix, chaincfg.DefaultNodeHome); err != nil {
switch e := err.(type) { switch e := err.(type) {
case server.ErrorCode: case server.ErrorCode:
os.Exit(e.Code) os.Exit(e.Code)

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"os" "os"
@ -23,7 +23,7 @@ import (
"github.com/0glabs/0g-chain/app" "github.com/0glabs/0g-chain/app"
"github.com/0glabs/0g-chain/app/params" "github.com/0glabs/0g-chain/app/params"
kavaclient "github.com/0glabs/0g-chain/client" kavaclient "github.com/0glabs/0g-chain/client"
"github.com/0glabs/0g-chain/cmd/kava/opendb" "github.com/0glabs/0g-chain/cmd/opendb"
) )
// EnvPrefix is the prefix environment variables must have to configure the app. // EnvPrefix is the prefix environment variables must have to configure the app.

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"context" "context"

View File

@ -1,4 +1,4 @@
package cmd package main
import ( import (
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"