block_storage

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

type Blockchain struct {
	// contains filtered or unexported fields
}

Blockchain represents block

func NewBlockchain

func NewBlockchain(db *db.BlockchainDB) *Blockchain

NewBlockchain initialization

func (*Blockchain) AppendBlock

func (blockchain *Blockchain) AppendBlock(block *types.Block) []*db.WriteBatch

AppendBlock appends a block

func (*Blockchain) GetBlockByHash

func (blockchain *Blockchain) GetBlockByHash(blockHash []byte) (*types.BlockHeader, error)

GetBlockByHash gets block by block hash

func (*Blockchain) GetBlockByNumber

func (blockchain *Blockchain) GetBlockByNumber(blockNum uint32) (*types.BlockHeader, error)

GetBlockByNumber gets block by block height number

func (*Blockchain) GetBlockHashByNumber

func (blockchain *Blockchain) GetBlockHashByNumber(blockNum uint32) ([]byte, error)

GetBlockHashByNumber get block hash by block number

func (*Blockchain) GetBlockchainHeight

func (blockchain *Blockchain) GetBlockchainHeight() (uint32, error)

GetBlockchainHeight gets blockchain height

func (*Blockchain) GetTransactionByTxHash

func (blockchain *Blockchain) GetTransactionByTxHash(txHash []byte) (*types.Transaction, error)

GetTransactionByTxHash gets transaction by transaction hash

func (*Blockchain) GetTransactionHashList

func (blockchain *Blockchain) GetTransactionHashList(blockHeight uint32) ([]byte, error)

GetTransactionHashList get transaction hash list by block height

func (*Blockchain) GetTransactionsByHash

func (blockchain *Blockchain) GetTransactionsByHash(blockHash []byte, transactionType uint32) (types.Transactions, error)

GetTransactionsByHash by block hash

func (*Blockchain) GetTransactionsByNumber

func (blockchain *Blockchain) GetTransactionsByNumber(blockNum uint32, transactionType uint32) (types.Transactions, error)

GetTransactionsByNumber by block height number

Jump to

Keyboard shortcuts

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