prysm-pulse/beacon-chain/db/db.go

22 lines
546 B
Go
Raw Normal View History

2018-10-05 17:14:50 +00:00
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"
2018-10-05 17:14:50 +00:00
)
// 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)
}