standard

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

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

Parameter is the interface for service parameters.

func WithGenesisTimeProvider

func WithGenesisTimeProvider(provider eth2client.GenesisTimeProvider) Parameter

WithGenesisTimeProvider sets the genesis time provider.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithSpecProvider

func WithSpecProvider(provider eth2client.SpecProvider) Parameter

WithSpecProvider sets the spec provider.

type Service

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

Service provides chain time services.

func New

func New(ctx context.Context, params ...Parameter) (*Service, error)

New creates a new controller.

func (*Service) AltairInitialEpoch

func (s *Service) AltairInitialEpoch() phase0.Epoch

AltairInitialEpoch provides the epoch at which the Altair hard fork takes place.

func (*Service) AltairInitialSyncCommitteePeriod

func (s *Service) AltairInitialSyncCommitteePeriod() uint64

AltairInitialSyncCommitteePeriod provides the sync committee period in which the Altair hard fork takes place.

func (*Service) BellatrixInitialEpoch

func (s *Service) BellatrixInitialEpoch() phase0.Epoch

BellatrixInitialEpoch provides the epoch at which the Bellatrix hard fork takes place.

func (*Service) CapellaInitialEpoch

func (s *Service) CapellaInitialEpoch() phase0.Epoch

CapellaInitialEpoch provides the epoch at which the Capella hard fork takes place.

func (*Service) CurrentEpoch

func (s *Service) CurrentEpoch() phase0.Epoch

CurrentEpoch provides the current epoch.

func (*Service) CurrentSlot

func (s *Service) CurrentSlot() phase0.Slot

CurrentSlot provides the current slot.

func (*Service) CurrentSyncCommitteePeriod

func (s *Service) CurrentSyncCommitteePeriod() uint64

CurrentSyncCommitteePeriod provides the current sync committee period.

func (*Service) FirstEpochOfSyncPeriod

func (s *Service) FirstEpochOfSyncPeriod(period uint64) phase0.Epoch

FirstEpochOfSyncPeriod provides the first epoch of the given sync period. Note that epochs before the sync committee period will provide the Altair hard fork epoch.

func (*Service) FirstSlotOfEpoch

func (s *Service) FirstSlotOfEpoch(epoch phase0.Epoch) phase0.Slot

FirstSlotOfEpoch provides the first slot of the given epoch.

func (*Service) GenesisTime

func (s *Service) GenesisTime() time.Time

GenesisTime provides the time of the chain's genesis.

func (*Service) SlotDuration

func (s *Service) SlotDuration() time.Duration

SlotDuration provides the duration of the chain's slot.

func (*Service) SlotToEpoch

func (s *Service) SlotToEpoch(slot phase0.Slot) phase0.Epoch

SlotToEpoch provides the epoch of a given slot.

func (*Service) SlotToSyncCommitteePeriod

func (s *Service) SlotToSyncCommitteePeriod(slot phase0.Slot) uint64

SlotToSyncCommitteePeriod provides the sync committee period of the given slot.

func (*Service) SlotsPerEpoch

func (s *Service) SlotsPerEpoch() uint64

SlotsPerEpoch provides the number of slots in the chain's epoch.

func (*Service) StartOfEpoch

func (s *Service) StartOfEpoch(epoch phase0.Epoch) time.Time

StartOfEpoch provides the time at which a given epoch starts.

func (*Service) StartOfSlot

func (s *Service) StartOfSlot(slot phase0.Slot) time.Time

StartOfSlot provides the time at which a given slot starts.

func (*Service) TimestampToEpoch

func (s *Service) TimestampToEpoch(timestamp time.Time) phase0.Epoch

TimestampToEpoch provides the epoch of the given timestamp.

func (*Service) TimestampToSlot

func (s *Service) TimestampToSlot(timestamp time.Time) phase0.Slot

TimestampToSlot provides the slot of the given timestamp.

Jump to

Keyboard shortcuts

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