Skip to content

Commit

Permalink
fix iavl config fully
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Oct 22, 2022
1 parent 74cb568 commit 0005a34
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cmd/chihuahuad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/pruning"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/server"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
"github.com/cosmos/cosmos-sdk/store"
Expand Down Expand Up @@ -84,7 +85,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return err
}

return server.InterceptConfigsPreRunHandler(cmd, "", nil)
_, customAppConfig := initAppConfig()

return server.InterceptConfigsPreRunHandler(cmd, "", customAppConfig)
},
}

Expand Down Expand Up @@ -122,6 +125,18 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
)
}

// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
func initAppConfig() (string, interface{}) {
srvCfg := serverconfig.DefaultConfig()

srvCfg.StateSync.SnapshotInterval = 1500
srvCfg.StateSync.SnapshotKeepRecent = 2
srvCfg.IAVLDisableFastNode = false

return "", srvCfg
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
wasm.AddModuleInitFlags(startCmd)
Expand Down

0 comments on commit 0005a34

Please sign in to comment.