p2p

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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,
	logger log.Logger,
	builder *builder.Builder,
	proposalStore *proposal.ProposalStore[starknet.Hash],
	currentHeight types.Height,
	bufferSizeConfig *config.BufferSizes,
	bootstrapPeersFn func() []peer.AddrInfo,
	compiler compiler.Compiler,
) 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