Skip to content

Commit

Permalink
change in use of snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mkXultra committed Jul 11, 2022
1 parent f85b1a0 commit 83e8606
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/ununifid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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)),
Expand All @@ -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),
)
}

Expand Down

0 comments on commit 83e8606

Please sign in to comment.