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 HPFile
- type LiteDB
- func (db *LiteDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (db *LiteDB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (db *LiteDB) Close()
- func (db *LiteDB) GetAllUtxoIds() [][36]byte
- func (db *LiteDB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *LiteDB) GetBlockByHeight(height int64) []byte
- func (db *LiteDB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (db *LiteDB) GetLatestHeight() (latestHeight int64)
- func (db *LiteDB) GetLostAndFoundUtxoIds() [][36]byte
- func (db *LiteDB) GetRedeemableUtxoIds() [][36]byte
- func (db *LiteDB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *LiteDB) GetRedeemingUtxoIds() [][36]byte
- func (db *LiteDB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *LiteDB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (db *LiteDB) GetTxListByHeight(height int64) [][]byte
- func (db *LiteDB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (db *LiteDB) GetTxSigByHash(hash [32]byte) (res [65]byte)
- func (db *LiteDB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *LiteDB) GetUtxoInfos() (infos [][36 + 1 + 20]byte)
- func (db *LiteDB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (db *LiteDB) QueryNotificationCounter(key []byte) int64
- func (db *LiteDB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *LiteDB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *LiteDB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *LiteDB) SetDisableComplexIndex(b bool)
- func (db *LiteDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (db *LiteDB) SetMaxEntryCount(c int)
- func (db *LiteDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
- type MoDB
- func (db *MoDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (db *MoDB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (db *MoDB) Close()
- func (db *MoDB) GetAllUtxoIds() [][36]byte
- func (db *MoDB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *MoDB) GetBlockByHeight(height int64) []byte
- func (db *MoDB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (db *MoDB) GetLatestHeight() int64
- func (db *MoDB) GetLostAndFoundUtxoIds() [][36]byte
- func (db *MoDB) GetRedeemableUtxoIds() [][36]byte
- func (db *MoDB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *MoDB) GetRedeemingUtxoIds() [][36]byte
- func (db *MoDB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *MoDB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (db *MoDB) GetTxListByHeight(height int64) [][]byte
- func (db *MoDB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (db *MoDB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *MoDB) GetUtxoInfos() (infos [][36 + 1 + 20]byte)
- func (db *MoDB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (db *MoDB) QueryNotificationCounter(key []byte) int64
- func (db *MoDB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MoDB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MoDB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MoDB) SetDisableComplexIndex(b bool)
- func (db *MoDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (db *MoDB) SetMaxEntryCount(c int)
- func (db *MoDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
- type MockMoDB
- func (db *MockMoDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
- func (db *MockMoDB) BasicQueryLogs(addr *[20]byte, topics [][32]byte, startHeight, endHeight uint32, ...) error
- func (db *MockMoDB) Close()
- func (db *MockMoDB) GetAllUtxoIds() [][36]byte
- func (db *MockMoDB) GetBlockByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *MockMoDB) GetBlockByHeight(height int64) []byte
- func (db *MockMoDB) GetBlockHashByHeight(height int64) (res [32]byte)
- func (db *MockMoDB) GetLatestHeight() int64
- func (db *MockMoDB) GetLostAndFoundUtxoIds() [][36]byte
- func (db *MockMoDB) GetRedeemableUtxoIds() [][36]byte
- func (db *MockMoDB) GetRedeemableUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *MockMoDB) GetRedeemingUtxoIds() [][36]byte
- func (db *MockMoDB) GetTxByHash(hash [32]byte, collectResult func([]byte) bool)
- func (db *MockMoDB) GetTxByHeightAndIndex(height int64, index int) []byte
- func (db *MockMoDB) GetTxListByHeight(height int64) (res [][]byte)
- func (db *MockMoDB) GetTxListByHeightWithRange(height int64, start, end int) [][]byte
- func (db *MockMoDB) GetUtxoIdsByCovenantAddr(covenantAddr [20]byte) [][36]byte
- func (db *MockMoDB) GetUtxoInfos() (infos [][57]byte)
- func (db *MockMoDB) QueryLogs(addrOrList [][20]byte, topicsOrList [][][32]byte, ...) error
- func (db *MockMoDB) QueryNotificationCounter(key []byte) (counter int64)
- func (db *MockMoDB) QueryTxByDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MockMoDB) QueryTxBySrc(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MockMoDB) QueryTxBySrcOrDst(addr [20]byte, startHeight, endHeight uint32, fn func([]byte) bool) error
- func (db *MockMoDB) SetDisableComplexIndex(b bool)
- func (db *MockMoDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
- func (db *MockMoDB) SetMaxEntryCount(c int)
- func (db *MockMoDB) 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 ¶ added in v0.1.1
To-address of TX From-address of SEP20-Transfer To-address of SEP20-Transfer
func EncodeToHex ¶ added in v0.3.3
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 ¶ added in v0.1.1
type LiteDB ¶ added in v0.1.3
type LiteDB struct {
// contains filtered or unexported fields
}
func (*LiteDB) BasicQueryLogs ¶ added in v0.1.3
func (*LiteDB) GetAllUtxoIds ¶ added in v0.4.4
func (*LiteDB) GetBlockByHash ¶ added in v0.1.3
func (*LiteDB) GetBlockByHeight ¶ added in v0.1.3
func (*LiteDB) GetBlockHashByHeight ¶ added in v0.1.3
func (*LiteDB) GetLatestHeight ¶ added in v0.1.3
func (*LiteDB) GetLostAndFoundUtxoIds ¶ added in v0.4.4
func (*LiteDB) GetRedeemableUtxoIds ¶ added in v0.4.4
func (*LiteDB) GetRedeemableUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*LiteDB) GetRedeemingUtxoIds ¶ added in v0.4.4
func (*LiteDB) GetTxByHash ¶ added in v0.1.3
func (*LiteDB) GetTxByHeightAndIndex ¶ added in v0.1.3
func (*LiteDB) GetTxListByHeight ¶ added in v0.1.3
func (*LiteDB) GetTxListByHeightWithRange ¶ added in v0.2.0
func (*LiteDB) GetTxSigByHash ¶ added in v0.3.3
func (*LiteDB) GetUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*LiteDB) GetUtxoInfos ¶ added in v0.4.4
func (*LiteDB) QueryNotificationCounter ¶ added in v0.1.3
func (*LiteDB) QueryTxByDst ¶ added in v0.1.3
func (*LiteDB) QueryTxBySrc ¶ added in v0.1.3
func (*LiteDB) QueryTxBySrcOrDst ¶ added in v0.1.3
func (*LiteDB) SetDisableComplexIndex ¶ added in v0.1.3
func (*LiteDB) SetExtractNotificationFn ¶ added in v0.1.3
func (db *LiteDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*LiteDB) SetMaxEntryCount ¶ added in v0.1.3
func (*LiteDB) SetOpListsForCcUtxo ¶ added in v0.4.4
func (db *LiteDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
type MoDB ¶
type MoDB struct {
// contains filtered or unexported fields
}
func (*MoDB) AddBlock ¶
func (db *MoDB) AddBlock(blk *types.Block, pruneTillHeight int64, txid2sigMap map[[32]byte][65]byte)
Add a new block for indexing, and prune the index information for blocks before pruneTillHeight The ownership of 'blk' will be transferred to MoDB and cannot be changed by out world!
func (*MoDB) BasicQueryLogs ¶
func (db *MoDB) 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 (*MoDB) GetAllUtxoIds ¶ added in v0.4.4
func (*MoDB) 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 (*MoDB) GetBlockByHeight ¶
given a block's height, return serialized information.
func (*MoDB) GetBlockHashByHeight ¶ added in v0.1.1
given a recent block's height, return its blockhash
func (*MoDB) GetLatestHeight ¶
func (*MoDB) GetLostAndFoundUtxoIds ¶ added in v0.4.4
func (*MoDB) GetRedeemableUtxoIds ¶ added in v0.4.4
func (*MoDB) GetRedeemableUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*MoDB) GetRedeemingUtxoIds ¶ added in v0.4.4
func (*MoDB) 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 (*MoDB) GetTxByHeightAndIndex ¶
given a transaction's height+index, return serialized information.
func (*MoDB) GetTxListByHeight ¶
func (*MoDB) GetTxListByHeightWithRange ¶ added in v0.2.0
given a blocks's height, return serialized information of its transactions.
func (*MoDB) GetUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*MoDB) GetUtxoInfos ¶ added in v0.4.4
func (*MoDB) QueryNotificationCounter ¶ added in v0.1.1
func (*MoDB) QueryTxByDst ¶
func (*MoDB) QueryTxBySrc ¶
func (*MoDB) QueryTxBySrcOrDst ¶
func (*MoDB) SetDisableComplexIndex ¶ added in v0.1.1
func (*MoDB) SetExtractNotificationFn ¶ added in v0.1.1
func (db *MoDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*MoDB) SetMaxEntryCount ¶
func (*MoDB) SetOpListsForCcUtxo ¶ added in v0.4.3
func (db *MoDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)
type MockMoDB ¶
type MockMoDB struct {
// contains filtered or unexported fields
}
func (*MockMoDB) BasicQueryLogs ¶
func (*MockMoDB) GetAllUtxoIds ¶ added in v0.4.4
func (*MockMoDB) GetBlockByHash ¶
func (*MockMoDB) GetBlockByHeight ¶
func (*MockMoDB) GetBlockHashByHeight ¶ added in v0.1.1
func (*MockMoDB) GetLatestHeight ¶
func (*MockMoDB) GetLostAndFoundUtxoIds ¶ added in v0.4.4
func (*MockMoDB) GetRedeemableUtxoIds ¶ added in v0.4.4
func (*MockMoDB) GetRedeemableUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*MockMoDB) GetRedeemingUtxoIds ¶ added in v0.4.4
func (*MockMoDB) GetTxByHash ¶
func (*MockMoDB) GetTxByHeightAndIndex ¶
func (*MockMoDB) GetTxListByHeight ¶
func (*MockMoDB) GetTxListByHeightWithRange ¶ added in v0.2.0
func (*MockMoDB) GetUtxoIdsByCovenantAddr ¶ added in v0.4.4
func (*MockMoDB) GetUtxoInfos ¶ added in v0.4.4
func (*MockMoDB) QueryNotificationCounter ¶ added in v0.1.1
func (*MockMoDB) QueryTxByDst ¶
func (*MockMoDB) QueryTxBySrc ¶
func (*MockMoDB) QueryTxBySrcOrDst ¶
func (*MockMoDB) SetDisableComplexIndex ¶ added in v0.1.1
func (*MockMoDB) SetExtractNotificationFn ¶ added in v0.1.1
func (db *MockMoDB) SetExtractNotificationFn(fn types.ExtractNotificationFromTxFn)
func (*MockMoDB) SetMaxEntryCount ¶
func (*MockMoDB) SetOpListsForCcUtxo ¶ added in v0.4.4
func (db *MockMoDB) SetOpListsForCcUtxo(opListsForCcUtxo types.OpListsForCcUtxo)