p2p

package
v0.15.16 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

type Broadcaster[M any] interface {
	// Broadcast will broadcast the message to the whole validator set. The function should not be blocking.
	Broadcast(context.Context, M)
}

type Broadcasters

type Broadcasters[V types.Hashable[H], H types.Hash, A types.Addr] struct {
	ProposalBroadcaster  Broadcaster[*types.Proposal[V, H, A]]
	PrevoteBroadcaster   Broadcaster[*types.Prevote[H, A]]
	PrecommitBroadcaster Broadcaster[*types.Precommit[H, A]]
}

type Listener

type Listener[M any] interface {
	// Listen would return consensus messages to Tendermint which are set by the validator set.
	Listen() <-chan M
}

type Listeners

type Listeners[V types.Hashable[H], H types.Hash, A types.Addr] struct {
	ProposalListener  Listener[*types.Proposal[V, H, A]]
	PrevoteListener   Listener[*types.Prevote[H, A]]
	PrecommitListener Listener[*types.Precommit[H, A]]
}

type P2P added in v0.15.0

type P2P[V types.Hashable[H], H types.Hash, A types.Addr] interface {
	service.Service
	Broadcasters() Broadcasters[V, H, A]
	Listeners() Listeners[V, H, A]
	OnCommit(ctx context.Context, height types.Height, value V)
}

func New added in v0.15.0

func New(
	host host.Host,
	log utils.Logger,
	builder *builder.Builder,
	proposalStore *proposal.ProposalStore[starknet.Hash],
	currentHeight types.Height,
	bufferSizeConfig *config.BufferSizes,
	bootstrapPeersFn func() []peer.AddrInfo,
) P2P[starknet.Value, starknet.Hash, starknet.Address]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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