prysm-pulse/sharding/database/database.go
Terence Tsao 035d0fb669 sharding/node: use ethdb.Database, remove database.ShardBackend
Former-commit-id: 44c0c5682c0296d94943b354171e69b4c8cf5312 [formerly 54da5cb45b098f0737fb3c37964e612dfe93c751]
Former-commit-id: 5d84d3c5038a01c4108e519d5a5c69033ace8ae2
2018-06-08 14:45:26 -07:00

18 lines
589 B
Go

// Package database provides several constructs including a simple in-memory database.
// This should not be used for production, but would be a helpful interim
// solution for development.
package database
import (
"path/filepath"
"github.com/ethereum/go-ethereum/ethdb"
)
// NewShardDB initializes a shardDB that writes to local disk.
func NewShardDB(dataDir string, name string) (ethdb.Database, error) {
// Uses default cache and handles values.
// TODO: allow these arguments to be set based on cli context.
return ethdb.NewLDBDatabase(filepath.Join(dataDir, name), 16, 16)
}