2020-04-29 17:40:33 +00:00
|
|
|
// Package db defines the ability to create a new database
|
|
|
|
// for an eth2 beacon node.
|
2018-10-05 17:14:50 +00:00
|
|
|
package db
|
|
|
|
|
2020-03-30 22:10:45 +00:00
|
|
|
import (
|
2020-12-15 22:07:01 +00:00
|
|
|
"context"
|
|
|
|
|
2020-03-30 22:10:45 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db/kv"
|
2021-04-23 17:06:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db/slasherkv"
|
2020-03-30 22:10:45 +00:00
|
|
|
)
|
2019-08-09 19:17:18 +00:00
|
|
|
|
2019-08-14 18:48:28 +00:00
|
|
|
// NewDB initializes a new DB.
|
2021-02-15 20:29:47 +00:00
|
|
|
func NewDB(ctx context.Context, dirPath string, config *kv.Config) (Database, error) {
|
|
|
|
return kv.NewKVStore(ctx, dirPath, config)
|
2019-08-14 18:48:28 +00:00
|
|
|
}
|
2021-04-23 17:06:13 +00:00
|
|
|
|
|
|
|
// NewSlasherDB initializes a new DB for slasher.
|
|
|
|
func NewSlasherDB(ctx context.Context, dirPath string, config *slasherkv.Config) (SlasherDatabase, error) {
|
|
|
|
return slasherkv.NewKVStore(ctx, dirPath, config)
|
|
|
|
}
|