net

package
v0.0.0-...-56f3d1a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefMsgChanBufSize 默认消息队列buf大小
	DefMsgChanBufSize = 50000
)

Variables

View Source
var (
	// ErrBlockChainNameEmpty is returned when blockchain name is empty
	ErrBlockChainNameEmpty = errors.New("validation error: validatePostTx TxStatus.Bcname can't be null")
	// ErrTxNil is returned when tx is nil
	ErrTxNil = errors.New("validation error: validatePostTx TxStatus.Tx can't be null")
	// ErrBlockIDNil is returned when blockid is nil
	ErrBlockIDNil = errors.New("validation error: validateSendBlock Block.Blockid can't be null")
	// ErrBlockNil is returned when block is nil
	ErrBlockNil = errors.New("validation error: validateSendBlock Block.Block can't be null")
	// ErrTxInvalid is returned when tx invaild
	ErrTxInvalid = errors.New("validation error: tx info is invaild")
)

Functions

func ErrorType

func ErrorType(err error) protos.XuperMessage_ErrorType

Types

type AsyncMsgHandle

type AsyncMsgHandle func(xctx.XContext, *protos.XuperMessage)

AsyncMsgHandle 异步消息处理handle类型

type Event

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

func NewEvent

func NewEvent(engine common.Engine) (*Event, error)

func (*Event) GetBlock

func (e *Event) GetBlock(ctx xctx.XContext, request *protos.XuperMessage) (*lpb.InternalBlock, error)

func (*Event) PostTx

func (e *Event) PostTx(ctx xctx.XContext, chain common.Chain, tx *lpb.Transaction) error

func (*Event) SendBlock

func (e *Event) SendBlock(ctx xctx.XContext, chain common.Chain, in *lpb.InternalBlock) error

func (*Event) Start

func (e *Event) Start()

Start 阻塞

func (*Event) Stop

func (e *Event) Stop()

func (*Event) Subscriber

func (e *Event) Subscriber() error

Jump to

Keyboard shortcuts

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