database

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockNotFound   = errors.New("block isn't found")
	ErrLatestHeightNil = errors.New("latest block height is nil")
)

Functions

This section is empty.

Types

type Database

type Database interface {
	StoreBlock(block *types.Block) error
	HasBlock(blockhash []byte) (bool, error)
	FetchBlockData(blockHash []byte) ([]*types2.Transaction, error)
	FetchBlockHeader(blockHash []byte) (*types2.BlockHeader, error)
	FetchBlock(blockHash []byte) (*types2.Block, error)
	FetchBlockByHeight(height uint64) (*types2.Block, error)
	FetchBlockHeaderByHeight(height uint64) (*types2.BlockHeader, error)
	GetLatestBlockHeight() (uint64, error)
	SetLatestBlockHeight(height uint64) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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