message

package
v0.0.0-...-7833c67 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgConnect = MessageType(iota + 1)
	MsgPingReq
	MsgPingResp
	MsgSystem
	MsgAppHandshake
	MsgApplication
	MsgDownloader
	MsgNewBlock
	MsgDisconnect
	MsgTransaction
	MsgTypeFirstInvalid
)
View Source
const (
	GossipPrefix             = "ast/1/"
	GossipBlockMessage       = GossipPrefix + "new_block"
	GossipSyncState          = GossipPrefix + "sync_state"
	GossipTransactionMessage = GossipPrefix + "new_transaction"
)

Variables

View Source
var TopicMappings = map[string]interface{}{
	GossipBlockMessage:       struct{}{},
	GossipSyncState:          struct{}{},
	GossipTransactionMessage: struct{}{},
}

Functions

This section is empty.

Types

type IMessage

type IMessage interface {
	Type() MessageType
	Peer() peer.ID
	Broadcast() bool
	Encode() ([]byte, error)
	Decode(MessageType, []byte) error
}

type MessageType

type MessageType uint8

func (MessageType) IsValid

func (mt MessageType) IsValid() bool

func (MessageType) String

func (mt MessageType) String() string

String implements the stringer interface.

Jump to

Keyboard shortcuts

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