consensus

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consensus

type Consensus interface {
	// Start the consensus service.
	Start() error

	// Stop means frees the resources which were allocated for this service.
	Stop()

	// Prepare means send transaction to the consensus engine
	Prepare(tx *types.Transaction) error

	// Commit recv blocks form Consensus and commit it by consensus
	Commit() chan *common.CommitEvent

	// Step send msg to the consensus engine
	Step(msg []byte) error

	// Ready means whether consensus has finished electing leader
	Ready() error

	// ReportState means block was persisted and report it to the consensus engine
	ReportState(height uint64, blockHash *types.Hash, txHashList []*events.TxPointer, stateUpdatedCheckpoint *consensus.Checkpoint, needRemoveTxs bool)

	// Quorum means minimum number of nodes in the cluster that can work
	Quorum() uint64

	// GetLowWatermark will return the low watermark of consensus engine
	GetLowWatermark() uint64

	SubscribeTxEvent(events chan<- []*types.Transaction) event.Subscription

	SubscribeMockBlockEvent(ch chan<- events.ExecutedEvent) event.Subscription
}

func New

func New(consensusType string, opts ...common.Option) (Consensus, error)

Directories

Path Synopsis
mock_precheck
Package mock_precheck is a generated GoMock package.
Package mock_precheck is a generated GoMock package.

Jump to

Keyboard shortcuts

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