Thanks to visit codestin.com
Credit goes to pkg.go.dev

driver

package
v0.15.9 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitHook added in v0.15.7

type CommitHook[V types.Hashable[H], H types.Hash] interface {
	OnCommit(context.Context, types.Height, V)
}

type CommitListener added in v0.15.2

type CommitListener[V types.Hashable[H], H types.Hash] interface {
	CommitHook[V, H]
	// Listen returns a channel that will receive committed blocks.
	// This is supposed to be used by the component that writes the committed blocks to the database.
	Listen() <-chan sync.CommittedBlock
}

CommitListener is a component that is used to notify different components that a new committed block is available.

func NewCommitListener added in v0.15.2

func NewCommitListener[V types.Hashable[H], H types.Hash](
	log utils.Logger,
	proposalStore *proposal.ProposalStore[H],
	postCommitHooks ...CommitHook[V, H],
) CommitListener[V, H]

type Driver

type Driver[V types.Hashable[H], H types.Hash, A types.Addr] struct {
	// contains filtered or unexported fields
}

func New

func New[V types.Hashable[H], H types.Hash, A types.Addr](
	log utils.Logger,
	db db.TendermintDB[V, H, A],
	stateMachine tendermint.StateMachine[V, H, A],
	commitListener CommitListener[V, H],
	broadcasters p2p.Broadcasters[V, H, A],
	listeners p2p.Listeners[V, H, A],
	getTimeout TimeoutFn,
) Driver[V, H, A]

func (*Driver[V, H, A]) Run added in v0.15.0

func (d *Driver[V, H, A]) Run(ctx context.Context) error

The Driver is responsible for listening to messages from the network and passing them into the stateMachine. The stateMachine processes these messages and returns a set of actions to be executed by the Driver. The Driver executes these actions (namely broadcasting messages and triggering scheduled timeouts).

type TimeoutFn added in v0.15.2

type TimeoutFn func(step types.Step, round types.Round) time.Duration

Jump to

Keyboard shortcuts

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