csbftnode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0 Imports: 13 Imported by: 0

README

csbftnode

Complete other functions in PBFT other than status maintenance

  1. The block is quickly propagated to other nodes after receiving a new block to be verified. First pass hash to confirm that there is no block in the other party's block pool and then pass the block to the other party.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsBft

type CsBft struct {
	*state_machine.BftConfig
	// contains filtered or unexported fields
}

func NewCsBft

func NewCsBft(config *state_machine.BftConfig) *CsBft

new bft node

func (*CsBft) AddPeer

func (bft *CsBft) AddPeer(p chain_communication.PmAbstractPeer) error

func (*CsBft) ChangePrimary

func (bft *CsBft) ChangePrimary(primary string)

func (*CsBft) OnEnterNewHeight

func (bft *CsBft) OnEnterNewHeight(h uint64)

when new block insert to chain, call here notify state change

func (*CsBft) OnNewMsg

func (bft *CsBft) OnNewMsg(msg interface{}) error

func (*CsBft) OnNewP2PMsg

func (bft *CsBft) OnNewP2PMsg(msg p2p.Msg, p chain_communication.PmAbstractPeer) error

The processing here can't be blocked, it must be quickly put into a coroutine and returned after processing, otherwise msg read will be blocked.

func (*CsBft) OnNewWaitVerifyBlock

func (bft *CsBft) OnNewWaitVerifyBlock(block model.AbstractBlock, id string)

func (*CsBft) SetFetcher

func (bft *CsBft) SetFetcher(fetcher *components.CsBftFetcher)

func (*CsBft) Start

func (bft *CsBft) Start() error

func (*CsBft) Stop

func (bft *CsBft) Stop()

Jump to

Keyboard shortcuts

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