consensus

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: GPL-2.0, GPL-3.0 Imports: 30 Imported by: 0

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