mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
19 lines
348 B
Go
19 lines
348 B
Go
package db
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon/ethdb/kv"
|
|
"github.com/ledgerwatch/erigon/ethdb/mdbx"
|
|
"github.com/ledgerwatch/erigon/log"
|
|
)
|
|
|
|
func OpenDatabase(path string, logger log.Logger, inmem bool) kv.RwDB {
|
|
opts := mdbx.NewMDBX(logger)
|
|
if inmem {
|
|
opts = opts.InMem()
|
|
} else {
|
|
opts = opts.Path(path)
|
|
}
|
|
|
|
return opts.MustOpen()
|
|
}
|