mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
2b517b7630
* Reduce workers and queue size * Add traces and event logs * Add chain flag * Print * Open consensus db as read only * Use only one engine instance * chainDb * Display palia error * Not to panic * Not to exit * Add syscall * Print * Pointer to TxTask * Not register senders * Print * Relax check * Skip system transactions * increase workerCount again * Remove print * Change recon * Fix types * Skip system txs * Print * No rules for genesis commit * Print genesis * Print| * Print * Print * Update * Fix * Remove print * No print * Support contract upgrades * Use the same dif * Print create2 * Fix * Fix * Print * Hack iterate * Print empty vals * Fix hack * Code hashes * Code hashes * Print * No panic * No panic * Fix? * another incarnation fix * Remove print * Remove print Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local> Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
22 lines
423 B
Go
22 lines
423 B
Go
package db
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon-lib/kv"
|
|
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
|
"github.com/ledgerwatch/log/v3"
|
|
)
|
|
|
|
func OpenDatabase(path string, logger log.Logger, inmem bool, readonly bool) kv.RwDB {
|
|
opts := mdbx.NewMDBX(logger).Label(kv.ConsensusDB)
|
|
if readonly {
|
|
opts = opts.Readonly()
|
|
}
|
|
if inmem {
|
|
opts = opts.InMem()
|
|
} else {
|
|
opts = opts.Path(path)
|
|
}
|
|
|
|
return opts.MustOpen()
|
|
}
|