prysm-pulse/sharding/database/database.go
Raul Jordan 0f27660b18 sharding: using eth leveldb, interface mismatch
Former-commit-id: 127630fadb68deff3418e499f303f7eab16e775f [formerly 20bf39d9d62f72857512b505cfac7e122002c4ab]
Former-commit-id: d3baf1deac782fa9ee4bcceae658723b65d1b08d
2018-05-22 14:49:59 -04:00

23 lines
636 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"
)
// NewShardDB initializes a shardDB that writes to local disk.
func NewShardDB(ctx *cli.Context, name string) (sharding.ShardBackend, error) {
dataDir := ctx.GlobalString(utils.DataDirFlag.Name)
path := filepath.Join(dataDir, name)
// Uses default cache and handles values.
// TODO: allow these to be set based on cli context.
// TODO: fix interface - lots of methods do not match.
return ethdb.NewLDBDatabase(path, 16, 16)
}