erigon-pulse/cmd/snapshots/utils/utils.go

20 lines
437 B
Go
Raw Normal View History

package utils
import (
"errors"
"os"
"github.com/ledgerwatch/erigon/ethdb"
"github.com/ledgerwatch/erigon/ethdb/kv"
)
var ErrUnsupported error = errors.New("unsupported KV type")
2021-06-16 10:57:58 +00:00
func RmTmpFiles(snapshotPath string) error {
return os.Remove(snapshotPath + "/mdbx.lck")
}
func OpenSnapshotKV(configsFunc kv.BucketConfigsFunc, path string) ethdb.RwKV {
return kv.NewMDBX().WithBucketsConfig(configsFunc).Path(path).MustOpen()
}