wallclock

package
v0.0.0-...-cd2fe80 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoDataSource indicates no data source is available
	ErrNoDataSource = errors.New("no data source available")
	// ErrNetworkNotFound indicates the network was not found
	ErrNetworkNotFound = errors.New("network not found")
	// ErrGenesisNotAvailable indicates genesis data is not available
	ErrGenesisNotAvailable = errors.New("genesis config not available")
)

Functions

This section is empty.

Types

type Network

type Network struct {
	Name string
	// contains filtered or unexported fields
}

Network represents a single network's wallclock

func (*Network) GetWallclock

func (n *Network) GetWallclock() *ethwallclock.EthereumBeaconChain

GetWallclock returns the network's wallclock

type NetworkConfig

type NetworkConfig struct {
	Name           string
	GenesisTime    *string // Optional: RFC3339 time string override
	SecondsPerSlot *uint64 // Optional: defaults to 12
}

NetworkConfig represents wallclock configuration for a network

type NetworkDataProvider

type NetworkDataProvider interface {
	GetNetworkGenesis(networkName string) (time.Time, error)
}

NetworkDataProvider provides network data from external sources

type Service

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

Service manages wallclock instances for multiple networks

func New

func New(log logrus.FieldLogger, networkConfigs map[string]*NetworkConfig, dataProvider NetworkDataProvider, metricsSvc *metrics.Metrics) *Service

New creates a new wallclock service

func (*Service) GetNetwork

func (s *Service) GetNetwork(name string) *Network

GetNetwork returns the wallclock for a specific network

func (*Service) GetWallclock

func (s *Service) GetWallclock(networkName string) *ethwallclock.EthereumBeaconChain

GetWallclock returns the wallclock for a specific network

func (*Service) Name

func (s *Service) Name() string

Name returns the service name

func (*Service) Networks

func (s *Service) Networks() []*Network

Networks returns all networks

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start initializes wallclock instances for all enabled networks

func (*Service) Stop

func (s *Service) Stop() error

Stop stops all wallclock instances

Jump to

Keyboard shortcuts

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