blockfetch

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROTOCOL_NAME        = "block-fetch"
	PROTOCOL_ID   uint16 = 3
)
View Source
const (
	MESSAGE_TYPE_REQUEST_RANGE = 0
	MESSAGE_TYPE_CLIENT_DONE   = 1
	MESSAGE_TYPE_START_BATCH   = 2
	MESSAGE_TYPE_NO_BLOCKS     = 3
	MESSAGE_TYPE_BLOCK         = 4
	MESSAGE_TYPE_BATCH_DONE    = 5
)

Variables

View Source
var (
	STATE_IDLE      = protocol.NewState(1, "Idle")
	STATE_BUSY      = protocol.NewState(2, "Busy")
	STATE_STREAMING = protocol.NewState(3, "Streaming")
	STATE_DONE      = protocol.NewState(4, "Done")
)

Functions

func NewMsgFromCbor added in v0.5.0

func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)

Types

type BlockFetch

type BlockFetch struct {
	*protocol.Protocol
	// contains filtered or unexported fields
}

func New

func New(options protocol.ProtocolOptions, callbackConfig *BlockFetchCallbackConfig) *BlockFetch

func (*BlockFetch) ClientDone

func (b *BlockFetch) ClientDone() error

func (*BlockFetch) RequestRange

func (b *BlockFetch) RequestRange(start []interface{}, end []interface{}) error

type BlockFetchBatchDoneFunc

type BlockFetchBatchDoneFunc func() error

type BlockFetchBlockFunc

type BlockFetchBlockFunc func(uint, interface{}) error

type BlockFetchCallbackConfig

type BlockFetchCallbackConfig struct {
	StartBatchFunc BlockFetchStartBatchFunc
	NoBlocksFunc   BlockFetchNoBlocksFunc
	BlockFunc      BlockFetchBlockFunc
	BatchDoneFunc  BlockFetchBatchDoneFunc
}

type BlockFetchNoBlocksFunc

type BlockFetchNoBlocksFunc func() error

type BlockFetchStartBatchFunc

type BlockFetchStartBatchFunc func() error

Callback function types

type MsgBatchDone added in v0.10.0

type MsgBatchDone struct {
	protocol.MessageBase
}

func NewMsgBatchDone added in v0.12.1

func NewMsgBatchDone() *MsgBatchDone

type MsgBlock added in v0.10.0

type MsgBlock struct {
	protocol.MessageBase
	WrappedBlock []byte
}

func NewMsgBlock added in v0.12.1

func NewMsgBlock(wrappedBlock []byte) *MsgBlock

type MsgClientDone added in v0.10.0

type MsgClientDone struct {
	protocol.MessageBase
}

func NewMsgClientDone added in v0.10.0

func NewMsgClientDone() *MsgClientDone

type MsgNoBlocks added in v0.10.0

type MsgNoBlocks struct {
	protocol.MessageBase
}

func NewMsgNoBlocks added in v0.12.1

func NewMsgNoBlocks() *MsgNoBlocks

type MsgRequestRange added in v0.10.0

type MsgRequestRange struct {
	protocol.MessageBase
	Start interface{} //point
	End   interface{} //point
}

func NewMsgRequestRange added in v0.10.0

func NewMsgRequestRange(start interface{}, end interface{}) *MsgRequestRange

type MsgStartBatch added in v0.10.0

type MsgStartBatch struct {
	protocol.MessageBase
}

func NewMsgStartBatch added in v0.12.1

func NewMsgStartBatch() *MsgStartBatch

type WrappedBlock added in v0.10.0

type WrappedBlock struct {
	Type     uint
	RawBlock cbor.RawMessage
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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