-
Notifications
You must be signed in to change notification settings - Fork 997
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'saveETH1Data' of https://github.com/prysmaticlabs/geth-…
…sharding into saveETH1Data
- Loading branch information
Showing
5 changed files
with
51 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package db | ||
|
||
import "github.com/prysmaticlabs/prysm/beacon-chain/db/iface" | ||
|
||
// Database defines the necessary methods for Prysm's eth2 backend which may | ||
// be implemented by any key-value or relational database in practice. | ||
type Database = iface.Database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
package db | ||
|
||
import ( | ||
"github.com/prysmaticlabs/prysm/beacon-chain/db/iface" | ||
"github.com/prysmaticlabs/prysm/beacon-chain/db/kafka" | ||
"github.com/prysmaticlabs/prysm/beacon-chain/db/kv" | ||
) | ||
|
||
// Database defines the necessary methods for Prysm's eth2 backend which may | ||
// be implemented by any key-value or relational database in practice. | ||
type Database = iface.Database | ||
import "github.com/prysmaticlabs/prysm/beacon-chain/db/kv" | ||
|
||
// NewDB initializes a new DB. | ||
func NewDB(dirPath string) (Database, error) { | ||
db, err := kv.NewKVStore(dirPath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return kafka.Wrap(db) | ||
return kv.NewKVStore(dirPath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package db | ||
|
||
import ( | ||
"github.com/prysmaticlabs/prysm/beacon-chain/db/kafka" | ||
"github.com/prysmaticlabs/prysm/beacon-chain/db/kv" | ||
) | ||
|
||
// NewDB initializes a new DB with kafka wrapper. | ||
func NewDB(dirPath string) (Database, error) { | ||
db, err := kv.NewKVStore(dirPath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return kafka.Wrap(db) | ||
} |