services

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package services provides Ethereum consensus client related functionality

Index

Constants

This section is empty.

Variables

AllClients contains all known consensus client implementations.

Functions

This section is empty.

Types

type Client

type Client string

Client represents an Ethereum consensus client implementation.

const (
	// ClientUnknown represents an unknown or unidentified consensus client.
	ClientUnknown Client = "unknown"
	// ClientLighthouse represents the Lighthouse consensus client.
	ClientLighthouse Client = "lighthouse"
	// ClientNimbus represents the Nimbus consensus client.
	ClientNimbus Client = "nimbus"
	// ClientTeku represents the Teku consensus client.
	ClientTeku Client = "teku"
	// ClientPrysm represents the Prysm consensus client.
	ClientPrysm Client = "prysm"
	// ClientLodestar represents the Lodestar consensus client.
	ClientLodestar Client = "lodestar"
)

func ClientFromString

func ClientFromString(client string) Client

ClientFromString identifies a consensus client from a string identifier. It performs a case-insensitive search for known client names within the input string. Returns ClientUnknown if no known client is identified.

type DutiesService

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

func NewDutiesService

func NewDutiesService(log logrus.FieldLogger, sbeacon beacon.Node, metadata *MetadataService, proposerDutiesEnabled, beaconCommitteesEnabled bool) DutiesService

func (*DutiesService) GetAttestationDuties

func (m *DutiesService) GetAttestationDuties(epoch phase0.Epoch) ([]*v1.BeaconCommittee, error)

func (*DutiesService) GetLastCommitteeIndex

func (m *DutiesService) GetLastCommitteeIndex(ctx context.Context, slot phase0.Slot) (*phase0.CommitteeIndex, error)

func (*DutiesService) GetProposerDuties

func (m *DutiesService) GetProposerDuties(epoch phase0.Epoch) ([]*v1.ProposerDuty, error)

func (*DutiesService) GetValidatorIndex

func (m *DutiesService) GetValidatorIndex(epoch phase0.Epoch, slot phase0.Slot, committeeIndex phase0.CommitteeIndex, position uint64) (phase0.ValidatorIndex, error)

func (*DutiesService) Name

func (m *DutiesService) Name() Name

func (*DutiesService) NiceToHaveEpochDuties

func (m *DutiesService) NiceToHaveEpochDuties(ctx context.Context) []phase0.Epoch

func (*DutiesService) OnBeaconCommittee

func (m *DutiesService) OnBeaconCommittee(fn func(phase0.Epoch, []*v1.BeaconCommittee) error)

func (*DutiesService) OnProposerDuties

func (m *DutiesService) OnProposerDuties(fn func(phase0.Epoch, []*v1.ProposerDuty) error)

func (*DutiesService) OnReady

func (m *DutiesService) OnReady(ctx context.Context, fn func(context.Context) error)

func (*DutiesService) Ready

func (m *DutiesService) Ready(ctx context.Context) error

func (*DutiesService) RequiredEpochDuties

func (m *DutiesService) RequiredEpochDuties(ctx context.Context) []phase0.Epoch

func (*DutiesService) Start

func (m *DutiesService) Start(ctx context.Context) error

func (*DutiesService) Stop

func (m *DutiesService) Stop(ctx context.Context) error

type MetadataService

type MetadataService struct {
	Network *networks.Network
	Genesis *v1.Genesis
	Spec    *state.Spec
	// contains filtered or unexported fields
}

func NewMetadataService

func NewMetadataService(log logrus.FieldLogger, sbeacon beacon.Node, overrideNetworkName string) MetadataService

func (*MetadataService) Client

func (m *MetadataService) Client(ctx context.Context) string

func (*MetadataService) DeriveNetwork

func (m *MetadataService) DeriveNetwork(_ context.Context) error

func (*MetadataService) DeriveNodeIdentity

func (m *MetadataService) DeriveNodeIdentity(ctx context.Context) (*types.Identity, error)

func (*MetadataService) Name

func (m *MetadataService) Name() Name

func (*MetadataService) NodeID

func (m *MetadataService) NodeID() (string, error)

func (*MetadataService) NodeIDHash

func (m *MetadataService) NodeIDHash() (string, error)

func (*MetadataService) NodeIdentity

func (m *MetadataService) NodeIdentity() (*types.Identity, error)

func (*MetadataService) NodeVersion

func (m *MetadataService) NodeVersion(_ context.Context) string

func (*MetadataService) OnReady

func (m *MetadataService) OnReady(ctx context.Context, cb func(context.Context) error)

func (*MetadataService) Ready

func (m *MetadataService) Ready(ctx context.Context) error

func (*MetadataService) RefreshAll

func (m *MetadataService) RefreshAll(ctx context.Context) error

func (*MetadataService) Start

func (m *MetadataService) Start(ctx context.Context) error

func (*MetadataService) Stop

func (m *MetadataService) Stop(ctx context.Context) error

func (*MetadataService) Wallclock

type Name

type Name string

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Ready(ctx context.Context) error
	OnReady(ctx context.Context, cb func(ctx context.Context) error)
	Name() Name
}

Jump to

Keyboard shortcuts

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