Skip to content

Commit

Permalink
fix server/flags/flags.go use FlagChainID for ChainID
Browse files Browse the repository at this point in the history
  • Loading branch information
name committed Mar 4, 2024
1 parent 2109921 commit 373ef9a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
34 changes: 16 additions & 18 deletions cmd/entangled/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/spf13/cast"
"github.com/spf13/cobra"
"github.com/spf13/viper"

dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
Expand Down Expand Up @@ -254,25 +255,22 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
)

// Setup chainId
/*
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if len(chainID) == 0 {
v := viper.New()
v.AddConfigPath(filepath.Join(home, "config"))
v.SetConfigName("client")
v.SetConfigType("toml")
if err := v.ReadInConfig(); err != nil {
panic(err)
}
conf := new(config.ClientConfig)
if err := v.Unmarshal(conf); err != nil {
panic(err)
}
chainID = conf.ChainID
}
*/

const chainID = "ethermint_9000-1"
chainID := cast.ToString(appOpts.Get(flags.FlagChainID))
if len(chainID) == 0 {
v := viper.New()
v.AddConfigPath(filepath.Join(home, "config"))
v.SetConfigName("client")
v.SetConfigType("toml")
if err := v.ReadInConfig(); err != nil {
panic(err)
}
conf := new(config.ClientConfig)
if err := v.Unmarshal(conf); err != nil {
panic(err)
}
chainID = conf.ChainID
}

ethermintApp := app.NewEthermintApp(
logger, db, traceStore, true, skipUpgradeHeights,
Expand Down
2 changes: 1 addition & 1 deletion server/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const (

// AddTxFlags adds common flags for commands to post tx
func AddTxFlags(cmd *cobra.Command) (*cobra.Command, error) {
cmd.PersistentFlags().String(flags.FlagChainID, "testnet", "Specify Chain ID for sending Tx")
cmd.PersistentFlags().String(flags.FlagChainID, "ethermint_9000-1", "Specify Chain ID for sending Tx")
cmd.PersistentFlags().String(flags.FlagFrom, "", "Name or address of private key with which to sign")
cmd.PersistentFlags().String(flags.FlagFees, "", "Fees to pay along with transaction; eg: 10aNGL")
cmd.PersistentFlags().String(flags.FlagGasPrices, "", "Gas prices to determine the transaction fee (e.g. 10aNGL)")
Expand Down

0 comments on commit 373ef9a

Please sign in to comment.