Documentation ¶
Index ¶
- func NewGetConsensusStateMessage() (*pb.UnsignedMessage, error)
- func NewGetConsensusStateReply(ledgerHeight uint32, ledgerBlockHash common.Uint256, consensusHeight uint32, ...) (*pb.UnsignedMessage, error)
- func NewIHaveBlockProposalMessage(height uint32, blockHash common.Uint256) (*pb.UnsignedMessage, error)
- func NewRequestBlockProposalMessage(blockHash common.Uint256) (*pb.UnsignedMessage, error)
- func NewRequestBlockProposalReply(block *ledger.Block) (*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(ledgerHeight uint32, ledgerBlockHash common.Uint256, consensusHeight 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) (*pb.UnsignedMessage, error)
NewRequestBlockProposalMessage creates a REQUEST_BLOCK_PROPOSAL message to request a block
func NewRequestBlockProposalReply ¶
func NewRequestBlockProposalReply(block *ledger.Block) (*pb.UnsignedMessage, error)
NewRequestBlockProposalReply creates a REQUEST_BLOCK_PROPOSAL_REPLY message in respond to REQUEST_BLOCK_PROPOSAL 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