Documentation
¶
Index ¶
- Variables
- func BlockFromEntries(slot uint64, parentSlot uint64, entries []Entry) *block.Block
- type Entry
- type LeaderForSlotFunc
- type ReceiverStats
- type RepairPeerSource
- type RepairStats
- type Shred
- type ShredType
- type SlotAssembler
- func (a *SlotAssembler) ActiveSlots() int
- func (a *SlotAssembler) AddPacket(packet []byte) (*block.Block, error)
- func (a *SlotAssembler) AddShred(shred *Shred) (*block.Block, error)
- func (a *SlotAssembler) CompleteSlot(slot uint64) (*block.Block, error)
- func (a *SlotAssembler) EvictedSlots() uint64
- func (a *SlotAssembler) IgnoredOldShreds() uint64
- func (a *SlotAssembler) RecoveredDataShreds() uint64
- func (a *SlotAssembler) RepairRequests(maxSlots int, maxMissingPerSlot int) []SlotRepairRequest
- type SlotRepairRequest
- type UDPReceiver
- func (r *UDPReceiver) Blocks() <-chan *block.Block
- func (r *UDPReceiver) Errors() <-chan error
- func (r *UDPReceiver) Ready() <-chan error
- func (r *UDPReceiver) Run(ctx context.Context) error
- func (r *UDPReceiver) SetLeaderForSlot(fn LeaderForSlotFunc)
- func (r *UDPReceiver) SetRepairPeerSource(identity ed25519.PrivateKey, source func() []gossip.RepairPeer) error
- func (r *UDPReceiver) Stats() ReceiverStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateShred = errors.New("duplicate data shred") ErrSlotIncomplete = errors.New("slot incomplete") ErrSlotOverflow = errors.New("slot has too many data shreds") )
View Source
var ( ErrShortShred = errors.New("short shred packet") ErrUnsupportedShred = errors.New("unsupported shred variant") ErrInvalidDataShred = errors.New("invalid data shred") ErrCodingShredIgnored = errors.New("coding shred ignored") ErrInvalidSignature = errors.New("invalid shred signature") )
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
NumHashes uint64
Hash solana.Hash
Txns []solana.Transaction
}
type ReceiverStats ¶
type ReceiverStats struct {
Packets uint64
DataShreds uint64
CodingShreds uint64
ParseErrors uint64
SignatureErrors uint64
MissingLeaders uint64
AssemblyErrors uint64
BlocksEmitted uint64
RecoveredData uint64
EvictedSlots uint64
IgnoredOldShreds uint64
Repair RepairStats
LastPacketUnix int64
LastDataSlot uint64
LastBlockSlot uint64
ActiveSlots int
}
type RepairPeerSource ¶
type RepairPeerSource func() []gossip.RepairPeer
type RepairStats ¶
type Shred ¶
type Shred struct {
Signature solana.Signature
Variant byte
Type ShredType
Slot uint64
Index uint32
Version uint16
FECSetIndex uint32
ParentOffset uint16
Flags byte
Data []byte
Payload []byte
NumDataShreds uint16
NumCodingShreds uint16
Position uint16
Recovered bool
}
func ParseShred ¶
func (*Shred) DataComplete ¶
func (*Shred) LastInSlot ¶
func (*Shred) ParentSlot ¶
func (*Shred) ReferenceTick ¶
type SlotAssembler ¶
type SlotAssembler struct {
// contains filtered or unexported fields
}
func NewSlotAssembler ¶
func NewSlotAssembler() *SlotAssembler
func (*SlotAssembler) ActiveSlots ¶
func (a *SlotAssembler) ActiveSlots() int
func (*SlotAssembler) AddPacket ¶
func (a *SlotAssembler) AddPacket(packet []byte) (*block.Block, error)
func (*SlotAssembler) AddShred ¶
func (a *SlotAssembler) AddShred(shred *Shred) (*block.Block, error)
func (*SlotAssembler) CompleteSlot ¶
func (a *SlotAssembler) CompleteSlot(slot uint64) (*block.Block, error)
func (*SlotAssembler) EvictedSlots ¶
func (a *SlotAssembler) EvictedSlots() uint64
func (*SlotAssembler) IgnoredOldShreds ¶
func (a *SlotAssembler) IgnoredOldShreds() uint64
func (*SlotAssembler) RecoveredDataShreds ¶
func (a *SlotAssembler) RecoveredDataShreds() uint64
func (*SlotAssembler) RepairRequests ¶
func (a *SlotAssembler) RepairRequests(maxSlots int, maxMissingPerSlot int) []SlotRepairRequest
type SlotRepairRequest ¶
type UDPReceiver ¶
type UDPReceiver struct {
Addr string
// contains filtered or unexported fields
}
func NewUDPReceiver ¶
func NewUDPReceiver(addr string) *UDPReceiver
func (*UDPReceiver) Blocks ¶
func (r *UDPReceiver) Blocks() <-chan *block.Block
func (*UDPReceiver) Errors ¶
func (r *UDPReceiver) Errors() <-chan error
func (*UDPReceiver) Ready ¶
func (r *UDPReceiver) Ready() <-chan error
func (*UDPReceiver) SetLeaderForSlot ¶
func (r *UDPReceiver) SetLeaderForSlot(fn LeaderForSlotFunc)
func (*UDPReceiver) SetRepairPeerSource ¶
func (r *UDPReceiver) SetRepairPeerSource(identity ed25519.PrivateKey, source func() []gossip.RepairPeer) error
func (*UDPReceiver) Stats ¶
func (r *UDPReceiver) Stats() ReceiverStats
Click to show internal directories.
Click to hide internal directories.