memory

package
v0.0.0-...-041d6b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 (d *Database) FetchBlock(blockHash []byte) (*types2.Block, error)

func (*Database) FetchBlockByHeight

func (d *Database) FetchBlockByHeight(height uint64) (*types2.Block, error)

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 (d *Database) GetLatestBlockHeight() (uint64, error)

func (*Database) HasBlock

func (d *Database) HasBlock(blockHash []byte) (bool, error)

func (*Database) SetLatestBlockHeight

func (d *Database) SetLatestBlockHeight(height uint64) error

func (*Database) StoreBlock

func (d *Database) StoreBlock(block *types2.Block) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL