diff --git a/cmd/ununifid/cmd/root.go b/cmd/ununifid/cmd/root.go index 8ac3e4c14..a73154cfd 100644 --- a/cmd/ununifid/cmd/root.go +++ b/cmd/ununifid/cmd/root.go @@ -8,7 +8,6 @@ import ( // "github.com/CosmWasm/wasmd/x/wasm" "github.com/UnUniFi/chain/app/params" - "github.com/cosmos/cosmos-sdk/snapshots" tmcfg "github.com/tendermint/tendermint/config" "github.com/UnUniFi/chain/app" @@ -21,6 +20,8 @@ import ( "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" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" @@ -237,6 +238,11 @@ func (a appCreator) newApp( // wasmOpts = append(wasmOpts, Wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) // } + snapshotOptions := snapshottypes.NewSnapshotOptions( + cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), + cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), + ) + return app.NewApp( logger, db, traceStore, true, skipUpgradeHeights, cast.ToString(appOpts.Get(flags.FlagHome)), @@ -254,9 +260,7 @@ func (a appCreator) newApp( baseapp.SetInterBlockCache(cache), baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshotStore(snapshotStore), - baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), - baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), + baseapp.SetSnapshot(snapshotStore, snapshotOptions), ) }