slot_ticker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlotTicker

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

SlotTicker is a special ticker for the beacon chain block. The channel emits over the slot interval, and ensures that the ticks are in line with the genesis time. This means that the duration between the ticks and the genesis time are always a multiple of the slot duration. In addition, the channel returns the new slot number.

func NewSlotTicker

func NewSlotTicker(genesisTime time.Time, secondsPerSlot uint64) *SlotTicker

NewSlotTicker starts and returns a new SlotTicker instance.

func (*SlotTicker) C

func (s *SlotTicker) C() <-chan phase0.Slot

C returns the ticker channel. Call Cancel afterwards to ensure that the goroutine exits cleanly.

func (*SlotTicker) Done

func (s *SlotTicker) Done()

Done should be called to clean up the ticker.

type TTicker

type TTicker interface {
	C() <-chan phase0.Slot
	Done()
}

The TTicker interface defines a type which can expose a receive-only channel firing slot events.

type Ticker

type Ticker interface {
	// Start ticker process
	Start()
	// Subscribe to ticker chan
	Subscribe(subscription chan phase0.Slot) event.Subscription
}

func NewTicker

func NewTicker(ctx context.Context, logger *zap.Logger, ethNetwork beaconprotocol.Network, genesisEpoch phase0.Epoch) Ticker

NewTicker returns Ticker struct pointer

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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