github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/db/db.go (about) 1 // Package db defines the ability to create a new database 2 // for an Ethereum Beacon Node. 3 package db 4 5 import ( 6 "context" 7 8 "github.com/prysmaticlabs/prysm/beacon-chain/db/kv" 9 ) 10 11 // NewDB initializes a new DB. 12 func NewDB(ctx context.Context, dirPath string, config *kv.Config) (Database, error) { 13 return kv.NewKVStore(ctx, dirPath, config) 14 } 15 16 // NewDBFilename uses the KVStoreDatafilePath so that if this layer of 17 // indirection between db.NewDB->kv.NewKVStore ever changes, it will be easy to remember 18 // to also change this filename indirection at the same time. 19 func NewDBFilename(dirPath string) string { 20 return kv.KVStoreDatafilePath(dirPath) 21 }