mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 04:21:20 +00:00
21 lines
489 B
Go
21 lines
489 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
|
|
"github.com/ledgerwatch/erigon/ethdb/kv"
|
|
"github.com/ledgerwatch/erigon/ethdb/mdbx"
|
|
"github.com/ledgerwatch/erigon/log"
|
|
)
|
|
|
|
var ErrUnsupported error = errors.New("unsupported KV type")
|
|
|
|
func RmTmpFiles(snapshotPath string) error {
|
|
return os.Remove(snapshotPath + "/mdbx.lck")
|
|
}
|
|
|
|
func OpenSnapshotKV(configsFunc mdbx.BucketConfigsFunc, path string) kv.RwDB {
|
|
return mdbx.NewMDBX(log.New()).WithBucketsConfig(configsFunc).Path(path).MustOpen()
|
|
}
|