pushwatcher

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pushwatcher provides a client for listening to Push Chain events.

Index

Constants

View Source
const DefaultPollInterval = 2 * time.Second

Variables

View Source
var (
	ErrNilClient      = errors.New("push client is nil")
	ErrNilDatabase    = errors.New("database is nil")
	ErrAlreadyRunning = errors.New("event listener is already running")
	ErrNotRunning     = errors.New("event listener is not running")
)

Functions

This section is empty.

Types

type Client

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

Client implements the ChainClient interface for Push chain

func NewClient

func NewClient(
	database *db.DB,
	chainConfig *config.ChainSpecificConfig,
	pushCore *pushcore.Client,
	chainID string,
	logger zerolog.Logger,
) (*Client, error)

NewClient creates a new Push chain client

func (*Client) IsHealthy

func (c *Client) IsHealthy() bool

IsHealthy checks if the Push chain RPC Client is healthy

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

Start initializes and starts the Push chain client

func (*Client) Stop

func (c *Client) Stop() error

Stop gracefully shuts down the Push chain client

type Config

type Config struct {
	PollInterval time.Duration
}

Config holds configuration for the Push event listener.

type EventListener

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

EventListener polls Push chain for active TSS events and pending outbounds via gRPC, converts them to store.Events, and inserts them into the local DB.

func NewEventListener

func NewEventListener(
	pushCore *pushcore.Client,
	database *db.DB,
	logger zerolog.Logger,
	chainConfig *config.ChainSpecificConfig,
) (*EventListener, error)

NewEventListener creates a new Push event listener.

func (*EventListener) IsRunning

func (el *EventListener) IsRunning() bool

IsRunning returns whether the event listener is currently running.

func (*EventListener) Start

func (el *EventListener) Start(ctx context.Context) error

Start begins polling for Push chain events.

func (*EventListener) Stop

func (el *EventListener) Stop() error

Stop gracefully stops the event listener.

Jump to

Keyboard shortcuts

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