blockchainleveldb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_HASH_DB        = "block_hash"
	BLOCK_NUMBER_DB      = "block_number"
	UNCONFIRMED_BLOCK_DB = "unconfirmed_block"
	TRANSACTION_DB       = "transaction"
	UTIL_DB              = "util"

	LAST_BLOCK_KEY = "last_block"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockchainLevelDB

type BlockchainLevelDB struct {
	DBProvider *leveldbhelper.DBProvider
}

func CreateNewBlockchainLevelDB

func CreateNewBlockchainLevelDB(levelDBPath string) *BlockchainLevelDB

func (*BlockchainLevelDB) AddBlock

func (l *BlockchainLevelDB) AddBlock(block *domain.Block) error

func (*BlockchainLevelDB) AddUnconfirmedBlock

func (l *BlockchainLevelDB) AddUnconfirmedBlock(block *domain.Block) error

func (*BlockchainLevelDB) Close

func (l *BlockchainLevelDB) Close()

func (*BlockchainLevelDB) GetBlockByHash

func (l *BlockchainLevelDB) GetBlockByHash(hash string) (*domain.Block, error)

func (*BlockchainLevelDB) GetBlockByNumber

func (l *BlockchainLevelDB) GetBlockByNumber(blockNumber uint64) (*domain.Block, error)

func (*BlockchainLevelDB) GetBlockByTxID

func (l *BlockchainLevelDB) GetBlockByTxID(txid string) (*domain.Block, error)

func (*BlockchainLevelDB) GetLastBlock

func (l *BlockchainLevelDB) GetLastBlock() (*domain.Block, error)

func (*BlockchainLevelDB) GetTransactionByTxID

func (l *BlockchainLevelDB) GetTransactionByTxID(txid string) (*domain.Transaction, error)

Jump to

Keyboard shortcuts

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