replica

package
v0.0.0-...-2e52d37 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replica

type Replica struct {
	node.Node
	Safety
	election.Election
	// contains filtered or unexported fields
}

func NewReplica

func NewReplica(id identity.NodeID, alg string, isByz bool) *Replica

NewReplica creates a new replica instance

func (*Replica) HandleBlock

func (r *Replica) HandleBlock(block blockchain.Block)

func (*Replica) HandleTmo

func (r *Replica) HandleTmo(tmo pacemaker.TMO)

func (*Replica) HandleVote

func (r *Replica) HandleVote(vote blockchain.Vote)

func (*Replica) ListenCommittedBlocks

func (r *Replica) ListenCommittedBlocks()

ListenCommittedBlocks listens committed blocks and forked blocks from the protocols

func (*Replica) ListenLocalEvent

func (r *Replica) ListenLocalEvent()

ListenLocalEvent listens new view and timeout events

func (*Replica) Start

func (r *Replica) Start()

Start starts event loop

type Safety

type Safety interface {
	ProcessBlock(block *blockchain.Block) error
	ProcessVote(vote *blockchain.Vote)
	ProcessRemoteTmo(tmo *pacemaker.TMO)
	ProcessLocalTmo(view types.View)
	MakeProposal(view types.View, payload []*message.Transaction) *blockchain.Block
	GetChainStatus() string
}

Jump to

Keyboard shortcuts

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