protocol

package
v0.0.0-...-6db25f1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactBlock

type CompactBlock struct {
	Header       *core.BlockHeader
	ShortIDs     []uint64
	PrefilledTxs []*core.Transaction
}

func NewCompactBlock

func NewCompactBlock(block *core.Block) *CompactBlock

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() *Handler

func (*Handler) Handle

func (h *Handler) Handle(msg *Message) error

func (*Handler) RegisterHandler

func (h *Handler) RegisterHandler(msgType MessageType, handler func([]byte) error)

type Message

type Message struct {
	Type    MessageType
	Payload []byte
}

func NewMessage

func NewMessage(msgType MessageType, payload []byte) *Message

type MessageType

type MessageType uint8
const (
	MsgTypeBlock MessageType = iota
	MsgTypeTx
	MsgTypePing
	MsgTypePong
	MsgTypeGetBlocks
	MsgTypeGetData
)

type SyncManager

type SyncManager struct {
	// contains filtered or unexported fields
}

func NewSyncManager

func NewSyncManager(blockchain *core.Blockchain) *SyncManager

func (*SyncManager) Start

func (sm *SyncManager) Start(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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