Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotOpened indicates db is not opened ErrNotOpened = errors.New("DB is not opened") )
Functions ¶
This section is empty.
Types ¶
type BlockDAO ¶
type BlockDAO interface { Start(ctx context.Context) error Stop(ctx context.Context) error GetBlockHash(height uint64) (hash.Hash256, error) GetBlockHeight(hash hash.Hash256) (uint64, error) GetBlock(hash hash.Hash256) (*block.Block, error) GetBlockHashByActionHash(h hash.Hash256) (hash.Hash256, error) GetActionsByAddress(addrBytes hash.Hash160, start, count uint64) ([][]byte, error) GetActionCountByAddress(addrBytes hash.Hash160) (uint64, error) GetActionHashFromIndex(start, count uint64) ([][]byte, error) Header(h hash.Hash256) (*block.Header, error) Body(h hash.Hash256) (*block.Body, error) GetBlockchainHeight() (uint64, error) GetTotalActions() (uint64, error) GetNumActions(height uint64) (uint64, error) GetTranferAmount(height uint64) (*big.Int, error) GetReceiptByActionHash(h hash.Hash256) (*action.Receipt, error) GetReceipts(blkHeight uint64) ([]*action.Receipt, error) PutBlock(blk *block.Block) error PutReceipts(blkHeight uint64, blkReceipts []*action.Receipt) error DeleteTipBlock() error KVStore() db.KVStore }
BlockDAO represents the block data access object
type IndexBuilder ¶
type IndexBuilder struct {
// contains filtered or unexported fields
}
IndexBuilder defines the index builder
func NewIndexBuilder ¶
func NewIndexBuilder(chainID uint32, dao BlockDAO, reindex bool) (*IndexBuilder, error)
NewIndexBuilder instantiates an index builder
func (*IndexBuilder) HandleBlock ¶
func (ib *IndexBuilder) HandleBlock(blk *block.Block) error
HandleBlock handles the block and create the indices for the actions and receipts in it
Click to show internal directories.
Click to hide internal directories.