sim

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 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

	HandleEndorse(*iproto.EndorsePb, chan bool) error
	HandleBlockPropose(*iproto.ProposePb, 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