processor

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// FallbackGasTipCap is the default fallback gasTipCap used when we are
	// unable to query an L1 backend for a suggested gasTipCap.
	FallbackGasTipCap = big.NewInt(1500000000)
)

Functions

func InitFromConfig

func InitFromConfig(ctx context.Context, p *Processor, cfg *Config) error

nolint: funlen

func IsMaxPriorityFeePerGasNotFoundError

func IsMaxPriorityFeePerGasNotFoundError(err error) bool

IsMaxPriorityFeePerGasNotFoundError returns true if the provided error signals that the backend does not support the eth_maxPrirorityFeePerGas method. In this case, the caller should fallback to using the constant above.

Types

type Config

type Config struct {
	// address configs
	SrcSignalServiceAddress common.Address
	DestBridgeAddress       common.Address
	DestERC721VaultAddress  common.Address
	DestERC20VaultAddress   common.Address
	DestERC1155VaultAddress common.Address
	DestTaikoAddress        common.Address

	// private key
	ProcessorPrivateKey *ecdsa.PrivateKey

	TargetTxHash *common.Hash

	// processing configs
	HeaderSyncInterval   uint64
	Confirmations        uint64
	ConfirmationsTimeout uint64
	ProfitableOnly       bool
	EnableTaikoL2        bool

	// backoff configs
	BackoffRetryInterval uint64
	BackOffMaxRetrys     uint64

	// db configs
	DatabaseUsername        string
	DatabasePassword        string
	DatabaseName            string
	DatabaseHost            string
	DatabaseMaxIdleConns    uint64
	DatabaseMaxOpenConns    uint64
	DatabaseMaxConnLifetime uint64
	// queue configs
	QueueUsername string
	QueuePassword string
	QueueHost     string
	QueuePort     uint64
	QueuePrefetch uint64
	// rpc configs
	SrcRPCUrl        string
	DestRPCUrl       string
	ETHClientTimeout uint64
	OpenQueueFunc    func() (queue.Queue, error)
	OpenDBFunc       func() (DB, error)

	CacheOption int
	// contains filtered or unexported fields
}

Config is a struct used to initialize a processor.

func NewConfigFromCliContext

func NewConfigFromCliContext(c *cli.Context) (*Config, error)

NewConfigFromCliContext creates a new config instance from command line flags.

type DB

type DB interface {
	DB() (*sql.DB, error)
	GormDB() *gorm.DB
}

type Processor

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

Processor is the main struct which handles message processing and queue instantiation

func (*Processor) Close

func (p *Processor) Close(ctx context.Context)

func (*Processor) InitFromCli

func (p *Processor) InitFromCli(ctx context.Context, c *cli.Context) error

InitFromCli creates a new processor from a cli context

func (*Processor) Name

func (p *Processor) Name() string

func (*Processor) Start

func (p *Processor) Start() error

Jump to

Keyboard shortcuts

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