erigon-pulse/consensus/db/db.go
Alex Sharov 5ba3ea162a
Simulated backend and genesis to kv (#2104)
* move to kv

* move to kv

* move to kv

* move to kv

* move to kv

* move to kv

* merge

* merge

* merge

* merge

* merge

* merge

* merge

* merge
2021-06-05 16:17:04 +01:00

28 lines
398 B
Go

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()
}