chainwatcher

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package chainwatcher implements a standalone chain watcher that monitors payer report events on the settlement chain and emits Prometheus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMetrics

func RegisterMetrics(reg prometheus.Registerer)

Types

type Config

type Config struct {
	SettlementChainRPCURL string
	SettlementChainWSSURL string

	PayerReportManagerAddress string
	PayerRegistryAddress      string

	DeploymentBlock        uint64
	MaxChainDisconnectTime time.Duration
	BackfillBlockPageSize  uint64
	ActiveOriginatorWindow time.Duration
}

Config holds the configuration for the chain watcher.

type Watcher

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

Watcher subscribes to settlement chain events and emits Prometheus metrics.

func New

func New(
	ctx context.Context,
	logger *zap.Logger,
	cfg Config,
) (*Watcher, error)

New creates a new chain watcher.

func (*Watcher) Start

func (w *Watcher) Start() error

Start begins watching chain events and emitting metrics.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop gracefully shuts down the watcher.

Jump to

Keyboard shortcuts

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