Documentation
¶
Index ¶
- func EvmWord(i uint64) common.Hash
- func NewLogPoller(orm *ORM, ec client.Client, lggr logger.Logger, pollPeriod time.Duration, ...) *logPoller
- type Log
- type LogPoller
- type LogPollerBlock
- type ORM
- func (o *ORM) DeleteLogs(start, end int64, qopts ...pg.QOpt) error
- func (o *ORM) DeleteRangeBlocks(start, end int64, qopts ...pg.QOpt) error
- func (o *ORM) InsertBlock(h common.Hash, n int64, qopts ...pg.QOpt) error
- func (o *ORM) InsertLogs(logs []Log, qopts ...pg.QOpt) error
- func (o *ORM) LatestLogEventSigsAddrs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, ...) ([]Log, error)
- func (o *ORM) SelectBlockByHash(h common.Hash, qopts ...pg.QOpt) (*LogPollerBlock, error)
- func (o *ORM) SelectBlockByNumber(n int64, qopts ...pg.QOpt) (*LogPollerBlock, error)
- func (o *ORM) SelectDataWordGreaterThan(address common.Address, eventSig []byte, wordIndex int, ...) ([]Log, error)
- func (o *ORM) SelectDataWordRange(address common.Address, eventSig []byte, wordIndex int, ...) ([]Log, error)
- func (o *ORM) SelectIndexLogsTopicGreaterThan(address common.Address, eventSig []byte, topicIndex int, ...) ([]Log, error)
- func (o *ORM) SelectIndexLogsTopicRange(address common.Address, eventSig []byte, topicIndex int, ...) ([]Log, error)
- func (o *ORM) SelectIndexedLogs(address common.Address, eventSig []byte, topicIndex int, ...) ([]Log, error)
- func (o *ORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error)
- func (o *ORM) SelectLatestLogEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error)
- func (o *ORM) SelectLogsByBlockRangeFilter(start, end int64, address common.Address, eventSig []byte, qopts ...pg.QOpt) ([]Log, error)
- func (o *ORM) SelectLogsWithSigsByBlockRangeFilter(start, end int64, address common.Address, eventSigs [][]byte, qopts ...pg.QOpt) (logs []Log, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Log ¶
type Log struct {
EvmChainId *utils.Big
LogIndex int64
BlockHash common.Hash
BlockNumber int64
Topics pq.ByteaArray
EventSig []byte
Address common.Address
TxHash common.Hash
Data []byte
CreatedAt time.Time
}
Log represents an EVM log.
type LogPoller ¶
type LogPoller interface {
services.ServiceCtx
Replay(ctx context.Context, fromBlock int64) error
MergeFilter(topics []common.Hash, address common.Address)
LatestBlock(qopts ...pg.QOpt) (int64, error)
// General queries
Logs(start, end int64, eventSig common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error)
LogsWithSigs(start, end int64, eventSigs []common.Hash, address common.Address, qopts ...pg.QOpt) ([]Log, error)
LatestLogByEventSigWithConfs(eventSig common.Hash, address common.Address, confs int, qopts ...pg.QOpt) (*Log, error)
LatestLogEventSigsAddrs(fromBlock int64, eventSigs []common.Hash, addresses []common.Address, qopts ...pg.QOpt) ([]Log, error)
// Content based querying
IndexedLogs(eventSig common.Hash, address common.Address, topicIndex int, topicValues []common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error)
IndexedLogsTopicGreaterThan(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error)
IndexedLogsTopicRange(eventSig common.Hash, address common.Address, topicIndex int, topicValueMin common.Hash, topicValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error)
LogsDataWordGreaterThan(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error)
LogsDataWordRange(eventSig common.Hash, address common.Address, wordIndex int, wordValueMin, wordValueMax common.Hash, confs int, qopts ...pg.QOpt) ([]Log, error)
}
type LogPollerBlock ¶
type LogPollerBlock struct {
EvmChainId *utils.Big
BlockHash common.Hash
// Note geth uses int64 internally https://github.com/ethereum/go-ethereum/blob/f66f1a16b3c480d3a43ac7e8a09ab3e362e96ae4/eth/filters/api.go#L340
BlockNumber int64
CreatedAt time.Time
}
LogPollerBlock represents an unfinalized block used for reorg detection when polling.
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
func (*ORM) DeleteRangeBlocks ¶
func (*ORM) InsertBlock ¶
InsertBlock is idempotent to support replays.
func (*ORM) InsertLogs ¶
InsertLogs is idempotent to support replays.
func (*ORM) LatestLogEventSigsAddrs ¶ added in v1.5.0
func (o *ORM) LatestLogEventSigsAddrs(fromBlock int64, addresses []common.Address, eventSigs []common.Hash, qopts ...pg.QOpt) ([]Log, error)
LatestLogEventSigsAddrs finds the latest log by (address, event) combination that matches a list of addresses and list of events
func (*ORM) SelectBlockByHash ¶
func (*ORM) SelectBlockByNumber ¶
func (*ORM) SelectDataWordGreaterThan ¶ added in v1.5.0
func (*ORM) SelectDataWordRange ¶ added in v1.5.0
func (*ORM) SelectIndexLogsTopicGreaterThan ¶ added in v1.5.0
func (*ORM) SelectIndexLogsTopicRange ¶ added in v1.5.0
func (*ORM) SelectIndexedLogs ¶ added in v1.5.0
func (*ORM) SelectLatestBlock ¶
func (o *ORM) SelectLatestBlock(qopts ...pg.QOpt) (*LogPollerBlock, error)
func (*ORM) SelectLatestLogEventSigWithConfs ¶
func (*ORM) SelectLogsByBlockRangeFilter ¶
func (o *ORM) SelectLogsByBlockRangeFilter(start, end int64, address common.Address, eventSig []byte, qopts ...pg.QOpt) ([]Log, error)
SelectLogsByBlockRangeFilter finds the logs in a given block range.
func (*ORM) SelectLogsWithSigsByBlockRangeFilter ¶ added in v1.7.0
func (o *ORM) SelectLogsWithSigsByBlockRangeFilter(start, end int64, address common.Address, eventSigs [][]byte, qopts ...pg.QOpt) (logs []Log, err error)
SelectLogsWithSigsByBlockRangeFilter finds the logs in the given block range with the given event signatures emitted from the given address.
Click to show internal directories.
Click to hide internal directories.