xuperos

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 默认消息队列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)

异步消息处理handle类型

type NetEvent

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

func NewNetEvent

func NewNetEvent(engine common.Engine) (*NetEvent, error)

func (*NetEvent) GetBlock

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

func (*NetEvent) PostTx

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

func (*NetEvent) SendBlock

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

func (*NetEvent) Start

func (t *NetEvent) Start()

阻塞

func (*NetEvent) Stop

func (t *NetEvent) Stop()

func (*NetEvent) Subscriber

func (t *NetEvent) Subscriber() error

Jump to

Keyboard shortcuts

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