Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setting the default pruning according to the 0.2 block time #18

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions cmd/rollappd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import (
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types"
sdk "github.com/cosmos/cosmos-sdk/types"

"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/version"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
Expand Down Expand Up @@ -120,10 +122,15 @@ func initTendermintConfig() *tmcfg.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{}) {
// customAppTemplate := serverconfig.DefaultConfigTemplate
// srvCfg := serverconfig.DefaultConfig()
// srvCfg.MinGasPrices = "0udym"
return "", nil
customAppTemplate := serverconfig.DefaultConfigTemplate
srvCfg := serverconfig.DefaultConfig()

//Default pruning for a rollapp, represent 2 weeks of states kept while pruning in intervals of 10 minutes
srvCfg.Pruning = pruningtypes.PruningOptionCustom
srvCfg.PruningInterval = "18000"
srvCfg.PruningKeepRecent = "6048000"

return customAppTemplate, srvCfg
}

func initRootCmd(
Expand Down