messages

package
v0.0.0-...-8220f0d Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Hash   string
	Node   uint64
	Round  uint64
	Sender uint64
	View   uint32
}

Commit represents a commit message sent between nodes in a consensus round

func (Commit) Kind

func (c Commit) Kind() MessageKind

Kind is CommitMsg

func (Commit) NodeRound

func (c Commit) NodeRound() (uint64, uint64)

NodeRound returns the node and round that this message came from. Messages may come from any node participating in consensus.

func (Commit) Pre

func (c Commit) Pre() PrePrepare

Pre formats a PrePrepare message out of this commit message. TODO: Dave check this with George: I suspect this is used in the protocol when a given node has committed to deliver but no consensus has been reached. The Commit is turned into a PrePrepare and re-used.

func (Commit) String

func (c Commit) String() string

type Message

type Message interface {
	Kind() MessageKind
	NodeRound() (uint64, uint64)
	String() string
}

Message defines an interface for all the other messages to follow

type MessageKind

type MessageKind uint8

MessageKind is an integer identifier for message types.

const (
	UnknownMsg MessageKind = iota
	PrePrepareMsg
	PrepareMsg
	CommitMsg
	ViewChangedMsg
	NewViewMsg
)

func (MessageKind) String

func (m MessageKind) String() string

type NewView

type NewView struct {
	Hash   string
	Node   uint64
	Round  uint64
	Sender uint64
	View   uint32
}

NewView represents a new view message sent between nodes in a consensus round

func (NewView) Kind

func (n NewView) Kind() MessageKind

Kind is NewViewMsg

func (NewView) NodeRound

func (n NewView) NodeRound() (uint64, uint64)

NodeRound returns the node and round that this message came from. Messages may come from any node participating in consensus.

func (NewView) String

func (n NewView) String() string

type PrePrepare

type PrePrepare struct {
	Hash  string
	Node  uint64
	Round uint64
	View  uint32
}

PrePrepare represents a pre-prepare message sent between nodes in a consensus round

func (PrePrepare) Kind

func (p PrePrepare) Kind() MessageKind

Kind is PrePrepareMsg

func (PrePrepare) NodeRound

func (p PrePrepare) NodeRound() (uint64, uint64)

NodeRound returns the node and round that this message came from. Messages may come from any node participating in consensus.

func (PrePrepare) String

func (p PrePrepare) String() string

type Prepare

type Prepare struct {
	Hash   string
	Node   uint64
	Round  uint64
	Sender uint64
	View   uint32
}

Prepare represents a prepare message sent between nodes in a consensus round

func (Prepare) Kind

func (p Prepare) Kind() MessageKind

Kind is PrepareMsg

func (Prepare) NodeRound

func (p Prepare) NodeRound() (uint64, uint64)

NodeRound returns the node and round that this message came from. Messages may come from any node participating in consensus.

func (Prepare) Pre

func (p Prepare) Pre() PrePrepare

Pre formats a PrePrepare message out of this Prepare message. TODO: Dave check this with George: I suspect this is used in the protocol when a given node has committed to deliver but no consensus has been reached. The Commit is turned into a PrePrepare and re-used.

func (Prepare) String

func (p Prepare) String() string

type ViewChange

type ViewChange struct {
	Hash   string
	Node   uint64
	Round  uint64
	Sender uint64
	View   uint32
}

ViewChange represents a view-change message sent between nodes in a consensus round

func (ViewChange) Kind

func (v ViewChange) Kind() MessageKind

Kind is ViewChangedMsg

func (ViewChange) NodeRound

func (v ViewChange) NodeRound() (uint64, uint64)

NodeRound returns the node and round that this message came from. Messages may come from any node participating in consensus.

func (ViewChange) String

func (v ViewChange) String() string

Jump to

Keyboard shortcuts

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