mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
20 lines
437 B
Go
20 lines
437 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
|
|
"github.com/ledgerwatch/erigon/ethdb"
|
|
"github.com/ledgerwatch/erigon/ethdb/kv"
|
|
)
|
|
|
|
var ErrUnsupported error = errors.New("unsupported KV type")
|
|
|
|
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()
|
|
}
|