Documentation ¶
Index ¶
- Constants
- func ConstructConsensusMessage(payload []byte) []byte
- func ConstructDRandMessage(payload []byte) []byte
- func GetConsensusMessagePayload(message []byte) ([]byte, error)
- func GetDRandMessagePayload(message []byte) ([]byte, error)
- func GetMessagePayload(message []byte) ([]byte, error)
- func GetMessageType(message []byte) (byte, error)
- func GetStakingMessagePayload(message []byte) ([]byte, error)
- type MessageCategory
Constants ¶
const ( // ProtocolVersion is a constant defined as the version of the Harmony protocol ProtocolVersion = 1 // MessageCategoryBytes is the number of bytes message category takes MessageCategoryBytes = 1 // MessageTypeBytes is the number of bytes message type takes MessageTypeBytes = 1 )
Variables ¶
This section is empty.
Functions ¶
func ConstructConsensusMessage ¶
ConstructConsensusMessage creates a message with the payload and returns as byte array.
func ConstructDRandMessage ¶
ConstructDRandMessage creates a message with the payload and returns as byte array.
func GetConsensusMessagePayload ¶
GetConsensusMessagePayload gets the consensus message payload from the p2p message content
func GetDRandMessagePayload ¶
GetDRandMessagePayload gets the randomness message payload from the p2p message content
func GetMessagePayload ¶
GetMessagePayload gets the node message payload from the p2p message content
func GetMessageType ¶
GetMessageType gets the message type from the p2p message content
func GetStakingMessagePayload ¶
GetStakingMessagePayload gets the staking message payload from the p2p message content
Types ¶
type MessageCategory ¶
type MessageCategory byte
MessageCategory defines the message category enum
const ( Consensus MessageCategory = iota Node Client DRand )
Consensus and other message categories
func GetMessageCategory ¶
func GetMessageCategory(message []byte) (MessageCategory, error)
GetMessageCategory gets the message category from the p2p message content