Documentation
¶
Index ¶
- type BlockStore
- func (bki *BlockStore) Best() (height int64, blkHash, appHash types.Hash, stamp time.Time)
- func (bki *BlockStore) Close() error
- func (bki *BlockStore) Get(blkHash types.Hash) (*ktypes.Block, *ktypes.CommitInfo, error)
- func (bki *BlockStore) GetByHeight(height int64) (types.Hash, *ktypes.Block, *ktypes.CommitInfo, error)
- func (bki *BlockStore) GetRaw(blkHash types.Hash) ([]byte, *ktypes.CommitInfo, error)
- func (bki *BlockStore) GetRawByHeight(height int64) (types.Hash, []byte, *ktypes.CommitInfo, error)
- func (bki *BlockStore) GetTx(txHash types.Hash) (tx *ktypes.Transaction, height int64, blkHash types.Hash, blkIdx uint32, ...)
- func (bki *BlockStore) Have(hash types.Hash) bool
- func (bki *BlockStore) HaveTx(txHash types.Hash) bool
- func (bki *BlockStore) PreFetch(blkid types.Hash) (bool, func())
- func (bki *BlockStore) Result(hash types.Hash, idx uint32) (*ktypes.TxResult, error)
- func (bki *BlockStore) Results(hash types.Hash) ([]ktypes.TxResult, error)
- func (bki *BlockStore) Store(blk *ktypes.Block, commitInfo *ktypes.CommitInfo) error
- func (bki *BlockStore) StoreResults(hash types.Hash, results []ktypes.TxResult) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStore ¶
type BlockStore struct {
// contains filtered or unexported fields
}
func NewBlockStore ¶
func NewBlockStore(dir string, opts ...Option) (*BlockStore, error)
func (*BlockStore) Best ¶
Best returns the best block's height, hash, appHash, and time stamp. The appHash is a result of executing the block, not the appHash stored in the header, which is from the execution of the previous block. The time stamp is what is in the header.
func (*BlockStore) Close ¶
func (bki *BlockStore) Close() error
func (*BlockStore) Get ¶
func (bki *BlockStore) Get(blkHash types.Hash) (*ktypes.Block, *ktypes.CommitInfo, error)
func (*BlockStore) GetByHeight ¶
func (bki *BlockStore) GetByHeight(height int64) (types.Hash, *ktypes.Block, *ktypes.CommitInfo, error)
GetByHeight retrieves the full block based on the block height. The returned hash is a convenience for the caller to spare computing it. The app hash, which is encoded in the next block header, is also returned.
func (*BlockStore) GetRaw ¶
func (bki *BlockStore) GetRaw(blkHash types.Hash) ([]byte, *ktypes.CommitInfo, error)
func (*BlockStore) GetRawByHeight ¶
func (bki *BlockStore) GetRawByHeight(height int64) (types.Hash, []byte, *ktypes.CommitInfo, error)
func (*BlockStore) GetTx ¶
func (bki *BlockStore) GetTx(txHash types.Hash) (tx *ktypes.Transaction, height int64, blkHash types.Hash, blkIdx uint32, err error)
GetTx returns the raw bytes of the transaction, and information on the block containing the transaction.
func (*BlockStore) Store ¶
func (bki *BlockStore) Store(blk *ktypes.Block, commitInfo *ktypes.CommitInfo) error
func (*BlockStore) StoreResults ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memstore provides a memory-backed block store, which is only suitable for testing where a disk-based store or third party dependencies are not desired.
|
Package memstore provides a memory-backed block store, which is only suitable for testing where a disk-based store or third party dependencies are not desired. |
Click to show internal directories.
Click to hide internal directories.