Skip to content

Commit

Permalink
consistent config placement
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Aug 28, 2024
1 parent 8d9dc75 commit 8e966e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion simapp/v2/simdv2/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func initRootCmd[T transaction.Tx](
rootCmd,
newApp,
logger,
serverv2.DefaultServerConfig(),
initServerConfig(),
cometbft.New(&genericTxDecoder[T]{txConfig}, cometbft.DefaultServerOptions[T]()),
grpc.New[T](),
store.New[T](newApp),
Expand Down
19 changes: 19 additions & 0 deletions simapp/v2/simdv2/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package cmd
import (
"strings"

serverv2 "cosmossdk.io/server/v2"

clientconfig "github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
)
Expand Down Expand Up @@ -49,3 +51,20 @@ gas-adjustment = {{ .GasConfig.GasAdjustment }}

return customClientConfigTemplate, customClientConfig
}

// Allow the chain developer to overwrite the server default app toml config.
func initServerConfig() serverv2.ServerConfig {
serverCfg := serverv2.DefaultServerConfig()
// The server's default minimum gas price is set to "0stake" inside
// app.toml. However, the chain developer can set a default app.toml value for their
// validators here. Please update value based on chain denom.
//
// In summary:
// - if you set serverCfg.MinGasPrices value, validators CAN tweak their
// own app.toml to override, or use this default value.
//
// In simapp, we set the min gas prices to 0.
serverCfg.MinGasPrices = "0stake"

return serverCfg
}

0 comments on commit 8e966e6

Please sign in to comment.