Documentation ¶
Index ¶
- func ParseEpoch(chainTime *ChainTime, epochStr string) (phase0.Epoch, error)
- type ChainTime
- func (s *ChainTime) CurrentEpoch() phase0.Epoch
- func (s *ChainTime) CurrentSlot() phase0.Slot
- func (s *ChainTime) CurrentSyncCommitteePeriod() uint64
- func (s *ChainTime) FirstSlotOfEpoch(epoch phase0.Epoch) phase0.Slot
- func (s *ChainTime) GenesisTime() time.Time
- func (s *ChainTime) LastSlotOfEpoch(epoch phase0.Epoch) phase0.Slot
- func (s *ChainTime) SlotDuration() time.Duration
- func (s *ChainTime) SlotToEpoch(slot phase0.Slot) phase0.Epoch
- func (s *ChainTime) SlotToSyncCommitteePeriod(slot phase0.Slot) uint64
- func (s *ChainTime) SlotsPerEpoch() uint64
- func (s *ChainTime) StartOfEpoch(epoch phase0.Epoch) time.Time
- func (s *ChainTime) StartOfSlot(slot phase0.Slot) time.Time
- func (s *ChainTime) TimestampToEpoch(timestamp time.Time) phase0.Epoch
- func (s *ChainTime) TimestampToSlot(timestamp time.Time) phase0.Slot
- type Parameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChainTime ¶
type ChainTime struct {
// contains filtered or unexported fields
}
ChainTime provides chain time ChainTimes.
func NewChainTime ¶
New creates a new controller.
func (*ChainTime) CurrentEpoch ¶
CurrentEpoch provides the current epoch.
func (*ChainTime) CurrentSlot ¶
CurrentSlot provides the current slot.
func (*ChainTime) CurrentSyncCommitteePeriod ¶
CurrentSyncCommitteePeriod provides the current sync committee period.
func (*ChainTime) FirstSlotOfEpoch ¶
FirstSlotOfEpoch provides the first slot of the given epoch.
func (*ChainTime) GenesisTime ¶
GenesisTime provides the time of the chain's genesis.
func (*ChainTime) LastSlotOfEpoch ¶
LastSlotOfEpoch provides the last slot of the given epoch.
func (*ChainTime) SlotDuration ¶
SlotDuration provides the duration of the chain's slot.
func (*ChainTime) SlotToEpoch ¶
SlotToEpoch provides the epoch of a given slot.
func (*ChainTime) SlotToSyncCommitteePeriod ¶
SlotToSyncCommitteePeriod provides the sync committee period of the given slot.
func (*ChainTime) SlotsPerEpoch ¶
SlotsPerEpoch provides the number of slots in the chain's epoch.
func (*ChainTime) StartOfEpoch ¶
StartOfEpoch provides the time at which a given epoch starts.
func (*ChainTime) StartOfSlot ¶
StartOfSlot provides the time at which a given slot starts.
func (*ChainTime) TimestampToEpoch ¶
TimestampToEpoch provides the epoch of the given timestamp.
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for ChainTime parameters.
func WithGenesisProvider ¶
func WithGenesisProvider(provider eth2client.GenesisProvider) Parameter
WithGenesisProvider sets the genesis time provider.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithSpecProvider ¶
func WithSpecProvider(provider eth2client.SpecProvider) Parameter
WithSpecProvider sets the spec provider.