leaderschedule

package
v0.0.0-...-3423c7d Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

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

func (*Tracker) FirstSlot

func (t *Tracker) FirstSlot(slotInEpoch uint64) (uint64, uint64)

FirstSlot returns the epoch number and first slot of the epoch.

func (*Tracker) Get

func (t *Tracker) Get(slot uint64) solana.PublicKey

Get returns the scheduled leader for the given slot. It blocks until the leader schedule is available.

func (*Tracker) Run

func (t *Tracker) Run(ctx context.Context, nodes []*envv1.RPCNode)

Run periodically updates the leader schedule. When the current slot + prefetchSlots is greater than the highest slot in the schedule, the schedule is updated.

A random node is picked from nodes to do the request against.

func (*Tracker) TryGet

func (t *Tracker) TryGet(slot uint64) (solana.PublicKey, bool)

TryGet returns the scheduled leader for the given slot. It returns false if the leader schedule is not yet available.

func (*Tracker) Update

func (t *Tracker) Update(slot uint64)

Update updates the current highest slot. Non-blocking.

Jump to

Keyboard shortcuts

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