Documentation ¶
Index ¶
- type BlockChainDB
- type BlockchainDBImpl
- func (b *BlockchainDBImpl) AddBlock(block *domain.Block) error
- func (b *BlockchainDBImpl) AddUnconfirmedBlock(block *domain.Block) error
- func (b *BlockchainDBImpl) Close()
- func (b *BlockchainDBImpl) GetBlockByHash(hash string) (*domain.Block, error)
- func (b *BlockchainDBImpl) GetBlockByNumber(blockNumber uint64) (*domain.Block, error)
- func (b *BlockchainDBImpl) GetBlockByTxID(txid string) (*domain.Block, error)
- func (b *BlockchainDBImpl) GetLastBlock() (*domain.Block, error)
- func (b *BlockchainDBImpl) GetTransactionByTxID(txid string) (*domain.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockChainDB ¶
type BlockChainDB interface { Close() AddBlock(block *domain.Block) error AddUnconfirmedBlock(block *domain.Block) error GetBlockByNumber(blockNumber uint64) (*domain.Block, error) GetBlockByHash(hash string) (*domain.Block, error) GetLastBlock() (*domain.Block, error) GetTransactionByTxID(txid string) (*domain.Transaction, error) GetBlockByTxID(txid string) (*domain.Block, error) }
func CreateNewBlockchainDB ¶
func CreateNewBlockchainDB(dbPath string) BlockChainDB
type BlockchainDBImpl ¶
type BlockchainDBImpl struct {
// contains filtered or unexported fields
}
func (*BlockchainDBImpl) AddUnconfirmedBlock ¶
func (b *BlockchainDBImpl) AddUnconfirmedBlock(block *domain.Block) error
func (*BlockchainDBImpl) Close ¶
func (b *BlockchainDBImpl) Close()
func (*BlockchainDBImpl) GetBlockByHash ¶
func (b *BlockchainDBImpl) GetBlockByHash(hash string) (*domain.Block, error)
func (*BlockchainDBImpl) GetBlockByNumber ¶
func (b *BlockchainDBImpl) GetBlockByNumber(blockNumber uint64) (*domain.Block, error)
func (*BlockchainDBImpl) GetBlockByTxID ¶
func (b *BlockchainDBImpl) GetBlockByTxID(txid string) (*domain.Block, error)
func (*BlockchainDBImpl) GetLastBlock ¶
func (b *BlockchainDBImpl) GetLastBlock() (*domain.Block, error)
func (*BlockchainDBImpl) GetTransactionByTxID ¶
func (b *BlockchainDBImpl) GetTransactionByTxID(txid string) (*domain.Transaction, error)
Click to show internal directories.
Click to hide internal directories.