Skip to content

Commit

Permalink
config: fix app config
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbeng committed Aug 16, 2024
1 parent 1cf61b4 commit df8780c
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions cmd/artelad/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
"cosmossdk.io/math"
cmtcfg "github.com/cometbft/cometbft/config"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/artela-network/artela-rollkit/app"
Expand Down Expand Up @@ -58,52 +57,5 @@ func initCometBFTConfig() *cmtcfg.Config {
// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
func initAppConfig() (string, interface{}) {
// The following code snippet is just for reference.
type CustomAppConfig struct {
serverconfig.Config `mapstructure:",squash"`

EVM config.EVMConfig `mapstructure:"evm"`
JSONRPC config.JSONRPCConfig `mapstructure:"json-rpc"`
TLS config.TLSConfig `mapstructure:"tls"`
Aspect config.AspectConfig `mapstructure:"aspect"`
}

// Optionally allow the chain developer to overwrite the SDK's default
// server config.
srvCfg := serverconfig.DefaultConfig()
// The SDK's default minimum gas price is set to "" (empty value) inside
// app.toml. If left empty by validators, the node will halt on startup.
// However, the chain developer can set a default app.toml value for their
// validators here.
//
// In summary:
// - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their
// own app.toml config,
// - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their
// own app.toml to override, or use this default value.
//
// In tests, we set the min gas prices to 0.
// srvCfg.MinGasPrices = "0stake"
// srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default

customAppConfig := CustomAppConfig{
Config: *srvCfg,
EVM: *config.DefaultEVMConfig(),
JSONRPC: *config.DefaultJSONRPCConfig(),
TLS: *config.DefaultTLSConfig(),
Aspect: *config.DefaultAspectConfig(),
}

customAppTemplate := serverconfig.DefaultConfigTemplate + config.DefaultConfigTemplate
// Edit the default template file
//
// customAppTemplate := serverconfig.DefaultConfigTemplate + `
// [wasm]
// # This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
// query_gas_limit = 300000
// # This is the number of wasm vm instances we keep cached in memory for speed-up
// # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
// lru_size = 0`

return customAppTemplate, customAppConfig
return config.AppConfig(artelatypes.AttoArtela)
}

0 comments on commit df8780c

Please sign in to comment.