sim

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineMsg

func CombineMsg(msgType uint32, msgBody []byte) proto.Message

CombineMsg combines a msgType and msgBody into a single proto.Message

func SeparateMsg

func SeparateMsg(m proto.Message) (uint32, []byte)

SeparateMsg separates a proto.Message into its msgType and msgBody

Types

type Sim

type Sim interface {
	lifecycle.StartStopper

	HandleViewChange(proto.Message, chan bool) error
	HandleBlockPropose(proto.Message, chan bool) error
	SetStream(*pbsim.Simulator_PingServer)
	SetDoneStream(chan bool)
	SendUnsent()
}

Sim is the interface for handling IotxConsensus view change used in the simulator

func NewSim

func NewSim(
	cfg *config.Config,
	bc blockchain.Blockchain,
	ap actpool.ActPool,
	p2p network.Overlay,
) Sim

NewSim creates a consensus_sim struct

func NewSimByzantine

func NewSimByzantine(
	cfg *config.Config,
	bc blockchain.Blockchain,
	ap actpool.ActPool,
	p2p network.Overlay,
) Sim

NewSimByzantine creates a byzantine consensus_sim struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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