2022-01-08 00:39:27 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-08-02 10:34:24 +00:00
|
|
|
"fmt"
|
2022-01-08 00:39:27 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/server"
|
|
|
|
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
|
|
|
|
|
2024-05-01 04:26:39 +00:00
|
|
|
"github.com/0glabs/0g-chain/chaincfg"
|
2022-01-08 00:39:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-05-01 04:26:39 +00:00
|
|
|
chaincfg.SetSDKConfig().Seal()
|
|
|
|
rootCmd := NewRootCmd()
|
|
|
|
if err := svrcmd.Execute(rootCmd, chaincfg.EnvPrefix, chaincfg.DefaultNodeHome); err != nil {
|
2022-01-08 00:39:27 +00:00
|
|
|
switch e := err.(type) {
|
|
|
|
case server.ErrorCode:
|
2024-08-02 10:34:24 +00:00
|
|
|
fmt.Println("error")
|
2022-01-08 00:39:27 +00:00
|
|
|
os.Exit(e.Code)
|
|
|
|
|
|
|
|
default:
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|