proto

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
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

func ConstructConsensusMessage(payload []byte) []byte

ConstructConsensusMessage creates a message with the payload and returns as byte array.

func ConstructDRandMessage

func ConstructDRandMessage(payload []byte) []byte

ConstructDRandMessage creates a message with the payload and returns as byte array.

func GetConsensusMessagePayload

func GetConsensusMessagePayload(message []byte) ([]byte, error)

GetConsensusMessagePayload gets the consensus message payload from the p2p message content

func GetDRandMessagePayload

func GetDRandMessagePayload(message []byte) ([]byte, error)

GetDRandMessagePayload gets the randomness message payload from the p2p message content

func GetMessagePayload

func GetMessagePayload(message []byte) ([]byte, error)

GetMessagePayload gets the node message payload from the p2p message content

func GetMessageType

func GetMessageType(message []byte) (byte, error)

GetMessageType gets the message type from the p2p message content

func GetStakingMessagePayload

func GetStakingMessagePayload(message []byte) ([]byte, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL