erigon-pulse/consensus/db/db.go

28 lines
398 B
Go
Raw Normal View History

package db
import (
"github.com/ledgerwatch/erigon/ethdb"
)
func OpenDatabase(path string, inmem bool, mdbx bool) ethdb.RwKV {
if mdbx {
opts := ethdb.NewMDBX()
if inmem {
opts = opts.InMem()
} else {
opts = opts.Path(path)
}
return opts.MustOpen()
}
opts := ethdb.NewLMDB()
if inmem {
opts = opts.InMem()
} else {
opts = opts.Path(path)
}
return opts.MustOpen()
}