proto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: LGPL-3.0 Imports: 2 Imported by: 0

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 GetConsensusMessagePayload

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

GetConsensusMessagePayload gets the consensus 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

Types

type MessageCategory

type MessageCategory byte

MessageCategory defines the message category enum

const (
	Consensus MessageCategory = iota
	Node
	Client // deprecated
	DRand  // not used
)

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