prysm-pulse/sharding/database/database.go
Raul Jordan 8c58ffc333 sharding: begin shard local storage
Former-commit-id: 92fbba3d64ae6543595dd3270d5c3a75a8f54175 [formerly 5782e4c437022bb6827617ab05d7417afb9ceec3]
Former-commit-id: 030ef0240481a764c549d7cc323d30a958447413
2018-05-22 14:36:55 -04:00

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)
}