Documentation ¶
Index ¶
- func NewGetConsensusStateMessage() (*pb.UnsignedMessage, error)
- func NewGetConsensusStateReply(ledgerBlockHash common.Uint256, ...) (*pb.UnsignedMessage, error)
- func NewIHaveBlockProposalMessage(height uint32, blockHash common.Uint256) (*pb.UnsignedMessage, error)
- func NewRequestBlockProposalMessage(blockHash common.Uint256, requestType pb.RequestTransactionType, ...) (*pb.UnsignedMessage, error)
- func NewRequestBlockProposalReply(b *block.Block, txnsHash [][]byte) (*pb.UnsignedMessage, error)
- func NewRequestProposalTransactionsMessage(blockHash common.Uint256, requestType pb.RequestTransactionType, ...) (*pb.UnsignedMessage, error)
- func NewRequestProposalTransactionsReply(transactions []*transaction.Transaction) (*pb.UnsignedMessage, error)
- func NewVoteMessage(height uint32, blockHash common.Uint256) (*pb.UnsignedMessage, error)
- type Consensus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetConsensusStateMessage ¶
func NewGetConsensusStateMessage() (*pb.UnsignedMessage, error)
NewGetConsensusStateMessage creates a GET_CONSENSUS_STATE message
func NewGetConsensusStateReply ¶
func NewGetConsensusStateReply(ledgerBlockHash common.Uint256, ledgerHeight, consensusHeight, minVerifiableHeight uint32, syncState pb.SyncState) (*pb.UnsignedMessage, error)
NewGetConsensusStateReply creates a GET_CONSENSUS_STATE_REPLY message in respond to GET_CONSENSUS_STATE message
func NewIHaveBlockProposalMessage ¶
func NewIHaveBlockProposalMessage(height uint32, blockHash common.Uint256) (*pb.UnsignedMessage, error)
NewIHaveBlockProposalMessage creates a I_HAVE_BLOCK_PROPOSAL message
func NewRequestBlockProposalMessage ¶
func NewRequestBlockProposalMessage(blockHash common.Uint256, requestType pb.RequestTransactionType, shortHashSalt []byte, shortHashSize uint32) (*pb.UnsignedMessage, error)
NewRequestBlockProposalMessage creates a REQUEST_BLOCK_PROPOSAL message to request a block
func NewRequestBlockProposalReply ¶
NewRequestBlockProposalReply creates a REQUEST_BLOCK_PROPOSAL_REPLY message in respond to REQUEST_BLOCK_PROPOSAL message to send a block
func NewRequestProposalTransactionsMessage ¶
func NewRequestProposalTransactionsMessage(blockHash common.Uint256, requestType pb.RequestTransactionType, shortHashSalt []byte, shortHashSize uint32, transactionsHash [][]byte) (*pb.UnsignedMessage, error)
NewRequestProposalTransactionsMessage creates a REQUEST_PROPOSAL_TRANSACTIONS message to request a block
func NewRequestProposalTransactionsReply ¶
func NewRequestProposalTransactionsReply(transactions []*transaction.Transaction) (*pb.UnsignedMessage, error)
NewRequestProposalTransactionsReply creates a REQUEST_PROPOSAL_TRANSACTIONS_REPLY message in respond to REQUEST_PROPOSAL_TRANSACTIONS message to send a block
func NewVoteMessage ¶
NewVoteMessage creates a VOTE message
Types ¶
type Consensus ¶
type Consensus struct {
// contains filtered or unexported fields
}
Consensus is the Majority vOte Cellular Automata (MOCA) consensus layer
func NewConsensus ¶
NewConsensus creates a MOCA consensus
func (*Consensus) GetAcceptedHeight ¶
GetAcceptedHeight gets the latest block height that has been accepted by consensus
func (*Consensus) GetExpectedHeight ¶
GetExpectedHeight returns the expected consensus height