Documentation ¶
Index ¶
- Constants
- 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
Constants ¶
View Source
const (
LatestBlockHeightKey = "latest_block_height"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func NewDatabase() *Database
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.