Skip to content

Commit c61bd37

Browse files
artemijspavlovsomritoptix
authored andcommitted
chore: disable pruning by default (#300)
(cherry picked from commit b91ce47)
1 parent 7c18d19 commit c61bd37

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

cmd/rollappd/cmd/root.go

+15-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/cosmos/cosmos-sdk/client/config"
1111
"github.com/cosmos/cosmos-sdk/client/debug"
1212
"github.com/cosmos/cosmos-sdk/client/flags"
13-
pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types"
1413
sdk "github.com/cosmos/cosmos-sdk/types"
1514
"github.com/evmos/evmos/v12/crypto/hd"
1615

@@ -31,6 +30,7 @@ import (
3130
dbm "github.com/tendermint/tm-db"
3231

3332
rdkserver "github.com/dymensionxyz/dymension-rdk/server"
33+
rdkserverconfig "github.com/dymensionxyz/dymension-rdk/server/config"
3434
rdk_utils "github.com/dymensionxyz/dymension-rdk/utils"
3535
dymintconf "github.com/dymensionxyz/dymint/config"
3636
"github.com/dymensionxyz/rollapp-evm/app"
@@ -132,23 +132,20 @@ func initTendermintConfig() *tmcfg.Config {
132132
// initAppConfig helps to override default appConfig template and configs.
133133
// return "", nil if no custom configuration is required for the application.
134134
func initAppConfig() (string, interface{}) {
135-
customAppTemplate, customAppConfig := evmconfig.AppConfig("")
136-
137-
srvCfg, ok := customAppConfig.(evmconfig.Config)
138-
if !ok {
139-
panic(fmt.Errorf("unknown app config type %T", customAppConfig))
140-
}
141-
142-
//Default pruning for a rollapp, represent 2 weeks of states kept while pruning in intervals of 10 minutes
143-
srvCfg.Pruning = pruningtypes.PruningOptionCustom
144-
srvCfg.PruningInterval = "18000"
145-
srvCfg.PruningKeepRecent = "6048000"
146-
147-
//Changing the default address to global instead of localhost
148-
srvCfg.JSONRPC.Address = "0.0.0.0:8545"
149-
srvCfg.JSONRPC.WsAddress = "0.0.0.0:8546"
150-
151-
return customAppTemplate, srvCfg
135+
customAppTemplate, customAppConfig := evmconfig.AppConfig("")
136+
137+
srvCfg, ok := customAppConfig.(evmconfig.Config)
138+
if !ok {
139+
panic(fmt.Errorf("unknown app config type %T", customAppConfig))
140+
}
141+
142+
rdkserverconfig.SetDefaultPruningSettings(&srvCfg.Config)
143+
144+
// Changing the default address to global instead of localhost
145+
srvCfg.JSONRPC.Address = "0.0.0.0:8545"
146+
srvCfg.JSONRPC.WsAddress = "0.0.0.0:8546"
147+
148+
return customAppTemplate, srvCfg
152149
}
153150

154151
func initRootCmd(

0 commit comments

Comments
 (0)