mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
6bd8ae8f67
* begin db interface * define the database interface * interface definition simplifications * include latest message proto * modify pbs * rem kv folder * add filter interface * lint * ctx package is great * interface getting better * ctx everywhere...it's everywhere! * block roots method * new kv store initialization * comments * gaz * implement interface * refactor for proper naming conventions * add todos * proper comments * rem unused * add schema * implementation simplicity * has validator latest vote func impl * retrieve validator latest vote * has idx * implement missing validator methods * missing validator methods and test helpers * validator index crud tests * validator tests * all buckets * refactor with ok bool * all tests passing, fmt, imports
15 lines
628 B
Go
15 lines
628 B
Go
package kv
|
|
|
|
// The schema will define how to store and retrieve data from the db.
|
|
// we can prefix or suffix certain values such as `block` with attributes
|
|
// for prefix-wide scans across the underlying BoltDB buckets when filtering data.
|
|
// For example, we might store attestations as shard + attestation_root -> attestation, making
|
|
// it easy to scan for keys that have a certain shard number as a prefix and return those
|
|
// corresponding attestations.
|
|
var (
|
|
attestationsBucket = []byte("attestations")
|
|
blocksBucket = []byte("blocks")
|
|
validatorsBucket = []byte("validators")
|
|
stateBucket = []byte("state")
|
|
)
|