Documentation
¶
Index ¶
- type Blockchain
- func (blockchain *Blockchain) AppendBlock(block *types.Block) []*db.WriteBatch
- func (blockchain *Blockchain) GetBlockByHash(blockHash []byte) (*types.BlockHeader, error)
- func (blockchain *Blockchain) GetBlockByNumber(blockNum uint32) (*types.BlockHeader, error)
- func (blockchain *Blockchain) GetBlockHashByNumber(blockNum uint32) ([]byte, error)
- func (blockchain *Blockchain) GetBlockchainHeight() (uint32, error)
- func (blockchain *Blockchain) GetTransactionByTxHash(txHash []byte) (*types.Transaction, error)
- func (blockchain *Blockchain) GetTransactionHashList(blockHeight uint32) ([]byte, error)
- func (blockchain *Blockchain) GetTransactionsByHash(blockHash []byte, transactionType uint32) (types.Transactions, error)
- func (blockchain *Blockchain) GetTransactionsByNumber(blockNum uint32, transactionType uint32) (types.Transactions, error)
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
Click to show internal directories.
Click to hide internal directories.