Documentation ¶
Index ¶
- Constants
- Variables
- func DebugLogRaftWrapMsg(logger *log.Logger, peer p2pcommon.RemotePeer, msgID p2pcommon.MsgID, ...)
- func NewAddressesReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *addressesRequestHandler
- func NewAddressesRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *addressesResponseHandler
- func NewAgentBlockProducedNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *toAgentBPNoticeHandler
- func NewBPNoticeDiscardHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) p2pcommon.MessageHandler
- func NewBlkNoticeDiscardHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) p2pcommon.MessageHandler
- func NewBlockProducedNoticeHandler(is p2pcommon.InternalService, pm p2pcommon.PeerManager, ...) *blockProducedNoticeHandler
- func NewBlockReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *blockRequestHandler
- func NewBlockRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *blockResponseHandler
- func NewCertRenewedNoticeHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, ...) *certRenewedNoticeHandler
- func NewGetAncestorReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getAncestorRequestHandler
- func NewGetAncestorRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getAncestorResponseHandler
- func NewGetBlockHeaderRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getBlockHeadersResponseHandler
- func NewGetBlockHeadersReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getBlockHeadersRequestHandler
- func NewGetClusterReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getClusterRequestHandler
- func NewGetClusterRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getClusterResponseHandler
- func NewGetHashByNoReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getHashByNoRequestHandler
- func NewGetHashByNoRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getHashByNoResponseHandler
- func NewGetHashesReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getHashRequestHandler
- func NewGetHashesRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *getHashResponseHandler
- func NewGoAwayHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *goAwayHandler
- func NewIssueCertReqHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, ...) *issueCertRequestHandler
- func NewIssueCertRespHandler(pm p2pcommon.PeerManager, cm p2pcommon.CertificateManager, ...) *issueCertResponseHandler
- func NewNewBlockNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *newBlockNoticeHandler
- func NewNewTxNoticeHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *newTxNoticeHandler
- func NewPingReqHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *pingRequestHandler
- func NewPingRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *pingResponseHandler
- func NewRaftWrapperHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *raftWrapperHandler
- func NewTxReqHandler(pm p2pcommon.PeerManager, sm p2pcommon.SyncManager, peer p2pcommon.RemotePeer, ...) *txRequestHandler
- func NewTxRespHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, ...) *txResponseHandler
- func WithTimeLog(handler p2pcommon.MessageHandler, logger *log.Logger, level zerolog.Level) p2pcommon.MessageHandler
- type BaseMsgHandler
- type LogHandleTimeAdvice
Constants ¶
const (
EmptyGetBlockResponseSize = 12 // roughly estimated maximum size if element is full
)
Variables ¶
var (
ErrConsensusAccessorNotReady = errors.New("consensus accessor is not ready")
)
Functions ¶
func DebugLogRaftWrapMsg ¶
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 ¶
func NewBPNoticeDiscardHandler(pm p2pcommon.PeerManager, peer p2pcommon.RemotePeer, logger *log.Logger, actor p2pcommon.ActorService, sm p2pcommon.SyncManager) p2pcommon.MessageHandler
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()