consensus

package
v0.2.412 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: GPL-2.0, GPL-3.0 Imports: 30 Imported by: ? modules, 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

View Source
const ErrConsensusRejection = warpnet.WarpError("consensus: quorum rejected your node. Try to delete database and update app version")
View Source
const (
	ErrNoRaftCluster = warpnet.WarpError("consensus: no cluster found")
)

Variables

This section is empty.

Functions

func NewBootstrapRaft

func NewBootstrapRaft(ctx context.Context, isInMemory bool, validators ...ConsensusValidatorFunc) (_ *consensusService, err error)

func NewMemberRaft

func NewMemberRaft(
	ctx context.Context,
	consRepo ConsensusStorer,
	validators ...ConsensusValidatorFunc,
) (_ *consensusService, err error)

func NewWarpnetConsensusTransport

func NewWarpnetConsensusTransport(node NodeTransporter, l *consensusLogger) (*raft.NetworkTransport, error)

Types

type Consensus

type Consensus = libp2praft.Consensus

type ConsensusStorer

type ConsensusStorer interface {
	raft.StableStore
	Reset() error
	SnapshotsPath() string
}

type ConsensusValidatorFunc

type ConsensusValidatorFunc func(k, v string) error

type KVState

type KVState map[string]string

type NodeTransporter

type NodeTransporter interface {
	Node() warpnet.P2PNode
	NodeInfo() warpnet.NodeInfo
	Network() warpnet.WarpNetwork
	GenericStream(nodeId string, path stream.WarpRoute, data any) (_ []byte, err error)
}

type State

type State = consensus.State

Jump to

Keyboard shortcuts

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