mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 20:11:21 +00:00
5ba3ea162a
* 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
28 lines
398 B
Go
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()
|
|
|
|
}
|