consensus

package
v1.4.3-beta3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalUncheckedBlockNum atomic.Uint64

Functions

func IsAckSignValidate

func IsAckSignValidate(va *protos.ConfirmAckBlock) bool

Types

type BlockSource added in v1.2.3

type BlockSource struct {
	Block     *types.StateBlock
	BlockFrom types.SynchronizedKind
	Type      MsgType
	Para      interface{}
}

type Consensus added in v1.2.3

type Consensus struct {
	// contains filtered or unexported fields
}

func NewConsensus added in v1.2.3

func NewConsensus(ca ConsensusAlgorithm, cfgFile string) *Consensus

func (*Consensus) Init added in v1.2.3

func (c *Consensus) Init()

func (*Consensus) RPC added in v1.4.0

func (c *Consensus) RPC(kind uint, in, out interface{})

func (*Consensus) Start added in v1.2.3

func (c *Consensus) Start()

func (*Consensus) Stop added in v1.2.3

func (c *Consensus) Stop()

type ConsensusAlgorithm added in v1.2.3

type ConsensusAlgorithm interface {
	Init()
	Start()
	Stop()
	ProcessMsg(bs *BlockSource)
	RPC(kind uint, in, out interface{})
}

type MsgType added in v1.2.3

type MsgType byte
const (
	MsgPublishReq MsgType = iota
	MsgConfirmReq
	MsgConfirmAck
	MsgSync
	MsgGenerateBlock
)

type Receiver added in v1.2.3

type Receiver struct {
	// contains filtered or unexported fields
}

func NewReceiver added in v1.2.3

func NewReceiver(eb event.EventBus) *Receiver

func (*Receiver) ReceiveConfirmAck added in v1.2.3

func (r *Receiver) ReceiveConfirmAck(ack *protos.ConfirmAckBlock, msgFrom string)

func (*Receiver) ReceiveConfirmReq added in v1.2.3

func (r *Receiver) ReceiveConfirmReq(blk []*types.StateBlock, msgFrom string)

func (*Receiver) ReceiveGenerateBlock added in v1.2.3

func (r *Receiver) ReceiveGenerateBlock(blk *types.StateBlock)

func (*Receiver) ReceivePublish added in v1.2.3

func (r *Receiver) ReceivePublish(blk *types.StateBlock, msgFrom string)

func (*Receiver) ReceiveSyncBlock added in v1.2.3

func (r *Receiver) ReceiveSyncBlock(blocks types.StateBlockList)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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