mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 16:37:39 +00:00
d3375d98a8
* abstract db interface, kafka build, work in progress * checkpoint * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * feature flag * move passthrough * flag change * gofmt * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * missing db methods * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * fix interface * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * try using cmake built from source * lint godocs * lint godocs * lint godocs * Update BUILD.bazel * Merge branch 'master' into es-exporter * Merge branch 'master' into es-exporter * Merge branch 'master' into es-exporter * Merge branch 'master' of github.com:prysmaticlabs/prysm into es-exporter * gaz
22 lines
546 B
Go
22 lines
546 B
Go
package db
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db/iface"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db/kafka"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db/kv"
|
|
)
|
|
|
|
// Database defines the necessary methods for Prysm's eth2 backend which may
|
|
// be implemented by any key-value or relational database in practice.
|
|
type Database = iface.Database
|
|
|
|
// NewDB initializes a new DB.
|
|
func NewDB(dirPath string) (Database, error) {
|
|
db, err := kv.NewKVStore(dirPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return kafka.Wrap(db)
|
|
}
|