timelock

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLiveStatus added in v0.0.3

func SetLiveStatus(status HealthStatus)

func SetReadyStatus added in v0.0.3

func SetReadyStatus(status HealthStatus)

func StartHTTPHealthServer added in v0.0.3

func StartHTTPHealthServer(log *zap.SugaredLogger)

Starts a http server, serving the healthz endpoint.

func StartMetricsServer added in v0.0.3

func StartMetricsServer(log *zap.SugaredLogger)

Types

type HealthStatus added in v0.0.3

type HealthStatus int

HealthStatus represents the health status enum.

const (
	HealthStatusOK HealthStatus = iota
	HealthStatusError
)

func GetLiveStatus added in v0.0.3

func GetLiveStatus() HealthStatus

func GetReadyStatus added in v0.0.3

func GetReadyStatus() HealthStatus

type Scheduler added in v0.0.7

type Scheduler interface {
	// contains filtered or unexported methods
}

type Worker

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

Worker represents a worker instance. address is an array of addresses as expected by ethereum.FilterQuery, but it's enforced only to one address in the logic.

func NewTimelockWorker

func NewTimelockWorker(
	nodeURL, timelockAddress, callProxyAddress, privateKey string, fromBlock *big.Int,
	pollPeriod int64, listenerPollPeriod int64, pollSize uint64, dryRun bool, logger *zap.SugaredLogger,
) (*Worker, error)

NewTimelockWorker initializes and returns a timelockWorker. It's a singleton, so further executions will retrieve the same timelockWorker.

func (*Worker) Listen

func (tw *Worker) Listen(ctx context.Context) error

Listen is the main function of a Timelock Worker. It handles the retrieval of old and new events, contexts and cancellations.

Jump to

Keyboard shortcuts

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