Skip to content

Commit

Permalink
fix: create snapshot dir for rocksdb backend (backport cosmos#15054) (c…
Browse files Browse the repository at this point in the history
…osmos#15065)

Co-authored-by: yihuang <huang@crypto.com>
  • Loading branch information
2 people authored and jiujiteiro committed Mar 7, 2023
1 parent 712188a commit 992335f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) {
}

snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
if err = os.MkdirAll(snapshotDir, os.ModePerm); err != nil {
panic(fmt.Errorf("failed to create snapshots directory: %w", err))
}

snapshotDB, err := dbm.NewDB("metadata", GetAppDBBackend(appOpts), snapshotDir)
if err != nil {
panic(err)
Expand Down

0 comments on commit 992335f

Please sign in to comment.