Documentation ¶
Index ¶
- Constants
- func NewBlockProposer(config BlockProposerConfig, log protocol.Logger) (protocol.BlockProposer, error)
- type BlockProposerConfig
- type BlockProposerImpl
- func (bp *BlockProposerImpl) OnReceiveMaxBFTProposal(proposal *maxbft.BuildProposal)
- func (bp *BlockProposerImpl) OnReceiveProposeStatusChange(proposeStatus bool)
- func (bp *BlockProposerImpl) OnReceiveRwSetVerifyFailTxs(rwSetVerifyFailTxs *consensuspb.RwSetVerifyFailTxs)
- func (bp *BlockProposerImpl) OnReceiveTxPoolSignal(txPoolSignal *txpoolpb.TxPoolSignal)
- func (bp *BlockProposerImpl) OnReceiveYieldProposeSignal(isYield bool)
- func (bp *BlockProposerImpl) ProposeBlock(proposal *maxbft.BuildProposal) (*consensuspb.ProposalBlock, error)
- func (bp *BlockProposerImpl) Start() error
- func (bp *BlockProposerImpl) Stop() error
Constants ¶
View Source
const ( DEFAULTDURATION = 1000 // default proposal duration, millis seconds DEFAULTVERSION = "v1.0.0" // default version of chain )
Variables ¶
This section is empty.
Functions ¶
func NewBlockProposer ¶
func NewBlockProposer(config BlockProposerConfig, log protocol.Logger) (protocol.BlockProposer, error)
Types ¶
type BlockProposerConfig ¶
type BlockProposerConfig struct { ChainId string TxPool protocol.TxPool SnapshotManager protocol.SnapshotManager MsgBus msgbus.MessageBus Identity protocol.SigningParticipant LedgerCache protocol.LedgerCache TxScheduler protocol.TxScheduler ProposalCache protocol.ProposalCache ChainConf protocol.ChainConf AC protocol.AccessControlProvider BlockchainStore protocol.BlockchainStore StoreHelper config.StoreHelper TxFilter protocol.TxFilter }
type BlockProposerImpl ¶
type BlockProposerImpl struct {
// contains filtered or unexported fields
}
BlockProposerImpl implements BlockProposer interface. In charge of propose a new block.
func (*BlockProposerImpl) OnReceiveMaxBFTProposal ¶
func (bp *BlockProposerImpl) OnReceiveMaxBFTProposal(proposal *maxbft.BuildProposal)
OnReceiveMaxBFTProposal, to check if this proposer should propose a new block Only for maxbft consensus
func (*BlockProposerImpl) OnReceiveProposeStatusChange ¶
func (bp *BlockProposerImpl) OnReceiveProposeStatusChange(proposeStatus bool)
* OnReceiveProposeStatusChange, to update isProposer status when received proposeStatus from consensus * if node is proposer, then reset the timer, otherwise stop the timer
func (*BlockProposerImpl) OnReceiveRwSetVerifyFailTxs ¶
func (bp *BlockProposerImpl) OnReceiveRwSetVerifyFailTxs(rwSetVerifyFailTxs *consensuspb.RwSetVerifyFailTxs)
* OnReceiveRwSetVerifyFailTxs, remove verify fail txs
func (*BlockProposerImpl) OnReceiveTxPoolSignal ¶
func (bp *BlockProposerImpl) OnReceiveTxPoolSignal(txPoolSignal *txpoolpb.TxPoolSignal)
OnReceiveTxPoolSignal, receive txpool signal and deliver to chan txpool signal
func (*BlockProposerImpl) OnReceiveYieldProposeSignal ¶
func (bp *BlockProposerImpl) OnReceiveYieldProposeSignal(isYield bool)
OnReceiveYieldProposeSignal, receive yield propose signal
func (*BlockProposerImpl) ProposeBlock ¶
func (bp *BlockProposerImpl) ProposeBlock(proposal *maxbft.BuildProposal) (*consensuspb.ProposalBlock, error)
func (*BlockProposerImpl) Stop ¶
func (bp *BlockProposerImpl) Stop() error
Stop, stop proposing loop
Click to show internal directories.
Click to hide internal directories.