streamlet

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: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Streamlet

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

func NewStreamlet

func NewStreamlet(
	node node.Node,
	pm *pacemaker.Pacemaker,
	elec election.Election,
	committedBlocks chan *blockchain.Block,
	forkedBlocks chan *blockchain.Block) *Streamlet

NewStreamlet creates a new Streamlet instance

func (*Streamlet) GetChainStatus

func (sl *Streamlet) GetChainStatus() string

func (*Streamlet) GetNotarizedHeight

func (sl *Streamlet) GetNotarizedHeight() int

func (*Streamlet) MakeProposal

func (sl *Streamlet) MakeProposal(view types.View, payload []*message.Transaction) *blockchain.Block

func (*Streamlet) ProcessBlock

func (sl *Streamlet) ProcessBlock(block *blockchain.Block) error

ProcessBlock processes an incoming block as follows: 1. check if the view of the block matches current view (ignore for now) 2. check if the view of the block matches the proposer's view (ignore for now) 3. insert the block into the block tree 4. if the view of the block is lower than the current view, don't vote 5. if the block is extending the longest notarized chain, vote for the block 6. if the view of the block is higher than the the current view, buffer the block and process it when entering that view

func (*Streamlet) ProcessLocalTmo

func (sl *Streamlet) ProcessLocalTmo(view types.View)

func (*Streamlet) ProcessRemoteTmo

func (sl *Streamlet) ProcessRemoteTmo(tmo *pacemaker.TMO)

func (*Streamlet) ProcessVote

func (sl *Streamlet) ProcessVote(vote *blockchain.Vote)

Jump to

Keyboard shortcuts

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