-
Notifications
You must be signed in to change notification settings - Fork 14
8 Validator And Committer
Senthilnathan Natarajan edited this page May 27, 2020
·
2 revisions
type ValidatorAndCommitter struct {
blockQueue BlockQueue
validator Validator
stateDB StateDB
provenanceDB ProvenanceDB
blockStore BlockStore
merkleTreeBuilder MerkleTreeBuilder
}
type validator struct {
dependencyGraph DependencyGraph
stateDB StateDB
}
type Validator interface {
ConstructDependencyGraph(block *pb.Block)
ValidTransactionWrites(txs []*pb.Transaction) ([]*Writes, error)
}
type stateDB sturct {
db *leveldb
mu sync.RWMutex
}
type StateDB interface {
GetVersion(key string) (version, error)
WriteBatch(batch *leveldb.Batch, sync bool) error
}
type provenanceDB sturct {
db *leveldb
mu sync.RWMutex
}
type ProvenanceDB interface {
PutMerkleTree(tree MerkleTree) error
WriteBatch(batch *leveldb.Batch, sync bool) error
}
type blockStore sturct {
fileBasedStore FileStore
mu sync.RWMutex
}
type BlockStore interface {
AddBlock(block *pb.Block) error
}