Documentation
¶
Index ¶
- type DefaultEpochCreator
- type DefaultSlotCreator
- type Epoch
- type EthereumBeaconChain
- func (e *EthereumBeaconChain) Epochs() *DefaultEpochCreator
- func (e *EthereumBeaconChain) FromTime(t time.Time) (Slot, Epoch, error)
- func (e *EthereumBeaconChain) Now() (Slot, Epoch, error)
- func (e *EthereumBeaconChain) OnEpochChanged(callback func(current Epoch))
- func (e *EthereumBeaconChain) OnSlotChanged(callback func(current Slot))
- func (e *EthereumBeaconChain) Slots() *DefaultSlotCreator
- func (e *EthereumBeaconChain) Stop()
- type Option
- type Slot
- type TimeWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultEpochCreator ¶
type DefaultEpochCreator struct {
// contains filtered or unexported fields
}
func NewDefaultEpochCreator ¶
func (*DefaultEpochCreator) Current ¶
func (e *DefaultEpochCreator) Current() Epoch
func (*DefaultEpochCreator) FromNumber ¶
func (e *DefaultEpochCreator) FromNumber(number uint64) Epoch
func (*DefaultEpochCreator) FromSlot ¶
func (e *DefaultEpochCreator) FromSlot(slot uint64) Epoch
type DefaultSlotCreator ¶
type DefaultSlotCreator struct {
// contains filtered or unexported fields
}
func NewDefaultSlotCreator ¶
func NewDefaultSlotCreator(genesis time.Time, durationPerSlot time.Duration) *DefaultSlotCreator
func (*DefaultSlotCreator) Current ¶
func (s *DefaultSlotCreator) Current() Slot
func (*DefaultSlotCreator) DurationAt ¶
func (s *DefaultSlotCreator) DurationAt(number uint64) time.Duration
DurationAt returns the duration of the given slot.
func (*DefaultSlotCreator) FromNumber ¶
func (s *DefaultSlotCreator) FromNumber(number uint64) Slot
type Epoch ¶
type Epoch struct {
// contains filtered or unexported fields
}
func (*Epoch) TimeWindow ¶
func (e *Epoch) TimeWindow() *TimeWindow
type EthereumBeaconChain ¶
type EthereumBeaconChain struct {
// contains filtered or unexported fields
}
func NewEthereumBeaconChain ¶
func (*EthereumBeaconChain) Epochs ¶
func (e *EthereumBeaconChain) Epochs() *DefaultEpochCreator
func (*EthereumBeaconChain) OnEpochChanged ¶
func (e *EthereumBeaconChain) OnEpochChanged(callback func(current Epoch))
func (*EthereumBeaconChain) OnSlotChanged ¶
func (e *EthereumBeaconChain) OnSlotChanged(callback func(current Slot))
func (*EthereumBeaconChain) Slots ¶
func (e *EthereumBeaconChain) Slots() *DefaultSlotCreator
func (*EthereumBeaconChain) Stop ¶
func (e *EthereumBeaconChain) Stop()
type Option ¶
type Option func(*config)
Option configures a wall clock.
func WithHezeSlotDuration ¶
WithHezeSlotDuration switches the slot duration to SLOT_DURATION_MS_HEZE from HEZE_FORK_EPOCH onwards. A zero duration or an unreachable epoch (FAR_FUTURE_EPOCH) leaves the slot duration unchanged.
type Slot ¶
type Slot struct {
// contains filtered or unexported fields
}
func (*Slot) TimeWindow ¶
func (s *Slot) TimeWindow() *TimeWindow
type TimeWindow ¶
type TimeWindow struct {
// contains filtered or unexported fields
}
func NewTimeWindow ¶
func NewTimeWindow(start, end time.Time) *TimeWindow
func (*TimeWindow) Active ¶
func (t *TimeWindow) Active() bool
func (*TimeWindow) End ¶
func (t *TimeWindow) End() time.Time
func (*TimeWindow) EndsIn ¶
func (t *TimeWindow) EndsIn() time.Duration
func (*TimeWindow) Start ¶
func (t *TimeWindow) Start() time.Time
func (*TimeWindow) StartsIn ¶
func (t *TimeWindow) StartsIn() time.Duration
Click to show internal directories.
Click to hide internal directories.