services

package
v0.0.0-...-3674750 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package services contain the key components of the Chainlink node. This includes the Application, JobRunner, LogListener, and Scheduler.

Application

The Application is the main component used for starting and stopping the Chainlink node.

JobRunner

The JobRunner keeps track of Runs within a Job and ensures that they're executed in order. Within each Run, the tasks are also executed from the JobRunner.

JobSubscriber

The JobSubscriber coordinates running job events with the EventLog in the Store, and also subscribes to the given address on the Ethereum blockchain.

Scheduler

The Scheduler ensures that recurring events are executed according to their schedule, and one-time events occur only when the specified time has passed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAll

func CloseAll(cs ...io.Closer) error

CloseAll closes all elements concurrently. Use this when you have various different types of io.Closer.

func MultiCloser

func MultiCloser[C io.Closer](cs []C) io.Closer

MultiCloser returns an io.Closer which closes all elements concurrently. Use this when you have a slice of a type which implements io.Closer. []io.Closer can be cast directly to MultiCloser.

Types

type CheckFunc

type CheckFunc func() (unwell bool, meta Meta)

type Checker

type Checker interface {
	// Register a service for health checks.
	Register(service services.HealthReporter) error
	// Unregister a service.
	Unregister(name string) error
	// IsReady returns the current readiness of the system.
	// A system is considered ready if all checks are passing (no errors)
	IsReady() (ready bool, errors map[string]error)
	// IsHealthy returns the current health of the system.
	// A system is considered healthy if all checks are passing (no errors)
	IsHealthy() (healthy bool, errors map[string]error)

	Start() error
	Close() error
}

Checker provides a service which can be probed for system health.

type Config

type Config interface {
	BlockProfileRate() int
	CPUProfileRate() int
	GatherDuration() models.Duration
	GatherTraceDuration() models.Duration
	GoroutineThreshold() int
	MaxProfileSize() utils.FileSize
	MemProfileRate() int
	MemThreshold() utils.FileSize
	MutexProfileFraction() int
	PollInterval() models.Duration
	ProfileRoot() string
}

type InBackupHealthReport

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

func NewInBackupHealthReport

func NewInBackupHealthReport(port uint16, lggr logger.Logger) *InBackupHealthReport

NewInBackupHealthReport creates a new InBackupHealthReport that will serve the /health endpoint, useful for preventing shutdowns due to health-checks when running long backup tasks

func (*InBackupHealthReport) Start

func (i *InBackupHealthReport) Start()

func (*InBackupHealthReport) Stop

func (i *InBackupHealthReport) Stop()

type Meta

type Meta map[string]interface{}

type MultiStart

type MultiStart = services.MultiStart

MultiStart is a utility for starting multiple services together. The set of started services is tracked internally, so that they can be closed if any single service fails to start.

type Nurse

type Nurse struct {
	services.StateMachine
	// contains filtered or unexported fields
}

func NewNurse

func NewNurse(cfg Config, log logger.Logger) *Nurse

func (*Nurse) AddCheck

func (n *Nurse) AddCheck(reason string, checkFunc CheckFunc)

func (*Nurse) Close

func (n *Nurse) Close() error

func (*Nurse) GatherVitals

func (n *Nurse) GatherVitals(reason string, meta Meta)

func (*Nurse) Start

func (n *Nurse) Start() error

type ServiceCtx

type ServiceCtx = services.Service

type StartClose

type StartClose = services.StartClose

StartClose is a subset of the ServiceCtx interface.

Directories

Path Synopsis
The blockhash store package provides a service that stores blockhashes such that they are available for on-chain proofs beyond the EVM 256 block limit.
The blockhash store package provides a service that stores blockhashes such that they are available for on-chain proofs beyond the EVM 256 block limit.
api
job
pg
evm
s4
signatures
cryptotest
Package cryptotest provides convenience functions for kyber-based APIs.
Package cryptotest provides convenience functions for kyber-based APIs.
ethdss
Package ethdss implements the Distributed Schnorr Signature protocol from the //////////////////////////////////////////////////////////////////////////////
Package ethdss implements the Distributed Schnorr Signature protocol from the //////////////////////////////////////////////////////////////////////////////
ethschnorr
Package ethschnorr implements a version of the Schnorr signature which is //////////////////////////////////////////////////////////////////////////////
Package ethschnorr implements a version of the Schnorr signature which is //////////////////////////////////////////////////////////////////////////////
secp256k1
Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} //////////////////////////////////////////////////////////////////////////////
Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} //////////////////////////////////////////////////////////////////////////////
vrf
v2

Jump to

Keyboard shortcuts

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