Versions in this module Expand all Collapse all v0 v0.6.1 Jan 21, 2020 Changes in this version + const ContextVersion + type BlockSignatures struct + Signatures []SignaturesData + func (self *BlockSignatures) ConsensusMessageData() *ConsensusMessageData + func (self *BlockSignatures) Deserialization(source *common.ZeroCopySource) error + func (self *BlockSignatures) Serialization(sink *common.ZeroCopySink) + func (self *BlockSignatures) Type() ConsensusMessageType + func (self *BlockSignatures) ViewNumber() byte + type ChangeView struct + NewViewNumber byte + func (cv *ChangeView) ConsensusMessageData() *ConsensusMessageData + func (cv *ChangeView) Deserialization(source *common.ZeroCopySource) error + func (cv *ChangeView) Serialization(sink *common.ZeroCopySink) + func (cv *ChangeView) Type() ConsensusMessageType + func (cv *ChangeView) ViewNumber() byte + type ConsensusContext struct + BookkeeperIndex int + Bookkeepers []keypair.PublicKey + ExpectedView []byte + Height uint32 + NextBookkeeper common.Address + NextBookkeepers []keypair.PublicKey + Nonce uint64 + Owner keypair.PublicKey + PrevHash common.Uint256 + PrimaryIndex uint32 + Signatures [][]byte + State ConsensusState + Timestamp uint32 + Transactions []*types.Transaction + ViewNumber byte + func NewConsensusContext() *ConsensusContext + func (ctx *ConsensusContext) ChangeView(viewNum byte) + func (ctx *ConsensusContext) GetSignaturesCount() (count int) + func (ctx *ConsensusContext) GetStateDetail() string + func (ctx *ConsensusContext) M() int + func (ctx *ConsensusContext) MakeBlockSignatures(signatures []SignaturesData) *msg.ConsensusPayload + func (ctx *ConsensusContext) MakeChangeView() *msg.ConsensusPayload + func (ctx *ConsensusContext) MakeHeader() *types.Block + func (ctx *ConsensusContext) MakePayload(message ConsensusMessage) *msg.ConsensusPayload + func (ctx *ConsensusContext) MakePrepareRequest() *msg.ConsensusPayload + func (ctx *ConsensusContext) MakePrepareResponse(signature []byte) *msg.ConsensusPayload + func (ctx *ConsensusContext) Reset(bkAccount *account.Account) + type ConsensusMessage interface + ConsensusMessageData func() *ConsensusMessageData + Deserialization func(source *common.ZeroCopySource) error + Serialization func(sink *common.ZeroCopySink) + Type func() ConsensusMessageType + ViewNumber func() byte + func DeserializeMessage(data []byte) (ConsensusMessage, error) + type ConsensusMessageData struct + Type ConsensusMessageType + ViewNumber byte + func (cd *ConsensusMessageData) Deserialization(source *common.ZeroCopySource) error + func (cd *ConsensusMessageData) Serialization(sink *common.ZeroCopySink) + type ConsensusMessageType byte + const BlockSignaturesMsg + const ChangeViewMsg + const PrepareRequestMsg + const PrepareResponseMsg + type ConsensusState byte + const Backup + const BlockGenerated + const Initial + const Primary + const RequestReceived + const RequestSent + const SignatureSent + func (state ConsensusState) HasFlag(flag ConsensusState) bool + type DbftService struct + Account *account.Account + func NewDbftService(bkAccount *account.Account, txpool, p2p *actor.PID) (*DbftService, error) + func (ds *DbftService) BlockPersistCompleted(v interface{}) + func (ds *DbftService) BlockSignaturesReceived(payload *p2pmsg.ConsensusPayload, message *BlockSignatures) + func (ds *DbftService) ChangeViewReceived(payload *p2pmsg.ConsensusPayload, message *ChangeView) + func (ds *DbftService) CheckExpectedView(viewNumber byte) + func (ds *DbftService) CheckPolicy(transaction *types.Transaction) error + func (ds *DbftService) CheckSignatures() error + func (ds *DbftService) InitializeConsensus(viewNum byte) error + func (ds *DbftService) LocalNodeNewInventory(v interface{}) + func (ds *DbftService) NewConsensusPayload(payload *p2pmsg.ConsensusPayload) + func (ds *DbftService) PrepareRequestReceived(payload *p2pmsg.ConsensusPayload, message *PrepareRequest) + func (ds *DbftService) PrepareResponseReceived(payload *p2pmsg.ConsensusPayload, message *PrepareResponse) + func (ds *DbftService) RefreshPolicy() + func (ds *DbftService) RequestChangeView() + func (ds *DbftService) SignAndRelay(payload *p2pmsg.ConsensusPayload) + func (ds *DbftService) Timeout() + func (this *DbftService) GetPID() *actor.PID + func (this *DbftService) Halt() error + func (this *DbftService) Receive(context actor.Context) + func (this *DbftService) Start() error + type PrepareRequest struct + NextBookkeeper common.Address + Nonce uint64 + Signature []byte + Transactions []*types.Transaction + func (pr *PrepareRequest) ConsensusMessageData() *ConsensusMessageData + func (pr *PrepareRequest) Deserialization(source *common.ZeroCopySource) error + func (pr *PrepareRequest) Serialization(sink *common.ZeroCopySink) + func (pr *PrepareRequest) Type() ConsensusMessageType + func (pr *PrepareRequest) ViewNumber() byte + type PrepareResponse struct + Signature []byte + func (pres *PrepareResponse) ConsensusMessageData() *ConsensusMessageData + func (pres *PrepareResponse) Deserialization(source *common.ZeroCopySource) error + func (pres *PrepareResponse) Serialization(sink *common.ZeroCopySink) + func (pres *PrepareResponse) Type() ConsensusMessageType + func (pres *PrepareResponse) ViewNumber() byte + type SignaturesData struct + Index uint16 + Signature []byte