extractor

package
v0.0.0-...-491e088 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbiProcessor

type AbiProcessor struct {
	// contains filtered or unexported fields
}

func (*AbiProcessor) GetEvent

func (processor *AbiProcessor) GetEvent(evtLog ethaccessor.Log) (EventData, bool)

GetEvent get EventData with id hash

func (*AbiProcessor) GetMethod

func (processor *AbiProcessor) GetMethod(tx *ethaccessor.Transaction) (MethodData, bool)

GetMethod get MethodData with method id

func (*AbiProcessor) GetMethodName

func (processor *AbiProcessor) GetMethodName(tx *ethaccessor.Transaction) string

GetMethodName

func (*AbiProcessor) HasSpender

func (processor *AbiProcessor) HasSpender(spender common.Address) bool

HasSpender check approve spender address have ever been load

func (*AbiProcessor) SupportedContract

func (processor *AbiProcessor) SupportedContract(protocol common.Address) bool

SupportedContract judge protocol have ever been load

func (*AbiProcessor) SupportedEvents

func (processor *AbiProcessor) SupportedEvents(receipt *ethaccessor.TransactionReceipt) bool

SupportedEvents supported contract events and unsupported erc20 events

func (*AbiProcessor) SupportedMethod

func (processor *AbiProcessor) SupportedMethod(tx *ethaccessor.Transaction) bool

SupportedMethod only supported contracts method

type EventData

type EventData struct {
	types.TxInfo
	Event  interface{}
	CAbi   *abi.ABI
	Id     common.Hash
	Name   string
	Topics []string
}

func (*EventData) FullFilled

func (event *EventData) FullFilled(tx *ethaccessor.Transaction, evtLog *ethaccessor.Log, gasUsed, blockTime *big.Int, methodName string)

type ExtractorService

type ExtractorService interface {
	Start()
	Stop()
	ForkProcess(block *types.Block) error
}

type ExtractorServiceImpl

type ExtractorServiceImpl struct {
	// contains filtered or unexported fields
}

TODO(fukun):不同的channel,应当交给orderbook统一进行后续处理,可以将channel作为函数返回值、全局变量、参数等方式

func NewExtractorService

func NewExtractorService(options config.ExtractorOptions, db dao.RdsService) *ExtractorServiceImpl

func (*ExtractorServiceImpl) ForkProcess

func (l *ExtractorServiceImpl) ForkProcess(currentBlock *types.Block) error

重启(分叉)时先关停subscribeEvents,然后关

func (*ExtractorServiceImpl) ProcessBlock

func (l *ExtractorServiceImpl) ProcessBlock() error

func (*ExtractorServiceImpl) ProcessEvent

func (l *ExtractorServiceImpl) ProcessEvent(tx *ethaccessor.Transaction, receipt *ethaccessor.TransactionReceipt, blockTime *big.Int) error

func (*ExtractorServiceImpl) ProcessMethod

func (l *ExtractorServiceImpl) ProcessMethod(tx *ethaccessor.Transaction, receipt *ethaccessor.TransactionReceipt, blockTime *big.Int) error

func (*ExtractorServiceImpl) ProcessMinedTransaction

func (l *ExtractorServiceImpl) ProcessMinedTransaction(tx *ethaccessor.Transaction, receipt *ethaccessor.TransactionReceipt, blockTime *big.Int) error

func (*ExtractorServiceImpl) ProcessPendingTransaction

func (l *ExtractorServiceImpl) ProcessPendingTransaction(tx *ethaccessor.Transaction) error

func (*ExtractorServiceImpl) Start

func (l *ExtractorServiceImpl) Start()

func (*ExtractorServiceImpl) Stop

func (l *ExtractorServiceImpl) Stop()

func (*ExtractorServiceImpl) Sync

func (l *ExtractorServiceImpl) Sync(blockNumber *big.Int)

func (*ExtractorServiceImpl) Warning

func (l *ExtractorServiceImpl) Warning(err error)

Warning 当发生严重错误时需关停extractor,并通知其他模块

func (*ExtractorServiceImpl) WatchingPendingTransaction

func (l *ExtractorServiceImpl) WatchingPendingTransaction(input eventemitter.EventData) error

type MethodData

type MethodData struct {
	types.TxInfo
	Method interface{}
	CAbi   *abi.ABI
	Id     string
	Name   string
	Input  string
}

func (*MethodData) FullFilled

func (method *MethodData) FullFilled(tx *ethaccessor.Transaction, gasUsed, blockTime *big.Int, status types.TxStatus, methodName string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL