Documentation ¶
Index ¶
- Variables
- func NewDB(path string) (*badger.DB, error)
- type CommitData
- type Config
- type Storage
- func (strg *Storage) Commit(data *CommitData) error
- func (strg *Storage) GetBlock(hash []byte) (*core.Block, error)
- func (strg *Storage) GetBlockByHeight(height uint64) (*core.Block, error)
- func (strg *Storage) GetBlockCommit(hash []byte) (*core.BlockCommit, error)
- func (strg *Storage) GetBlockHeight() uint64
- func (strg *Storage) GetLastBlock() (*core.Block, error)
- func (strg *Storage) GetLastQC() (*core.QuorumCert, error)
- func (strg *Storage) GetMerkleRoot() []byte
- func (strg *Storage) GetState(key []byte) []byte
- func (strg *Storage) GetTx(hash []byte) (*core.Transaction, error)
- func (strg *Storage) GetTxCommit(hash []byte) (*core.TxCommit, error)
- func (strg *Storage) HasTx(hash []byte) bool
- func (strg *Storage) VerifyState(key []byte) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{
MerkleBranchFactor: 8,
ConcurrentLimit: 20,
}
Functions ¶
Types ¶
type CommitData ¶
type CommitData struct { Block *core.Block QC *core.QuorumCert // QC for commited block Transactions []*core.Transaction BlockCommit *core.BlockCommit TxCommits []*core.TxCommit // contains filtered or unexported fields }
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) Commit ¶
func (strg *Storage) Commit(data *CommitData) error
func (*Storage) GetBlockByHeight ¶
func (*Storage) GetBlockCommit ¶
func (strg *Storage) GetBlockCommit(hash []byte) (*core.BlockCommit, error)
func (*Storage) GetBlockHeight ¶
func (*Storage) GetMerkleRoot ¶
func (*Storage) VerifyState ¶
Click to show internal directories.
Click to hide internal directories.