mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
18 lines
282 B
Go
18 lines
282 B
Go
package db
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon/ethdb"
|
|
"github.com/ledgerwatch/erigon/ethdb/kv"
|
|
)
|
|
|
|
func OpenDatabase(path string, inmem bool) ethdb.RwKV {
|
|
opts := kv.NewMDBX()
|
|
if inmem {
|
|
opts = opts.InMem()
|
|
} else {
|
|
opts = opts.Path(path)
|
|
}
|
|
|
|
return opts.MustOpen()
|
|
}
|