Documentation
¶
Index ¶
- Constants
- Variables
- func AppendAtKey(m map[uint64][]uint32, key uint64, value uint32)
- func DefaultExtractNotificationFromTxFn(tx types.Tx, notiMap map[string]int64)
- func EncodeToHex(b []byte) string
- func GetId56(height uint32, i int) uint64
- func GetRealOffset(offset, size int64) int64
- func Padding32(length int) (n int)
- func Sum48(seed [8]byte, key []byte) uint64
- type BlockHeightAndHash
- type DB
- func (d *DB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (d *DB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (d *DB) Close()
- func (d *DB) GetAllUtxoIds() [][36]byte
- func (d *DB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *DB) GetBlockByHeight(height int64) []byte
- func (d *DB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (d *DB) GetLatestHeight() int64
- func (d *DB) GetLostAndFoundUtxoIds() [][36]byte
- func (d *DB) GetRedeemableUtxoIds() [][36]byte
- func (d *DB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *DB) GetRedeemingUtxoIds() [][36]byte
- func (d *DB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *DB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (d *DB) GetTxListByHeight(height int64) [][]byte
- func (d *DB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (d *DB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *DB) GetUtxoInfos() (infos [][36 + 1 + 20]byte)
- func (d *DB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (d *DB) QueryNotificationCounter(key []byte) int64
- func (d *DB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *DB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *DB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *DB) SetDisableComplexIndex(b bool)
- func (d *DB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (d *DB) SetMaxEntryCount(c int)
- func (d *DB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
- type HPFile
- type LiteDB
- func (d *LiteDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (d *LiteDB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (d *LiteDB) Close()
- func (d *LiteDB) GetAllUtxoIds() [][36]byte
- func (d *LiteDB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *LiteDB) GetBlockByHeight(height int64) []byte
- func (d *LiteDB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (d *LiteDB) GetLatestHeight() (latestHeight int64)
- func (d *LiteDB) GetLostAndFoundUtxoIds() [][36]byte
- func (d *LiteDB) GetRedeemableUtxoIds() [][36]byte
- func (d *LiteDB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *LiteDB) GetRedeemingUtxoIds() [][36]byte
- func (d *LiteDB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *LiteDB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (d *LiteDB) GetTxListByHeight(height int64) [][]byte
- func (d *LiteDB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (d *LiteDB) GetTxSigByHash(hash [32]byte) (res [65]byte)
- func (d *LiteDB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *LiteDB) GetUtxoInfos() (infos [][36 + 1 + 20]byte)
- func (d *LiteDB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (d *LiteDB) QueryNotificationCounter(key []byte) int64
- func (d *LiteDB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *LiteDB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *LiteDB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *LiteDB) SetDisableComplexIndex(b bool)
- func (d *LiteDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (d *LiteDB) SetMaxEntryCount(c int)
- func (d *LiteDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
- type MockDB
- func (d *MockDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (d *MockDB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (d *MockDB) Close()
- func (d *MockDB) GetAllUtxoIds() [][36]byte
- func (d *MockDB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *MockDB) GetBlockByHeight(height int64) []byte
- func (d *MockDB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (d *MockDB) GetLatestHeight() int64
- func (d *MockDB) GetLostAndFoundUtxoIds() [][36]byte
- func (d *MockDB) GetRedeemableUtxoIds() [][36]byte
- func (d *MockDB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *MockDB) GetRedeemingUtxoIds() [][36]byte
- func (d *MockDB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (d *MockDB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (d *MockDB) GetTxListByHeight(height int64) (res [][]byte)
- func (d *MockDB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (d *MockDB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (d *MockDB) GetUtxoInfos() (infos [][57]byte)
- func (d *MockDB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (d *MockDB) QueryNotificationCounter(key []byte) (counter int64)
- func (d *MockDB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *MockDB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *MockDB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (d *MockDB) SetDisableComplexIndex(b bool)
- func (d *MockDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (d *MockDB) SetMaxEntryCount(c int)
- func (d *MockDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
- type RocksDB
Constants ¶
const ( MaxExpandedSize = 64 MaxMatchedTx = 50000 DB_PARA_READ_THREADS = 8 )
Variables ¶
var ( ErrQueryConditionExpandedTooLarge = errors.New("query condition expanded too large") ErrTooManyPotentialResults = errors.New("too many potential results") )
Functions ¶
func AppendAtKey ¶
append value at a slice at 'key'. If the slice does not exist, create it.
func DefaultExtractNotificationFromTxFn ¶
To-address of TX From-address of SEP20-Transfer To-address of SEP20-Transfer
func EncodeToHex ¶
func GetRealOffset ¶
offset40 can represent 32TB range, but a hpfile's virual size can be larger than it. calculate a real offset from offset40 which pointing to a valid position in hpfile.
Types ¶
type BlockHeightAndHash ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) AddBlock ¶
Add a new block for indexing, and prune the index information for blocks before pruneTillHeight The ownership of 'blk' will be transferred to DB and cannot be changed by out world!
func (*DB) BasicQueryLogs ¶
func (d *DB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
Given 0~1 addr and 0~4 topics, feed the possibly-matching transactions to 'fn'; the return value of 'fn' indicates whether it wants more data.
func (*DB) GetAllUtxoIds ¶
func (*DB) GetBlockByHash ¶
given a block's hash, feed possibly-correct serialized information to collectResult; if collectResult confirms the information is correct by returning true, this function stops loop.
func (*DB) GetBlockByHeight ¶
given a block's height, return serialized information.
func (*DB) GetBlockHashByHeight ¶
given a recent block's height, return its blockhash
func (*DB) GetLatestHeight ¶
func (*DB) GetLostAndFoundUtxoIds ¶
func (*DB) GetRedeemableUtxoIds ¶
func (*DB) GetRedeemableUtxoIdsByCovenantAddr ¶
func (*DB) GetRedeemingUtxoIds ¶
func (*DB) GetTxByHash ¶
given a block's hash, feed possibly-correct serialized information to collectResult; if collectResult confirms the information is correct by returning true, this function stops loop.
func (*DB) GetTxByHeightAndIndex ¶
given a transaction's height+index, return serialized information.
func (*DB) GetTxListByHeight ¶
func (*DB) GetTxListByHeightWithRange ¶
given a blocks's height, return serialized information of its transactions.
func (*DB) GetUtxoIdsByCovenantAddr ¶
func (*DB) GetUtxoInfos ¶
func (*DB) QueryNotificationCounter ¶
func (*DB) QueryTxByDst ¶
func (*DB) QueryTxBySrc ¶
func (*DB) QueryTxBySrcOrDst ¶
func (*DB) SetDisableComplexIndex ¶
func (*DB) SetExtractNotificationFn ¶
func (d *DB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*DB) SetMaxEntryCount ¶
func (*DB) SetOpListsForCcUtxo ¶
func (d *DB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
type LiteDB ¶
type LiteDB struct {
// contains filtered or unexported fields
}
func (*LiteDB) BasicQueryLogs ¶
func (*LiteDB) GetAllUtxoIds ¶
func (*LiteDB) GetBlockByHash ¶
func (*LiteDB) GetBlockByHeight ¶
func (*LiteDB) GetBlockHashByHeight ¶
func (*LiteDB) GetLatestHeight ¶
func (*LiteDB) GetLostAndFoundUtxoIds ¶
func (*LiteDB) GetRedeemableUtxoIds ¶
func (*LiteDB) GetRedeemableUtxoIdsByCovenantAddr ¶
func (*LiteDB) GetRedeemingUtxoIds ¶
func (*LiteDB) GetTxByHash ¶
func (*LiteDB) GetTxByHeightAndIndex ¶
func (*LiteDB) GetTxListByHeight ¶
func (*LiteDB) GetTxListByHeightWithRange ¶
func (*LiteDB) GetTxSigByHash ¶
func (*LiteDB) GetUtxoIdsByCovenantAddr ¶
func (*LiteDB) GetUtxoInfos ¶
func (*LiteDB) QueryNotificationCounter ¶
func (*LiteDB) QueryTxByDst ¶
func (*LiteDB) QueryTxBySrc ¶
func (*LiteDB) QueryTxBySrcOrDst ¶
func (*LiteDB) SetDisableComplexIndex ¶
func (*LiteDB) SetExtractNotificationFn ¶
func (d *LiteDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*LiteDB) SetMaxEntryCount ¶
func (*LiteDB) SetOpListsForCcUtxo ¶
func (d *LiteDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
func (*MockDB) BasicQueryLogs ¶
func (*MockDB) GetAllUtxoIds ¶
func (*MockDB) GetBlockByHash ¶
func (*MockDB) GetBlockByHeight ¶
func (*MockDB) GetBlockHashByHeight ¶
func (*MockDB) GetLatestHeight ¶
func (*MockDB) GetLostAndFoundUtxoIds ¶
func (*MockDB) GetRedeemableUtxoIds ¶
func (*MockDB) GetRedeemableUtxoIdsByCovenantAddr ¶
func (*MockDB) GetRedeemingUtxoIds ¶
func (*MockDB) GetTxByHash ¶
func (*MockDB) GetTxByHeightAndIndex ¶
func (*MockDB) GetTxListByHeight ¶
func (*MockDB) GetTxListByHeightWithRange ¶
func (*MockDB) GetUtxoIdsByCovenantAddr ¶
func (*MockDB) GetUtxoInfos ¶
func (*MockDB) QueryNotificationCounter ¶
func (*MockDB) QueryTxByDst ¶
func (*MockDB) QueryTxBySrc ¶
func (*MockDB) QueryTxBySrcOrDst ¶
func (*MockDB) SetDisableComplexIndex ¶
func (*MockDB) SetExtractNotificationFn ¶
func (d *MockDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*MockDB) SetMaxEntryCount ¶
func (*MockDB) SetOpListsForCcUtxo ¶
func (d *MockDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)