mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
0f27660b18
Former-commit-id: 127630fadb68deff3418e499f303f7eab16e775f [formerly 20bf39d9d62f72857512b505cfac7e122002c4ab] Former-commit-id: d3baf1deac782fa9ee4bcceae658723b65d1b08d
23 lines
636 B
Go
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)
|
|
}
|