warpsync

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) {
	return &Events{
		SlotCommitmentReceived: event.New1[*SlotCommitmentReceivedEvent](),
	}
})

NewEvents contains the constructor of the Events object (it is generated by a generic factory).

Functions

This section is empty.

Types

type Events

type Events struct {
	// Fired when a new block was received via the gossip protocol.
	SlotCommitmentReceived    *event.Event1[*SlotCommitmentReceivedEvent]
	SlotBlocksRequestReceived *event.Event1[*SlotBlocksRequestReceivedEvent]
	SlotBlocksStart           *event.Event1[*SlotBlocksStartEvent]
	SlotBlock                 *event.Event1[*SlotBlockEvent]
	SlotBlocksEnd             *event.Event1[*SlotBlocksEndEvent]

	event.Group[Events, *Events]
}

Events defines all the events related to the gossip protocol.

type Protocol

type Protocol struct {
	Events *Events
	// contains filtered or unexported fields
}

func New

func New(workerPool *workerpool.WorkerPool, networkEndpoint network.Endpoint, log *logger.Logger) (protocol *Protocol)

func (*Protocol) RequestSlotBlocks

func (p *Protocol) RequestSlotBlocks(index slot.Index, sc commitment.ID, to ...identity.ID)

func (*Protocol) SendBlocksBatch

func (p *Protocol) SendBlocksBatch(index slot.Index, sc commitment.ID, blocks []*models.Block, to ...identity.ID)

func (*Protocol) SendSlotEnd

func (p *Protocol) SendSlotEnd(index slot.Index, sc commitment.ID, roots *commitment.Roots, to ...identity.ID)

func (*Protocol) SendSlotStarter

func (p *Protocol) SendSlotStarter(index slot.Index, sc commitment.ID, blocksCount int, to ...identity.ID)

func (*Protocol) Stop

func (p *Protocol) Stop()

type SlotBlockEvent

type SlotBlockEvent struct {
	ID    identity.ID
	SI    slot.Index
	Block *models.Block
}

SlotBlockEvent holds data about a slot block event.

type SlotBlocksEndEvent

type SlotBlocksEndEvent struct {
	ID    identity.ID
	SI    slot.Index
	SC    commitment.ID
	Roots *commitment.Roots
}

SlotBlocksEndEvent holds data about a slot blocks end event.

type SlotBlocksRequestReceivedEvent

type SlotBlocksRequestReceivedEvent struct {
	ID identity.ID
	SI slot.Index
	SC commitment.ID
}

SlotBlocksRequestReceivedEvent holds data about a slot blocks request received event.

type SlotBlocksStartEvent

type SlotBlocksStartEvent struct {
	ID identity.ID
	SI slot.Index
}

SlotBlocksStartEvent holds data about a slot blocks start event.

type SlotCommitmentReceivedEvent

type SlotCommitmentReceivedEvent struct {
	ID       identity.ID
	SCRecord *commitment.Commitment
}

SlotCommitmentReceivedEvent holds data about a slot commitment received event.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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