watchdog

package
v0.0.0-...-f645b23 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromConfig

func InitFromConfig(ctx context.Context, w *Watchdog, cfg *Config) error

nolint: funlen

Types

type Config

type Config struct {
	// address configs
	SrcBridgeAddress  common.Address
	DestBridgeAddress common.Address

	// private key
	WatchdogPrivateKey *ecdsa.PrivateKey

	// processing configs
	Confirmations        uint64
	ConfirmationsTimeout uint64
	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.DB, error)

	SrcTxmgrConfigs  *txmgr.CLIConfig
	DestTxmgrConfigs *txmgr.CLIConfig
}

func NewConfigFromCliContext

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

NewConfigFromCliContext creates a new config instance from command line flags.

type Watchdog

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

func (*Watchdog) Close

func (w *Watchdog) Close(ctx context.Context)

func (*Watchdog) InitFromCli

func (w *Watchdog) InitFromCli(ctx context.Context, c *cli.Context) error

func (*Watchdog) Name

func (w *Watchdog) Name() string

func (*Watchdog) Start

func (w *Watchdog) Start() error

Jump to

Keyboard shortcuts

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