Documentation ¶
Index ¶
- Constants
- type BlockchainLevelDB
- func (l *BlockchainLevelDB) AddBlock(block *domain.Block) error
- func (l *BlockchainLevelDB) AddUnconfirmedBlock(block *domain.Block) error
- func (l *BlockchainLevelDB) Close()
- func (l *BlockchainLevelDB) GetBlockByHash(hash string) (*domain.Block, error)
- func (l *BlockchainLevelDB) GetBlockByNumber(blockNumber uint64) (*domain.Block, error)
- func (l *BlockchainLevelDB) GetBlockByTxID(txid string) (*domain.Block, error)
- func (l *BlockchainLevelDB) GetLastBlock() (*domain.Block, error)
- func (l *BlockchainLevelDB) GetTransactionByTxID(txid string) (*domain.Transaction, error)
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)
Click to show internal directories.
Click to hide internal directories.