Documentation
¶
Index ¶
- Constants
- Variables
- type Database
- func (d *Database) FetchBlock(blockHash []byte) (*types2.Block, error)
- func (d *Database) FetchBlockByHeight(height uint64) (*types2.Block, error)
- func (d *Database) FetchBlockData(blockHash []byte) ([]*types2.Transaction, error)
- func (d *Database) FetchBlockHeader(blockHash []byte) (*types2.BlockHeader, error)
- func (d *Database) FetchBlockHeaderByHeight(height uint64) (*types2.BlockHeader, error)
- func (d *Database) GetLatestBlockHeight() (uint64, error)
- func (d *Database) HasBlock(blockHash []byte) (bool, error)
- func (d *Database) SetLatestBlockHeight(height uint64) error
- func (d *Database) StoreBlock(block *types2.Block) error
- type Index
Constants ¶
View Source
const ( DefaultBlockDataPrefix = "blockdata_" DefaultBlockHeaderPrefix = "header_" DefaultMetadataIndexName = "metadata" LatestBlockHeightKey = "latest_block_height" )
View Source
const (
DefaultIndexPrefix = "indexes/"
)
Variables ¶
View Source
var (
ErrIndexKeyNotFound = fmt.Errorf("key is not found in the index")
)
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func (*Database) FetchBlock ¶
func (*Database) FetchBlockByHeight ¶
func (*Database) FetchBlockData ¶
func (d *Database) FetchBlockData(blockHash []byte) ([]*types2.Transaction, error)
func (*Database) FetchBlockHeader ¶
func (d *Database) FetchBlockHeader(blockHash []byte) (*types2.BlockHeader, error)
func (*Database) FetchBlockHeaderByHeight ¶
func (d *Database) FetchBlockHeaderByHeight(height uint64) (*types2.BlockHeader, error)
func (*Database) GetLatestBlockHeight ¶
func (*Database) SetLatestBlockHeight ¶
Click to show internal directories.
Click to hide internal directories.