mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
8c58ffc333
Former-commit-id: 92fbba3d64ae6543595dd3270d5c3a75a8f54175 [formerly 5782e4c437022bb6827617ab05d7417afb9ceec3] Former-commit-id: 030ef0240481a764c549d7cc323d30a958447413
22 lines
553 B
Go
22 lines
553 B
Go
package database
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
|
"github.com/ethereum/go-ethereum/ethdb"
|
|
"github.com/ethereum/go-ethereum/sharding"
|
|
"github.com/micro/cli"
|
|
)
|
|
|
|
// CreateShardDB initializes a shardDB that writes to local disk.
|
|
func CreateShardDB(ctx *cli.Context, name string) (sharding.ShardBackend, error) {
|
|
|
|
dataDir := ctx.GlobalString(utils.DataDir.Name)
|
|
path := filepath.Join(dataDir, name)
|
|
|
|
// Uses default cache and handles values.
|
|
// TODO: fix interface.
|
|
return ethdb.NewLDBDatabase(path, 16, 16)
|
|
}
|