subproto

package
v2.4.8-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyGetBlockResponseSize = 12 // roughly estimated maximum size if element is full
)

Variables

View Source
var (
	ErrConsensusAccessorNotReady = errors.New("consensus accessor is not ready")
)

Functions

func DebugLogRaftWrapMsg

func DebugLogRaftWrapMsg(logger *log.Logger, peer p2pcommon.RemotePeer, msgID p2pcommon.MsgID, body *raftpb.Message)

func NewAddressesReqHandler

func NewAddressesReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *addressesRequestHandler

newAddressesReqHandler creates handler for PingRequest

func NewAddressesRespHandler

func NewAddressesRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *addressesResponseHandler

newAddressesRespHandler creates handler for PingRequest

func NewAgentBlockProducedNoticeHandler

func NewAgentBlockProducedNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager, cm p2pcommon.CertificateManager) *toAgentBPNoticeHandler

newNewBlockNoticeHandler creates handler for NewBlockNotice

func NewBPNoticeDiscardHandler

newNewBlockNoticeHandler creates handler for NewBlockNotice

func NewBlkNoticeDiscardHandler

func NewBlkNoticeDiscardHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) p2pcommon.MessageHandler

newNewBlockNoticeHandler creates handler for NewBlockNotice

func NewBlockProducedNoticeHandler

func NewBlockProducedNoticeHandler(is p2pcommon.InternalService, pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) *blockProducedNoticeHandler

newNewBlockNoticeHandler creates handler for NewBlockNotice

func NewBlockReqHandler

func NewBlockReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *blockRequestHandler

newBlockReqHandler creates handler for GetBlockRequest

func NewBlockRespHandler

func NewBlockRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) *blockResponseHandler

NewBlockRespHandler creates handler for GetBlockResponse

func NewCertRenewedNoticeHandler

func NewCertRenewedNoticeHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *certRenewedNoticeHandler

newAddressesRespHandler creates handler for PingRequest

func NewGetAncestorReqHandler

func NewGetAncestorReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getAncestorRequestHandler

newGetAncestorReqHandler creates handler for GetAncestorRequest

func NewGetAncestorRespHandler

func NewGetAncestorRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getAncestorResponseHandler

newBlockRespHandler creates handler for GetAncestorResponse

func NewGetBlockHeaderRespHandler

func NewGetBlockHeaderRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getBlockHeadersResponseHandler

newListBlockRespHandler creates handler for GetBlockHeadersResponse

func NewGetBlockHeadersReqHandler

func NewGetBlockHeadersReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getBlockHeadersRequestHandler

newListBlockHeadersReqHandler creates handler for GetBlockHeadersRequest

func NewGetClusterReqHandler

func NewGetClusterReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, consAcc consensus.ConsensusAccessor) *getClusterRequestHandler

NewGetClusterReqHandler creates handler for PingRequest

func NewGetClusterRespHandler

func NewGetClusterRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getClusterResponseHandler

NewGetClusterRespHandler creates handler for PingRequest

func NewGetHashByNoReqHandler

func NewGetHashByNoReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getHashByNoRequestHandler

newBlockReqHandler creates handler for GetBlockRequest

func NewGetHashByNoRespHandler

func NewGetHashByNoRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getHashByNoResponseHandler

newBlockReqHandler creates handler for GetBlockRequest

func NewGetHashesReqHandler

func NewGetHashesReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getHashRequestHandler

newBlockReqHandler creates handler for GetBlockRequest

func NewGetHashesRespHandler

func NewGetHashesRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *getHashResponseHandler

newBlockReqHandler creates handler for GetBlockRequest

func NewGoAwayHandler

func NewGoAwayHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *goAwayHandler

newGoAwayHandler creates handler for PingResponse

func NewIssueCertReqHandler

func NewIssueCertReqHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *issueCertRequestHandler

newAddressesReqHandler creates handler for PingRequest

func NewIssueCertRespHandler

func NewIssueCertRespHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *issueCertResponseHandler

newAddressesRespHandler creates handler for PingRequest

func NewNewBlockNoticeHandler

func NewNewBlockNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) *newBlockNoticeHandler

newNewBlockNoticeHandler creates handler for NewBlockNotice

func NewNewTxNoticeHandler

func NewNewTxNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) *newTxNoticeHandler

newNewTxNoticeHandler creates handler for GetTransactionsResponse

func NewPingReqHandler

func NewPingReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *pingRequestHandler

newPingReqHandler creates handler for PingRequest

func NewPingRespHandler

func NewPingRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *pingResponseHandler

newPingRespHandler creates handler for PingResponse

func NewRaftWrapperHandler

func NewRaftWrapperHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, consAcc consensus.ConsensusAccessor) *raftWrapperHandler

NewGetClusterReqHandler creates handler for PingRequest

func NewTxReqHandler

func NewTxReqHandler(pm p2pcommon.PeerManager, sm p2pcommon.SyncManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *txRequestHandler

newTxReqHandler creates handler for GetTransactionsRequest

func NewTxRespHandler

func NewTxRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService) *txResponseHandler

newTxRespHandler creates handler for GetTransactionsResponse

func WithTimeLog

func WithTimeLog(handler p2pcommon.MessageHandler, logger *log.Logger, level zerolog.Level) p2pcommon.MessageHandler

Types

type BaseMsgHandler

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

func(msg *types.P2PMessage) BaseMsgHandler contains common attributes of MessageHandler

func (*BaseMsgHandler) AddAdvice

func (bh *BaseMsgHandler) AddAdvice(advice p2pcommon.HandlerAdvice)

func (*BaseMsgHandler) CheckAuth

func (bh *BaseMsgHandler) CheckAuth(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) error

func (*BaseMsgHandler) PostHandle

func (bh *BaseMsgHandler) PostHandle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody)

func (*BaseMsgHandler) PreHandle

func (bh *BaseMsgHandler) PreHandle()

type LogHandleTimeAdvice

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

func (*LogHandleTimeAdvice) PostHandle

func (a *LogHandleTimeAdvice) PostHandle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody)

func (*LogHandleTimeAdvice) PreHandle

func (a *LogHandleTimeAdvice) PreHandle()

Jump to

Keyboard shortcuts

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