Skip to content

Commit

Permalink
optional in flags
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Oct 23, 2024
1 parent d0bf99d commit 64174f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ import (
ethermint "github.com/evmos/ethermint/types"
)

const FlagAsyncCheckTx = "async-check-tx"

// DBOpener is a function to open `application.db`, potentially with customized options.
type DBOpener func(opts types.AppOptions, rootDir string, backend dbm.BackendType) (dbm.DB, error)

Expand All @@ -77,7 +79,6 @@ type StartOptions struct {
AppCreator types.AppCreator
DefaultNodeHome string
DBOpener DBOpener
AsyncCheckTx bool
}

// NewDefaultStartOptions use the default db opener provided in tm-db.
Expand Down Expand Up @@ -228,6 +229,8 @@ which accepts a path for the resulting pprof file.
cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep")
cmd.Flags().Int(server.FlagMempoolMaxTxs, config.DefaultMaxTxs, "Sets MaxTx value for the app-side mempool")

cmd.Flags().Bool(FlagAsyncCheckTx, false, "Enable async check tx [experimental]")

// add support for all CometBFT-specific command line options
tcmd.AddNodeFlags(cmd)
return cmd
Expand Down Expand Up @@ -358,7 +361,7 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start
cmtApp := server.NewCometABCIWrapper(app)

var clientCreator proxy.ClientCreator
if opts.AsyncCheckTx {
if svrCtx.Viper.GetBool(FlagAsyncCheckTx) {
clientCreator = proxy.NewConnSyncLocalClientCreator(cmtApp)
} else {
clientCreator = proxy.NewLocalClientCreator(cmtApp)
Expand Down

0 comments on commit 64174f6

Please sign in to comment.