Versions in this module Expand all Collapse all v0 v0.1.3 Nov 23, 2023 Changes in this version type Controller + func NewWithContext(ctx context.Context, cfg *Config, db *gorm.DB, helpers utils.Utils) (*Controller, error) + type ListenerStats struct + Host string + Node string + Secret string type LsConfig + Stats *ListenerStats v0.1.2 Apr 17, 2023 Changes in this version + const CallbackHandler + const ListenHandler + const LogEvent + const TxEvent + func AddListener(name string, ...) + type BaseJob struct + func NewBaseJob(listener Listener, job *models.Job, transaction Transaction) (*BaseJob, error) + func (e *BaseJob) CreatedAt() time.Time + func (e *BaseJob) FromChainID() *big.Int + func (e *BaseJob) GetBackOff() int + func (e *BaseJob) GetData() []byte + func (e *BaseJob) GetID() int32 + func (e *BaseJob) GetListener() Listener + func (e *BaseJob) GetMaxTry() int + func (e *BaseJob) GetNextTry() int64 + func (e *BaseJob) GetRetryCount() int + func (e *BaseJob) GetSubscriptionName() string + func (e *BaseJob) GetTransaction() Transaction + func (e *BaseJob) GetType() int + func (e *BaseJob) GetValue() *big.Int + func (e *BaseJob) Hash() common.Hash + func (e *BaseJob) IncreaseRetryCount() + func (e *BaseJob) Process() ([]byte, error) + func (e *BaseJob) Save(status string) error + func (e *BaseJob) SetID(id int32) + func (e *BaseJob) String() string + func (e *BaseJob) UpdateNextTry(nextTry int64) + func (e *BaseJob) Utils() utils.Utils + type Block interface + GetHash func() common.Hash + GetHeight func() uint64 + GetLogs func() []Log + GetTimestamp func() uint64 + GetTransactions func() []Transaction + type BridgeWorker struct + func NewWorker(ctx context.Context, id int, size int, listeners map[string]Listener) *BridgeWorker + func (w *BridgeWorker) Channel() chan JobHandler + func (w *BridgeWorker) Close() + func (w *BridgeWorker) Context() context.Context + func (w *BridgeWorker) ProcessJob(job JobHandler) error + func (w *BridgeWorker) Stop() + func (w *BridgeWorker) String() string + func (w *BridgeWorker) Wait() + type Config struct + BackOff int32 + DB *stores.Database + Listeners map[string]*LsConfig + MaxQueueSize int + MaxRetry int32 + NumberOfWorkers int + Testing bool + type Controller struct + HandlerABIs map[string]*abi.ABI + Pool *Pool + func New(cfg *Config, db *gorm.DB, helpers utils.Utils) (*Controller, error) + func (c *Controller) Close() + func (c *Controller) LoadABIsFromConfig(lsConfig *LsConfig) (err error) + func (c *Controller) LoadAbi(path string) (*abi.ABI, error) + func (c *Controller) Start() error + type EmptyTransaction struct + func NewEmptyTransaction(chainId *big.Int, tx common.Hash, data []byte, from, to *common.Address) *EmptyTransaction + func (b *EmptyTransaction) GetData() []byte + func (b *EmptyTransaction) GetFromAddress() string + func (b *EmptyTransaction) GetHash() common.Hash + func (b *EmptyTransaction) GetToAddress() string + func (b *EmptyTransaction) GetValue() *big.Int + type Handler struct + ABI *abi.ABI + Contract string + ContractAddress string + HandleMethod string + Listener string + Name string + type Job struct + BackOff int32 + ID int32 + Listener Listener + MaxTry int32 + Message []interface{} + NextTry int32 + RetryCount int32 + Type int + func (job Job) Hash() common.Hash + type JobHandler interface + CreatedAt func() time.Time + FromChainID func() *big.Int + GetBackOff func() int + GetData func() []byte + GetID func() int32 + GetListener func() Listener + GetMaxTry func() int + GetNextTry func() int64 + GetRetryCount func() int + GetSubscriptionName func() string + GetTransaction func() Transaction + GetType func() int + GetValue func() *big.Int + Hash func() common.Hash + IncreaseRetryCount func() + Process func() ([]byte, error) + Save func(string) error + String func() string + UpdateNextTry func(int64) + type Listener interface + AddListeners func(map[string]Listener) + AddTask func(handler TaskHandler) + CacheBlocks func(blockNumbers map[uint64]struct{}) + Close func() + Config func() *LsConfig + Context func() context.Context + GetBlock func(height uint64) (Block, error) + GetBlockWithLogs func(height uint64) (Block, error) + GetBridgeOperatorSign func() utils.ISign + GetChainID func() (*big.Int, error) + GetCurrentBlock func() Block + GetEthClient func() utils.EthClient + GetInitHeight func() uint64 + GetLatestBlock func() (Block, error) + GetLatestBlockHeight func() (uint64, error) + GetLegacyBridgeOperatorSign func() utils.ISign + GetListenHandleJob func(subscriptionName string, tx Transaction, eventId string, data []byte) JobHandler + GetListener func(string) Listener + GetName func() string + GetReceipt func(common.Hash) (*types.Receipt, error) + GetRelayerSign func() utils.ISign + GetSafeBlockRange func() uint64 + GetStore func() stores.MainStore + GetSubscriptions func() map[string]*Subscribe + GetTask func(index int) TaskHandler + GetTasks func() []TaskHandler + GetVoterSign func() utils.ISign + IsDisabled func() bool + IsUpTodate func() bool + NewJobFromDB func(job *models.Job) (JobHandler, error) + Period func() time.Duration + SaveCurrentBlockToDB func() error + SaveTransactionsToDB func(txs []Transaction) error + SendCallbackJobs func(listeners map[string]Listener, subscriptionName string, tx Transaction, ...) + SetInitHeight func(uint64) + Start func() + UpdateCurrentBlock func(block Block) error + type Log interface + GetContractAddress func() string + GetData func() []byte + GetIndex func() uint + GetTopics func() []string + GetTransactionHash func() string + GetTxIndex func() uint + type LsConfig struct + ChainId string + Contracts map[string]string + Disabled bool + FromHeight uint64 + GasLimitBumpRatio uint64 + GetLogsBatchSize int + LoadInterval time.Duration + MaxProcessingTasks int + MaxTasksQuery int + MinTasksQuery int + Name string + ProcessWithinBlocks uint64 + RpcUrl string + SafeBlockRange uint64 + Secret *Secret + Subscriptions map[string]*Subscribe + TaskInterval time.Duration + TransactionCheckPeriod time.Duration + type Pool struct + BackOff int32 + FailedJobChan chan JobHandler + JobChan chan JobHandler + MaxQueueSize int + MaxRetry int32 + Queue chan chan JobHandler + RetryJobChan chan JobHandler + Workers []Worker + func NewPool(ctx context.Context, cfg *Config, db *gorm.DB, workers []Worker) *Pool + func (p *Pool) AddWorkers(workers []Worker) + func (p *Pool) Enqueue(job JobHandler) + func (p *Pool) IsClosed() bool + func (p *Pool) PrepareRetryableJob(job JobHandler) + func (p *Pool) RetryJob(job JobHandler) + func (p *Pool) SendJobToWorker(workerCh chan JobHandler, job JobHandler) + func (p *Pool) Start(closeFunc func()) + func (p *Pool) Stats() Stats + func (p *Pool) Wait() + type Receipt interface + GetLogs func() []Log + GetStatus func() bool + GetTransaction func() Transaction + type Secret struct + BridgeOperator *utils.SignMethodConfig + LegacyBridgeOperator *utils.SignMethodConfig + Relayer *utils.SignMethodConfig + Voter *utils.SignMethodConfig + type Stats struct + Queue int + RetryableQueue int + RetryingJob int32 + type Subscribe struct + CallBacks map[string]string + From string + Handler *Handler + To string + Type int + type TaskHandler interface + Close func() + GetListener func() Listener + SetLimitQuery func(limit int) + Start func() + type Transaction interface + GetData func() []byte + GetFromAddress func() string + GetHash func() common.Hash + GetToAddress func() string + GetValue func() *big.Int + type Worker interface + Channel func() chan JobHandler + Close func() + Context func() context.Context + ProcessJob func(job JobHandler) error + Stop func() + Wait func() v0.1.1 Oct 17, 2022 v0.0.1 Aug 3, 2022