message

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: LGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// EthMsgSoftCapSize is the ideal size of encoded transaction bytes we send in
	// any [EthTxs] message. We do not limit inbound messages to
	// this size, however. Max inbound message size is enforced by the codec
	// (512KB).
	EthMsgSoftCapSize = common.StorageSize(64 * units.KiB)
)

Variables

This section is empty.

Functions

func Build

func Build(msg Message) ([]byte, error)

Types

type Handler

type Handler interface {
	HandleTxs(nodeID ids.ShortID, requestID uint32, msg *Txs) error
}

type Message

type Message interface {
	// Handle this message with the correct message handler
	Handle(handler Handler, nodeID ids.ShortID, requestID uint32) error

	// Bytes returns the binary representation of this message
	//
	// Bytes should only be called after being initialized
	Bytes() []byte
	// contains filtered or unexported methods
}

func Parse

func Parse(bytes []byte) (Message, error)

type NoopHandler

type NoopHandler struct{}

func (NoopHandler) HandleTxs

func (NoopHandler) HandleTxs(nodeID ids.ShortID, requestID uint32, _ *Txs) error

type Txs

type Txs struct {
	Txs []byte `serialize:"true"`
	// contains filtered or unexported fields
}

func (*Txs) Bytes

func (m *Txs) Bytes() []byte

func (*Txs) Handle

func (msg *Txs) Handle(handler Handler, nodeID ids.ShortID, requestID uint32) error

Jump to

Keyboard shortcuts

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