consensus

package
v0.3.127 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGossipConsensus added in v0.3.113

func NewGossipConsensus(
	ctx context.Context,
	broadcaster ConsensusBroadcaster,
	interruptChan chan os.Signal,
	validators ...ValidatorFunc,
) *gossipConsensus

func NewRaft added in v0.3.113

func NewRaft(
	ctx context.Context,
	store raft.StableStorer,
	isInitiator bool,
	node warpnet.P2PNode,
	addrInfos []warpnet.WarpAddrInfo,
	validators ...raft.ConsensusValidatorFunc,
) (_ *raftNode, err error)

Types

type ConsensusBroadcaster added in v0.3.113

type ConsensusBroadcaster interface {
	PublishValidationRequest(msg event.Message) (err error)
	GetConsensusTopicSubscribers() []warpnet.WarpAddrInfo
	SubscribeConsensusTopic() error
	OwnerID() string
}

type ConsensusHandler added in v0.3.113

type ConsensusHandler func(message *event.Message)

type ConsensusStreamer added in v0.3.113

type ConsensusStreamer interface {
	GenericStream(nodeId string, path stream.WarpRoute, data any) (_ []byte, err error)
	NodeInfo() warpnet.NodeInfo
	Peerstore() warpnet.WarpPeerstore
}

type ValidatorFunc added in v0.3.113

type ValidatorFunc func(data event.ValidationEvent) error

Jump to

Keyboard shortcuts

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