timelock

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 29 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(l *zerolog.Logger)

Starts a http server, serving the healthz endpoint.

func StartMetricsServer added in v0.0.3

func StartMetricsServer(l *zerolog.Logger)

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 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, logger *zerolog.Logger,
) (*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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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