Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterSentryServer(s grpc.ServiceRegistrar, srv SentryServer)
- type Forks
- func (*Forks) Descriptor() ([]byte, []int)deprecated
- func (x *Forks) GetGenesis() *types.H256
- func (x *Forks) GetHeightForks() []uint64
- func (x *Forks) GetTimeForks() []uint64
- func (*Forks) ProtoMessage()
- func (x *Forks) ProtoReflect() protoreflect.Message
- func (x *Forks) Reset()
- func (x *Forks) String() string
- type HandShakeReply
- type InboundMessage
- func (*InboundMessage) Descriptor() ([]byte, []int)deprecated
- func (x *InboundMessage) GetData() []byte
- func (x *InboundMessage) GetId() MessageId
- func (x *InboundMessage) GetPeerId() *types.H512
- func (*InboundMessage) ProtoMessage()
- func (x *InboundMessage) ProtoReflect() protoreflect.Message
- func (x *InboundMessage) Reset()
- func (x *InboundMessage) String() string
- type MessageId
- type MessagesRequest
- type OutboundMessageData
- func (*OutboundMessageData) Descriptor() ([]byte, []int)deprecated
- func (x *OutboundMessageData) GetData() []byte
- func (x *OutboundMessageData) GetId() MessageId
- func (*OutboundMessageData) ProtoMessage()
- func (x *OutboundMessageData) ProtoReflect() protoreflect.Message
- func (x *OutboundMessageData) Reset()
- func (x *OutboundMessageData) String() string
- type PeerByIdReply
- type PeerByIdRequest
- type PeerCountPerProtocol
- func (*PeerCountPerProtocol) Descriptor() ([]byte, []int)deprecated
- func (x *PeerCountPerProtocol) GetCount() uint64
- func (x *PeerCountPerProtocol) GetProtocol() Protocol
- func (*PeerCountPerProtocol) ProtoMessage()
- func (x *PeerCountPerProtocol) ProtoReflect() protoreflect.Message
- func (x *PeerCountPerProtocol) Reset()
- func (x *PeerCountPerProtocol) String() string
- type PeerCountReply
- func (*PeerCountReply) Descriptor() ([]byte, []int)deprecated
- func (x *PeerCountReply) GetCount() uint64
- func (x *PeerCountReply) GetCountsPerProtocol() []*PeerCountPerProtocol
- func (*PeerCountReply) ProtoMessage()
- func (x *PeerCountReply) ProtoReflect() protoreflect.Message
- func (x *PeerCountReply) Reset()
- func (x *PeerCountReply) String() string
- type PeerCountRequest
- type PeerEvent
- func (*PeerEvent) Descriptor() ([]byte, []int)deprecated
- func (x *PeerEvent) GetEventId() PeerEvent_PeerEventId
- func (x *PeerEvent) GetPeerId() *types.H512
- func (*PeerEvent) ProtoMessage()
- func (x *PeerEvent) ProtoReflect() protoreflect.Message
- func (x *PeerEvent) Reset()
- func (x *PeerEvent) String() string
- type PeerEvent_PeerEventId
- func (PeerEvent_PeerEventId) Descriptor() protoreflect.EnumDescriptor
- func (x PeerEvent_PeerEventId) Enum() *PeerEvent_PeerEventId
- func (PeerEvent_PeerEventId) EnumDescriptor() ([]byte, []int)deprecated
- func (x PeerEvent_PeerEventId) Number() protoreflect.EnumNumber
- func (x PeerEvent_PeerEventId) String() string
- func (PeerEvent_PeerEventId) Type() protoreflect.EnumType
- type PeerEventsRequest
- type PeerMinBlockRequest
- func (*PeerMinBlockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PeerMinBlockRequest) GetMinBlock() uint64
- func (x *PeerMinBlockRequest) GetPeerId() *types.H512
- func (*PeerMinBlockRequest) ProtoMessage()
- func (x *PeerMinBlockRequest) ProtoReflect() protoreflect.Message
- func (x *PeerMinBlockRequest) Reset()
- func (x *PeerMinBlockRequest) String() string
- type PeersReply
- type PenalizePeerRequest
- func (*PenalizePeerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PenalizePeerRequest) GetPeerId() *types.H512
- func (x *PenalizePeerRequest) GetPenalty() PenaltyKind
- func (*PenalizePeerRequest) ProtoMessage()
- func (x *PenalizePeerRequest) ProtoReflect() protoreflect.Message
- func (x *PenalizePeerRequest) Reset()
- func (x *PenalizePeerRequest) String() string
- type PenaltyKind
- func (PenaltyKind) Descriptor() protoreflect.EnumDescriptor
- func (x PenaltyKind) Enum() *PenaltyKind
- func (PenaltyKind) EnumDescriptor() ([]byte, []int)deprecated
- func (x PenaltyKind) Number() protoreflect.EnumNumber
- func (x PenaltyKind) String() string
- func (PenaltyKind) Type() protoreflect.EnumType
- type Protocol
- type SendMessageByIdRequest
- func (*SendMessageByIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageByIdRequest) GetData() *OutboundMessageData
- func (x *SendMessageByIdRequest) GetPeerId() *types.H512
- func (*SendMessageByIdRequest) ProtoMessage()
- func (x *SendMessageByIdRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageByIdRequest) Reset()
- func (x *SendMessageByIdRequest) String() string
- type SendMessageByMinBlockRequest
- func (*SendMessageByMinBlockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageByMinBlockRequest) GetData() *OutboundMessageData
- func (x *SendMessageByMinBlockRequest) GetMaxPeers() uint64
- func (x *SendMessageByMinBlockRequest) GetMinBlock() uint64
- func (*SendMessageByMinBlockRequest) ProtoMessage()
- func (x *SendMessageByMinBlockRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageByMinBlockRequest) Reset()
- func (x *SendMessageByMinBlockRequest) String() string
- type SendMessageToRandomPeersRequest
- func (*SendMessageToRandomPeersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageToRandomPeersRequest) GetData() *OutboundMessageData
- func (x *SendMessageToRandomPeersRequest) GetMaxPeers() uint64
- func (*SendMessageToRandomPeersRequest) ProtoMessage()
- func (x *SendMessageToRandomPeersRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageToRandomPeersRequest) Reset()
- func (x *SendMessageToRandomPeersRequest) String() string
- type SentPeers
- type SentryClient
- type SentryClientMock
- func (mock *SentryClientMock) HandShake(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error)
- func (mock *SentryClientMock) HandShakeCalls() []struct{ ... }
- func (mock *SentryClientMock) Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error)
- func (mock *SentryClientMock) MessagesCalls() []struct{ ... }
- func (mock *SentryClientMock) NodeInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error)
- func (mock *SentryClientMock) NodeInfoCalls() []struct{ ... }
- func (mock *SentryClientMock) PeerById(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error)
- func (mock *SentryClientMock) PeerByIdCalls() []struct{ ... }
- func (mock *SentryClientMock) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error)
- func (mock *SentryClientMock) PeerCountCalls() []struct{ ... }
- func (mock *SentryClientMock) PeerEvents(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error)
- func (mock *SentryClientMock) PeerEventsCalls() []struct{ ... }
- func (mock *SentryClientMock) PeerMinBlock(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (mock *SentryClientMock) PeerMinBlockCalls() []struct{ ... }
- func (mock *SentryClientMock) Peers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error)
- func (mock *SentryClientMock) PeersCalls() []struct{ ... }
- func (mock *SentryClientMock) PenalizePeer(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (mock *SentryClientMock) PenalizePeerCalls() []struct{ ... }
- func (mock *SentryClientMock) SendMessageById(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error)
- func (mock *SentryClientMock) SendMessageByIdCalls() []struct{ ... }
- func (mock *SentryClientMock) SendMessageByMinBlock(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error)
- func (mock *SentryClientMock) SendMessageByMinBlockCalls() []struct{ ... }
- func (mock *SentryClientMock) SendMessageToAll(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error)
- func (mock *SentryClientMock) SendMessageToAllCalls() []struct{ ... }
- func (mock *SentryClientMock) SendMessageToRandomPeers(ctx context.Context, in *SendMessageToRandomPeersRequest, ...) (*SentPeers, error)
- func (mock *SentryClientMock) SendMessageToRandomPeersCalls() []struct{ ... }
- func (mock *SentryClientMock) SetStatus(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error)
- func (mock *SentryClientMock) SetStatusCalls() []struct{ ... }
- type SentryServer
- type SentryServerMock
- func (mock *SentryServerMock) HandShake(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error)
- func (mock *SentryServerMock) HandShakeCalls() []struct{ ... }
- func (mock *SentryServerMock) Messages(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error
- func (mock *SentryServerMock) MessagesCalls() []struct{ ... }
- func (mock *SentryServerMock) NodeInfo(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error)
- func (mock *SentryServerMock) NodeInfoCalls() []struct{ ... }
- func (mock *SentryServerMock) PeerById(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error)
- func (mock *SentryServerMock) PeerByIdCalls() []struct{ ... }
- func (mock *SentryServerMock) PeerCount(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error)
- func (mock *SentryServerMock) PeerCountCalls() []struct{ ... }
- func (mock *SentryServerMock) PeerEvents(peerEventsRequest *PeerEventsRequest, ...) error
- func (mock *SentryServerMock) PeerEventsCalls() []struct{ ... }
- func (mock *SentryServerMock) PeerMinBlock(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error)
- func (mock *SentryServerMock) PeerMinBlockCalls() []struct{ ... }
- func (mock *SentryServerMock) Peers(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error)
- func (mock *SentryServerMock) PeersCalls() []struct{ ... }
- func (mock *SentryServerMock) PenalizePeer(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error)
- func (mock *SentryServerMock) PenalizePeerCalls() []struct{ ... }
- func (mock *SentryServerMock) SendMessageById(contextMoqParam context.Context, ...) (*SentPeers, error)
- func (mock *SentryServerMock) SendMessageByIdCalls() []struct{ ... }
- func (mock *SentryServerMock) SendMessageByMinBlock(contextMoqParam context.Context, ...) (*SentPeers, error)
- func (mock *SentryServerMock) SendMessageByMinBlockCalls() []struct{ ... }
- func (mock *SentryServerMock) SendMessageToAll(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error)
- func (mock *SentryServerMock) SendMessageToAllCalls() []struct{ ... }
- func (mock *SentryServerMock) SendMessageToRandomPeers(contextMoqParam context.Context, ...) (*SentPeers, error)
- func (mock *SentryServerMock) SendMessageToRandomPeersCalls() []struct{ ... }
- func (mock *SentryServerMock) SetStatus(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error)
- func (mock *SentryServerMock) SetStatusCalls() []struct{ ... }
- type Sentry_MessagesClient
- type Sentry_MessagesServer
- type Sentry_PeerEventsClient
- type Sentry_PeerEventsServer
- type SetStatusReply
- type StatusData
- func (*StatusData) Descriptor() ([]byte, []int)deprecated
- func (x *StatusData) GetBestHash() *types.H256
- func (x *StatusData) GetForkData() *Forks
- func (x *StatusData) GetMaxBlockHeight() uint64
- func (x *StatusData) GetMaxBlockTime() uint64
- func (x *StatusData) GetNetworkId() uint64
- func (x *StatusData) GetTotalDifficulty() *types.H256
- func (*StatusData) ProtoMessage()
- func (x *StatusData) ProtoReflect() protoreflect.Message
- func (x *StatusData) Reset()
- func (x *StatusData) String() string
- type UnimplementedSentryServer
- func (UnimplementedSentryServer) HandShake(context.Context, *emptypb.Empty) (*HandShakeReply, error)
- func (UnimplementedSentryServer) Messages(*MessagesRequest, Sentry_MessagesServer) error
- func (UnimplementedSentryServer) NodeInfo(context.Context, *emptypb.Empty) (*types.NodeInfoReply, error)
- func (UnimplementedSentryServer) PeerById(context.Context, *PeerByIdRequest) (*PeerByIdReply, error)
- func (UnimplementedSentryServer) PeerCount(context.Context, *PeerCountRequest) (*PeerCountReply, error)
- func (UnimplementedSentryServer) PeerEvents(*PeerEventsRequest, Sentry_PeerEventsServer) error
- func (UnimplementedSentryServer) PeerMinBlock(context.Context, *PeerMinBlockRequest) (*emptypb.Empty, error)
- func (UnimplementedSentryServer) Peers(context.Context, *emptypb.Empty) (*PeersReply, error)
- func (UnimplementedSentryServer) PenalizePeer(context.Context, *PenalizePeerRequest) (*emptypb.Empty, error)
- func (UnimplementedSentryServer) SendMessageById(context.Context, *SendMessageByIdRequest) (*SentPeers, error)
- func (UnimplementedSentryServer) SendMessageByMinBlock(context.Context, *SendMessageByMinBlockRequest) (*SentPeers, error)
- func (UnimplementedSentryServer) SendMessageToAll(context.Context, *OutboundMessageData) (*SentPeers, error)
- func (UnimplementedSentryServer) SendMessageToRandomPeers(context.Context, *SendMessageToRandomPeersRequest) (*SentPeers, error)
- func (UnimplementedSentryServer) SetStatus(context.Context, *StatusData) (*SetStatusReply, error)
- type UnsafeSentryServer
Constants ¶
const ( Sentry_SetStatus_FullMethodName = "/sentry.Sentry/SetStatus" Sentry_PenalizePeer_FullMethodName = "/sentry.Sentry/PenalizePeer" Sentry_PeerMinBlock_FullMethodName = "/sentry.Sentry/PeerMinBlock" Sentry_HandShake_FullMethodName = "/sentry.Sentry/HandShake" Sentry_SendMessageByMinBlock_FullMethodName = "/sentry.Sentry/SendMessageByMinBlock" Sentry_SendMessageById_FullMethodName = "/sentry.Sentry/SendMessageById" Sentry_SendMessageToRandomPeers_FullMethodName = "/sentry.Sentry/SendMessageToRandomPeers" Sentry_SendMessageToAll_FullMethodName = "/sentry.Sentry/SendMessageToAll" Sentry_Messages_FullMethodName = "/sentry.Sentry/Messages" Sentry_Peers_FullMethodName = "/sentry.Sentry/Peers" Sentry_PeerCount_FullMethodName = "/sentry.Sentry/PeerCount" Sentry_PeerById_FullMethodName = "/sentry.Sentry/PeerById" Sentry_PeerEvents_FullMethodName = "/sentry.Sentry/PeerEvents" Sentry_NodeInfo_FullMethodName = "/sentry.Sentry/NodeInfo" )
Variables ¶
var ( MessageId_name = map[int32]string{ 0: "STATUS_65", 1: "GET_BLOCK_HEADERS_65", 2: "BLOCK_HEADERS_65", 3: "BLOCK_HASHES_65", 4: "GET_BLOCK_BODIES_65", 5: "BLOCK_BODIES_65", 6: "GET_NODE_DATA_65", 7: "NODE_DATA_65", 8: "GET_RECEIPTS_65", 9: "RECEIPTS_65", 10: "NEW_BLOCK_HASHES_65", 11: "NEW_BLOCK_65", 12: "TRANSACTIONS_65", 13: "NEW_POOLED_TRANSACTION_HASHES_65", 14: "GET_POOLED_TRANSACTIONS_65", 15: "POOLED_TRANSACTIONS_65", 17: "STATUS_66", 18: "NEW_BLOCK_HASHES_66", 19: "NEW_BLOCK_66", 20: "TRANSACTIONS_66", 21: "NEW_POOLED_TRANSACTION_HASHES_66", 22: "GET_BLOCK_HEADERS_66", 23: "GET_BLOCK_BODIES_66", 24: "GET_NODE_DATA_66", 25: "GET_RECEIPTS_66", 26: "GET_POOLED_TRANSACTIONS_66", 27: "BLOCK_HEADERS_66", 28: "BLOCK_BODIES_66", 29: "NODE_DATA_66", 30: "RECEIPTS_66", 31: "POOLED_TRANSACTIONS_66", 32: "NEW_POOLED_TRANSACTION_HASHES_68", } MessageId_value = map[string]int32{ "STATUS_65": 0, "GET_BLOCK_HEADERS_65": 1, "BLOCK_HEADERS_65": 2, "BLOCK_HASHES_65": 3, "GET_BLOCK_BODIES_65": 4, "BLOCK_BODIES_65": 5, "GET_NODE_DATA_65": 6, "NODE_DATA_65": 7, "GET_RECEIPTS_65": 8, "RECEIPTS_65": 9, "NEW_BLOCK_HASHES_65": 10, "NEW_BLOCK_65": 11, "TRANSACTIONS_65": 12, "NEW_POOLED_TRANSACTION_HASHES_65": 13, "GET_POOLED_TRANSACTIONS_65": 14, "POOLED_TRANSACTIONS_65": 15, "STATUS_66": 17, "NEW_BLOCK_HASHES_66": 18, "NEW_BLOCK_66": 19, "TRANSACTIONS_66": 20, "NEW_POOLED_TRANSACTION_HASHES_66": 21, "GET_BLOCK_HEADERS_66": 22, "GET_BLOCK_BODIES_66": 23, "GET_NODE_DATA_66": 24, "GET_RECEIPTS_66": 25, "GET_POOLED_TRANSACTIONS_66": 26, "BLOCK_HEADERS_66": 27, "BLOCK_BODIES_66": 28, "NODE_DATA_66": 29, "RECEIPTS_66": 30, "POOLED_TRANSACTIONS_66": 31, "NEW_POOLED_TRANSACTION_HASHES_68": 32, } )
Enum value maps for MessageId.
var ( PenaltyKind_name = map[int32]string{ 0: "Kick", } PenaltyKind_value = map[string]int32{ "Kick": 0, } )
Enum value maps for PenaltyKind.
var ( Protocol_name = map[int32]string{ 0: "ETH65", 1: "ETH66", 2: "ETH67", 3: "ETH68", } Protocol_value = map[string]int32{ "ETH65": 0, "ETH66": 1, "ETH67": 2, "ETH68": 3, } )
Enum value maps for Protocol.
var ( PeerEvent_PeerEventId_name = map[int32]string{ 0: "Connect", 1: "Disconnect", } PeerEvent_PeerEventId_value = map[string]int32{ "Connect": 0, "Disconnect": 1, } )
Enum value maps for PeerEvent_PeerEventId.
var File_p2psentry_sentry_proto protoreflect.FileDescriptor
var Sentry_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sentry.Sentry", HandlerType: (*SentryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetStatus", Handler: _Sentry_SetStatus_Handler, }, { MethodName: "PenalizePeer", Handler: _Sentry_PenalizePeer_Handler, }, { MethodName: "PeerMinBlock", Handler: _Sentry_PeerMinBlock_Handler, }, { MethodName: "HandShake", Handler: _Sentry_HandShake_Handler, }, { MethodName: "SendMessageByMinBlock", Handler: _Sentry_SendMessageByMinBlock_Handler, }, { MethodName: "SendMessageById", Handler: _Sentry_SendMessageById_Handler, }, { MethodName: "SendMessageToRandomPeers", Handler: _Sentry_SendMessageToRandomPeers_Handler, }, { MethodName: "SendMessageToAll", Handler: _Sentry_SendMessageToAll_Handler, }, { MethodName: "Peers", Handler: _Sentry_Peers_Handler, }, { MethodName: "PeerCount", Handler: _Sentry_PeerCount_Handler, }, { MethodName: "PeerById", Handler: _Sentry_PeerById_Handler, }, { MethodName: "NodeInfo", Handler: _Sentry_NodeInfo_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Messages", Handler: _Sentry_Messages_Handler, ServerStreams: true, }, { StreamName: "PeerEvents", Handler: _Sentry_PeerEvents_Handler, ServerStreams: true, }, }, Metadata: "p2psentry/sentry.proto", }
Sentry_ServiceDesc is the grpc.ServiceDesc for Sentry service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSentryServer ¶
func RegisterSentryServer(s grpc.ServiceRegistrar, srv SentryServer)
Types ¶
type Forks ¶
type Forks struct { Genesis *types.H256 `protobuf:"bytes,1,opt,name=genesis,proto3" json:"genesis,omitempty"` HeightForks []uint64 `protobuf:"varint,2,rep,packed,name=height_forks,json=heightForks,proto3" json:"height_forks,omitempty"` TimeForks []uint64 `protobuf:"varint,3,rep,packed,name=time_forks,json=timeForks,proto3" json:"time_forks,omitempty"` // contains filtered or unexported fields }
func (*Forks) Descriptor
deprecated
func (*Forks) GetGenesis ¶
func (*Forks) GetHeightForks ¶
func (*Forks) GetTimeForks ¶
func (*Forks) ProtoMessage ¶
func (*Forks) ProtoMessage()
func (*Forks) ProtoReflect ¶
func (x *Forks) ProtoReflect() protoreflect.Message
type HandShakeReply ¶
type HandShakeReply struct { Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=sentry.Protocol" json:"protocol,omitempty"` // contains filtered or unexported fields }
func (*HandShakeReply) Descriptor
deprecated
func (*HandShakeReply) Descriptor() ([]byte, []int)
Deprecated: Use HandShakeReply.ProtoReflect.Descriptor instead.
func (*HandShakeReply) GetProtocol ¶
func (x *HandShakeReply) GetProtocol() Protocol
func (*HandShakeReply) ProtoMessage ¶
func (*HandShakeReply) ProtoMessage()
func (*HandShakeReply) ProtoReflect ¶
func (x *HandShakeReply) ProtoReflect() protoreflect.Message
func (*HandShakeReply) Reset ¶
func (x *HandShakeReply) Reset()
func (*HandShakeReply) String ¶
func (x *HandShakeReply) String() string
type InboundMessage ¶
type InboundMessage struct { Id MessageId `protobuf:"varint,1,opt,name=id,proto3,enum=sentry.MessageId" json:"id,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` PeerId *types.H512 `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // contains filtered or unexported fields }
func (*InboundMessage) Descriptor
deprecated
func (*InboundMessage) Descriptor() ([]byte, []int)
Deprecated: Use InboundMessage.ProtoReflect.Descriptor instead.
func (*InboundMessage) GetData ¶
func (x *InboundMessage) GetData() []byte
func (*InboundMessage) GetId ¶
func (x *InboundMessage) GetId() MessageId
func (*InboundMessage) GetPeerId ¶
func (x *InboundMessage) GetPeerId() *types.H512
func (*InboundMessage) ProtoMessage ¶
func (*InboundMessage) ProtoMessage()
func (*InboundMessage) ProtoReflect ¶
func (x *InboundMessage) ProtoReflect() protoreflect.Message
func (*InboundMessage) Reset ¶
func (x *InboundMessage) Reset()
func (*InboundMessage) String ¶
func (x *InboundMessage) String() string
type MessageId ¶
type MessageId int32
const ( MessageId_STATUS_65 MessageId = 0 MessageId_GET_BLOCK_HEADERS_65 MessageId = 1 MessageId_BLOCK_HEADERS_65 MessageId = 2 MessageId_BLOCK_HASHES_65 MessageId = 3 MessageId_GET_BLOCK_BODIES_65 MessageId = 4 MessageId_BLOCK_BODIES_65 MessageId = 5 MessageId_GET_NODE_DATA_65 MessageId = 6 MessageId_NODE_DATA_65 MessageId = 7 MessageId_GET_RECEIPTS_65 MessageId = 8 MessageId_RECEIPTS_65 MessageId = 9 MessageId_NEW_BLOCK_HASHES_65 MessageId = 10 MessageId_NEW_BLOCK_65 MessageId = 11 MessageId_TRANSACTIONS_65 MessageId = 12 MessageId_NEW_POOLED_TRANSACTION_HASHES_65 MessageId = 13 MessageId_GET_POOLED_TRANSACTIONS_65 MessageId = 14 MessageId_POOLED_TRANSACTIONS_65 MessageId = 15 // eth64 announcement messages (no id) MessageId_STATUS_66 MessageId = 17 MessageId_NEW_BLOCK_HASHES_66 MessageId = 18 MessageId_NEW_BLOCK_66 MessageId = 19 MessageId_TRANSACTIONS_66 MessageId = 20 // eth65 announcement messages (no id) MessageId_NEW_POOLED_TRANSACTION_HASHES_66 MessageId = 21 // eth66 messages with request-id MessageId_GET_BLOCK_HEADERS_66 MessageId = 22 MessageId_GET_BLOCK_BODIES_66 MessageId = 23 MessageId_GET_NODE_DATA_66 MessageId = 24 MessageId_GET_RECEIPTS_66 MessageId = 25 MessageId_GET_POOLED_TRANSACTIONS_66 MessageId = 26 MessageId_BLOCK_HEADERS_66 MessageId = 27 MessageId_BLOCK_BODIES_66 MessageId = 28 MessageId_NODE_DATA_66 MessageId = 29 MessageId_RECEIPTS_66 MessageId = 30 MessageId_POOLED_TRANSACTIONS_66 MessageId = 31 // ======= eth 68 protocol =========== MessageId_NEW_POOLED_TRANSACTION_HASHES_68 MessageId = 32 )
func (MessageId) Descriptor ¶
func (MessageId) Descriptor() protoreflect.EnumDescriptor
func (MessageId) EnumDescriptor
deprecated
func (MessageId) Number ¶
func (x MessageId) Number() protoreflect.EnumNumber
func (MessageId) Type ¶
func (MessageId) Type() protoreflect.EnumType
type MessagesRequest ¶
type MessagesRequest struct { Ids []MessageId `protobuf:"varint,1,rep,packed,name=ids,proto3,enum=sentry.MessageId" json:"ids,omitempty"` // contains filtered or unexported fields }
func (*MessagesRequest) Descriptor
deprecated
func (*MessagesRequest) Descriptor() ([]byte, []int)
Deprecated: Use MessagesRequest.ProtoReflect.Descriptor instead.
func (*MessagesRequest) GetIds ¶
func (x *MessagesRequest) GetIds() []MessageId
func (*MessagesRequest) ProtoMessage ¶
func (*MessagesRequest) ProtoMessage()
func (*MessagesRequest) ProtoReflect ¶
func (x *MessagesRequest) ProtoReflect() protoreflect.Message
func (*MessagesRequest) Reset ¶
func (x *MessagesRequest) Reset()
func (*MessagesRequest) String ¶
func (x *MessagesRequest) String() string
type OutboundMessageData ¶
type OutboundMessageData struct { Id MessageId `protobuf:"varint,1,opt,name=id,proto3,enum=sentry.MessageId" json:"id,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*OutboundMessageData) Descriptor
deprecated
func (*OutboundMessageData) Descriptor() ([]byte, []int)
Deprecated: Use OutboundMessageData.ProtoReflect.Descriptor instead.
func (*OutboundMessageData) GetData ¶
func (x *OutboundMessageData) GetData() []byte
func (*OutboundMessageData) GetId ¶
func (x *OutboundMessageData) GetId() MessageId
func (*OutboundMessageData) ProtoMessage ¶
func (*OutboundMessageData) ProtoMessage()
func (*OutboundMessageData) ProtoReflect ¶
func (x *OutboundMessageData) ProtoReflect() protoreflect.Message
func (*OutboundMessageData) Reset ¶
func (x *OutboundMessageData) Reset()
func (*OutboundMessageData) String ¶
func (x *OutboundMessageData) String() string
type PeerByIdReply ¶
type PeerByIdReply struct { Peer *types.PeerInfo `protobuf:"bytes,1,opt,name=peer,proto3,oneof" json:"peer,omitempty"` // contains filtered or unexported fields }
func (*PeerByIdReply) Descriptor
deprecated
func (*PeerByIdReply) Descriptor() ([]byte, []int)
Deprecated: Use PeerByIdReply.ProtoReflect.Descriptor instead.
func (*PeerByIdReply) GetPeer ¶
func (x *PeerByIdReply) GetPeer() *types.PeerInfo
func (*PeerByIdReply) ProtoMessage ¶
func (*PeerByIdReply) ProtoMessage()
func (*PeerByIdReply) ProtoReflect ¶
func (x *PeerByIdReply) ProtoReflect() protoreflect.Message
func (*PeerByIdReply) Reset ¶
func (x *PeerByIdReply) Reset()
func (*PeerByIdReply) String ¶
func (x *PeerByIdReply) String() string
type PeerByIdRequest ¶
type PeerByIdRequest struct { PeerId *types.H512 `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // contains filtered or unexported fields }
func (*PeerByIdRequest) Descriptor
deprecated
func (*PeerByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerByIdRequest.ProtoReflect.Descriptor instead.
func (*PeerByIdRequest) GetPeerId ¶
func (x *PeerByIdRequest) GetPeerId() *types.H512
func (*PeerByIdRequest) ProtoMessage ¶
func (*PeerByIdRequest) ProtoMessage()
func (*PeerByIdRequest) ProtoReflect ¶
func (x *PeerByIdRequest) ProtoReflect() protoreflect.Message
func (*PeerByIdRequest) Reset ¶
func (x *PeerByIdRequest) Reset()
func (*PeerByIdRequest) String ¶
func (x *PeerByIdRequest) String() string
type PeerCountPerProtocol ¶
type PeerCountPerProtocol struct { Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=sentry.Protocol" json:"protocol,omitempty"` Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*PeerCountPerProtocol) Descriptor
deprecated
func (*PeerCountPerProtocol) Descriptor() ([]byte, []int)
Deprecated: Use PeerCountPerProtocol.ProtoReflect.Descriptor instead.
func (*PeerCountPerProtocol) GetCount ¶
func (x *PeerCountPerProtocol) GetCount() uint64
func (*PeerCountPerProtocol) GetProtocol ¶
func (x *PeerCountPerProtocol) GetProtocol() Protocol
func (*PeerCountPerProtocol) ProtoMessage ¶
func (*PeerCountPerProtocol) ProtoMessage()
func (*PeerCountPerProtocol) ProtoReflect ¶
func (x *PeerCountPerProtocol) ProtoReflect() protoreflect.Message
func (*PeerCountPerProtocol) Reset ¶
func (x *PeerCountPerProtocol) Reset()
func (*PeerCountPerProtocol) String ¶
func (x *PeerCountPerProtocol) String() string
type PeerCountReply ¶
type PeerCountReply struct { Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` CountsPerProtocol []*PeerCountPerProtocol `protobuf:"bytes,2,rep,name=counts_per_protocol,json=countsPerProtocol,proto3" json:"counts_per_protocol,omitempty"` // contains filtered or unexported fields }
func (*PeerCountReply) Descriptor
deprecated
func (*PeerCountReply) Descriptor() ([]byte, []int)
Deprecated: Use PeerCountReply.ProtoReflect.Descriptor instead.
func (*PeerCountReply) GetCount ¶
func (x *PeerCountReply) GetCount() uint64
func (*PeerCountReply) GetCountsPerProtocol ¶
func (x *PeerCountReply) GetCountsPerProtocol() []*PeerCountPerProtocol
func (*PeerCountReply) ProtoMessage ¶
func (*PeerCountReply) ProtoMessage()
func (*PeerCountReply) ProtoReflect ¶
func (x *PeerCountReply) ProtoReflect() protoreflect.Message
func (*PeerCountReply) Reset ¶
func (x *PeerCountReply) Reset()
func (*PeerCountReply) String ¶
func (x *PeerCountReply) String() string
type PeerCountRequest ¶
type PeerCountRequest struct {
// contains filtered or unexported fields
}
func (*PeerCountRequest) Descriptor
deprecated
func (*PeerCountRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerCountRequest.ProtoReflect.Descriptor instead.
func (*PeerCountRequest) ProtoMessage ¶
func (*PeerCountRequest) ProtoMessage()
func (*PeerCountRequest) ProtoReflect ¶
func (x *PeerCountRequest) ProtoReflect() protoreflect.Message
func (*PeerCountRequest) Reset ¶
func (x *PeerCountRequest) Reset()
func (*PeerCountRequest) String ¶
func (x *PeerCountRequest) String() string
type PeerEvent ¶
type PeerEvent struct { PeerId *types.H512 `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` EventId PeerEvent_PeerEventId `protobuf:"varint,2,opt,name=event_id,json=eventId,proto3,enum=sentry.PeerEvent_PeerEventId" json:"event_id,omitempty"` // contains filtered or unexported fields }
func (*PeerEvent) Descriptor
deprecated
func (*PeerEvent) GetEventId ¶
func (x *PeerEvent) GetEventId() PeerEvent_PeerEventId
func (*PeerEvent) ProtoMessage ¶
func (*PeerEvent) ProtoMessage()
func (*PeerEvent) ProtoReflect ¶
func (x *PeerEvent) ProtoReflect() protoreflect.Message
type PeerEvent_PeerEventId ¶
type PeerEvent_PeerEventId int32
const ( // Happens after after a successful sub-protocol handshake. PeerEvent_Connect PeerEvent_PeerEventId = 0 PeerEvent_Disconnect PeerEvent_PeerEventId = 1 )
func (PeerEvent_PeerEventId) Descriptor ¶
func (PeerEvent_PeerEventId) Descriptor() protoreflect.EnumDescriptor
func (PeerEvent_PeerEventId) Enum ¶
func (x PeerEvent_PeerEventId) Enum() *PeerEvent_PeerEventId
func (PeerEvent_PeerEventId) EnumDescriptor
deprecated
func (PeerEvent_PeerEventId) EnumDescriptor() ([]byte, []int)
Deprecated: Use PeerEvent_PeerEventId.Descriptor instead.
func (PeerEvent_PeerEventId) Number ¶
func (x PeerEvent_PeerEventId) Number() protoreflect.EnumNumber
func (PeerEvent_PeerEventId) String ¶
func (x PeerEvent_PeerEventId) String() string
func (PeerEvent_PeerEventId) Type ¶
func (PeerEvent_PeerEventId) Type() protoreflect.EnumType
type PeerEventsRequest ¶
type PeerEventsRequest struct {
// contains filtered or unexported fields
}
func (*PeerEventsRequest) Descriptor
deprecated
func (*PeerEventsRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerEventsRequest.ProtoReflect.Descriptor instead.
func (*PeerEventsRequest) ProtoMessage ¶
func (*PeerEventsRequest) ProtoMessage()
func (*PeerEventsRequest) ProtoReflect ¶
func (x *PeerEventsRequest) ProtoReflect() protoreflect.Message
func (*PeerEventsRequest) Reset ¶
func (x *PeerEventsRequest) Reset()
func (*PeerEventsRequest) String ¶
func (x *PeerEventsRequest) String() string
type PeerMinBlockRequest ¶
type PeerMinBlockRequest struct { PeerId *types.H512 `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` MinBlock uint64 `protobuf:"varint,2,opt,name=min_block,json=minBlock,proto3" json:"min_block,omitempty"` // contains filtered or unexported fields }
func (*PeerMinBlockRequest) Descriptor
deprecated
func (*PeerMinBlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerMinBlockRequest.ProtoReflect.Descriptor instead.
func (*PeerMinBlockRequest) GetMinBlock ¶
func (x *PeerMinBlockRequest) GetMinBlock() uint64
func (*PeerMinBlockRequest) GetPeerId ¶
func (x *PeerMinBlockRequest) GetPeerId() *types.H512
func (*PeerMinBlockRequest) ProtoMessage ¶
func (*PeerMinBlockRequest) ProtoMessage()
func (*PeerMinBlockRequest) ProtoReflect ¶
func (x *PeerMinBlockRequest) ProtoReflect() protoreflect.Message
func (*PeerMinBlockRequest) Reset ¶
func (x *PeerMinBlockRequest) Reset()
func (*PeerMinBlockRequest) String ¶
func (x *PeerMinBlockRequest) String() string
type PeersReply ¶
type PeersReply struct { Peers []*types.PeerInfo `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*PeersReply) Descriptor
deprecated
func (*PeersReply) Descriptor() ([]byte, []int)
Deprecated: Use PeersReply.ProtoReflect.Descriptor instead.
func (*PeersReply) GetPeers ¶
func (x *PeersReply) GetPeers() []*types.PeerInfo
func (*PeersReply) ProtoMessage ¶
func (*PeersReply) ProtoMessage()
func (*PeersReply) ProtoReflect ¶
func (x *PeersReply) ProtoReflect() protoreflect.Message
func (*PeersReply) Reset ¶
func (x *PeersReply) Reset()
func (*PeersReply) String ¶
func (x *PeersReply) String() string
type PenalizePeerRequest ¶
type PenalizePeerRequest struct { PeerId *types.H512 `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` Penalty PenaltyKind `protobuf:"varint,2,opt,name=penalty,proto3,enum=sentry.PenaltyKind" json:"penalty,omitempty"` // contains filtered or unexported fields }
func (*PenalizePeerRequest) Descriptor
deprecated
func (*PenalizePeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use PenalizePeerRequest.ProtoReflect.Descriptor instead.
func (*PenalizePeerRequest) GetPeerId ¶
func (x *PenalizePeerRequest) GetPeerId() *types.H512
func (*PenalizePeerRequest) GetPenalty ¶
func (x *PenalizePeerRequest) GetPenalty() PenaltyKind
func (*PenalizePeerRequest) ProtoMessage ¶
func (*PenalizePeerRequest) ProtoMessage()
func (*PenalizePeerRequest) ProtoReflect ¶
func (x *PenalizePeerRequest) ProtoReflect() protoreflect.Message
func (*PenalizePeerRequest) Reset ¶
func (x *PenalizePeerRequest) Reset()
func (*PenalizePeerRequest) String ¶
func (x *PenalizePeerRequest) String() string
type PenaltyKind ¶
type PenaltyKind int32
const (
PenaltyKind_Kick PenaltyKind = 0
)
func (PenaltyKind) Descriptor ¶
func (PenaltyKind) Descriptor() protoreflect.EnumDescriptor
func (PenaltyKind) Enum ¶
func (x PenaltyKind) Enum() *PenaltyKind
func (PenaltyKind) EnumDescriptor
deprecated
func (PenaltyKind) EnumDescriptor() ([]byte, []int)
Deprecated: Use PenaltyKind.Descriptor instead.
func (PenaltyKind) Number ¶
func (x PenaltyKind) Number() protoreflect.EnumNumber
func (PenaltyKind) String ¶
func (x PenaltyKind) String() string
func (PenaltyKind) Type ¶
func (PenaltyKind) Type() protoreflect.EnumType
type Protocol ¶
type Protocol int32
func (Protocol) Descriptor ¶
func (Protocol) Descriptor() protoreflect.EnumDescriptor
func (Protocol) EnumDescriptor
deprecated
func (Protocol) Number ¶
func (x Protocol) Number() protoreflect.EnumNumber
func (Protocol) Type ¶
func (Protocol) Type() protoreflect.EnumType
type SendMessageByIdRequest ¶
type SendMessageByIdRequest struct { Data *OutboundMessageData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` PeerId *types.H512 `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // contains filtered or unexported fields }
func (*SendMessageByIdRequest) Descriptor
deprecated
func (*SendMessageByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageByIdRequest.ProtoReflect.Descriptor instead.
func (*SendMessageByIdRequest) GetData ¶
func (x *SendMessageByIdRequest) GetData() *OutboundMessageData
func (*SendMessageByIdRequest) GetPeerId ¶
func (x *SendMessageByIdRequest) GetPeerId() *types.H512
func (*SendMessageByIdRequest) ProtoMessage ¶
func (*SendMessageByIdRequest) ProtoMessage()
func (*SendMessageByIdRequest) ProtoReflect ¶
func (x *SendMessageByIdRequest) ProtoReflect() protoreflect.Message
func (*SendMessageByIdRequest) Reset ¶
func (x *SendMessageByIdRequest) Reset()
func (*SendMessageByIdRequest) String ¶
func (x *SendMessageByIdRequest) String() string
type SendMessageByMinBlockRequest ¶
type SendMessageByMinBlockRequest struct { Data *OutboundMessageData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` MinBlock uint64 `protobuf:"varint,2,opt,name=min_block,json=minBlock,proto3" json:"min_block,omitempty"` MaxPeers uint64 `protobuf:"varint,3,opt,name=max_peers,json=maxPeers,proto3" json:"max_peers,omitempty"` // contains filtered or unexported fields }
func (*SendMessageByMinBlockRequest) Descriptor
deprecated
func (*SendMessageByMinBlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageByMinBlockRequest.ProtoReflect.Descriptor instead.
func (*SendMessageByMinBlockRequest) GetData ¶
func (x *SendMessageByMinBlockRequest) GetData() *OutboundMessageData
func (*SendMessageByMinBlockRequest) GetMaxPeers ¶
func (x *SendMessageByMinBlockRequest) GetMaxPeers() uint64
func (*SendMessageByMinBlockRequest) GetMinBlock ¶
func (x *SendMessageByMinBlockRequest) GetMinBlock() uint64
func (*SendMessageByMinBlockRequest) ProtoMessage ¶
func (*SendMessageByMinBlockRequest) ProtoMessage()
func (*SendMessageByMinBlockRequest) ProtoReflect ¶
func (x *SendMessageByMinBlockRequest) ProtoReflect() protoreflect.Message
func (*SendMessageByMinBlockRequest) Reset ¶
func (x *SendMessageByMinBlockRequest) Reset()
func (*SendMessageByMinBlockRequest) String ¶
func (x *SendMessageByMinBlockRequest) String() string
type SendMessageToRandomPeersRequest ¶
type SendMessageToRandomPeersRequest struct { Data *OutboundMessageData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` MaxPeers uint64 `protobuf:"varint,2,opt,name=max_peers,json=maxPeers,proto3" json:"max_peers,omitempty"` // contains filtered or unexported fields }
func (*SendMessageToRandomPeersRequest) Descriptor
deprecated
func (*SendMessageToRandomPeersRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageToRandomPeersRequest.ProtoReflect.Descriptor instead.
func (*SendMessageToRandomPeersRequest) GetData ¶
func (x *SendMessageToRandomPeersRequest) GetData() *OutboundMessageData
func (*SendMessageToRandomPeersRequest) GetMaxPeers ¶
func (x *SendMessageToRandomPeersRequest) GetMaxPeers() uint64
func (*SendMessageToRandomPeersRequest) ProtoMessage ¶
func (*SendMessageToRandomPeersRequest) ProtoMessage()
func (*SendMessageToRandomPeersRequest) ProtoReflect ¶
func (x *SendMessageToRandomPeersRequest) ProtoReflect() protoreflect.Message
func (*SendMessageToRandomPeersRequest) Reset ¶
func (x *SendMessageToRandomPeersRequest) Reset()
func (*SendMessageToRandomPeersRequest) String ¶
func (x *SendMessageToRandomPeersRequest) String() string
type SentPeers ¶
type SentPeers struct { Peers []*types.H512 `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*SentPeers) Descriptor
deprecated
func (*SentPeers) ProtoMessage ¶
func (*SentPeers) ProtoMessage()
func (*SentPeers) ProtoReflect ¶
func (x *SentPeers) ProtoReflect() protoreflect.Message
type SentryClient ¶
type SentryClient interface { // SetStatus - force new ETH client state of sentry - network_id, max_block, etc... SetStatus(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) PenalizePeer(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) PeerMinBlock(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // HandShake - pre-requirement for all Send* methods - returns list of ETH protocol versions, // without knowledge of protocol - impossible encode correct P2P message HandShake(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) SendMessageByMinBlock(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) SendMessageById(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) SendMessageToRandomPeers(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) SendMessageToAll(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) // Subscribe to receive messages. // Calling multiple times with a different set of ids starts separate streams. // It is possible to subscribe to the same set if ids more than once. Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) Peers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) PeerById(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) // Subscribe to notifications about connected or lost peers. PeerEvents(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) // NodeInfo returns a collection of metadata known about the host. NodeInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) }
SentryClient is the client API for Sentry service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSentryClient ¶
func NewSentryClient(cc grpc.ClientConnInterface) SentryClient
type SentryClientMock ¶
type SentryClientMock struct { // HandShakeFunc mocks the HandShake method. HandShakeFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) // MessagesFunc mocks the Messages method. MessagesFunc func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) // NodeInfoFunc mocks the NodeInfo method. NodeInfoFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) // PeerByIdFunc mocks the PeerById method. PeerByIdFunc func(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) // PeerCountFunc mocks the PeerCount method. PeerCountFunc func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) // PeerEventsFunc mocks the PeerEvents method. PeerEventsFunc func(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) // PeerMinBlockFunc mocks the PeerMinBlock method. PeerMinBlockFunc func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // PeersFunc mocks the Peers method. PeersFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) // PenalizePeerFunc mocks the PenalizePeer method. PenalizePeerFunc func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // SendMessageByIdFunc mocks the SendMessageById method. SendMessageByIdFunc func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) // SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method. SendMessageByMinBlockFunc func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) // SendMessageToAllFunc mocks the SendMessageToAll method. SendMessageToAllFunc func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) // SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method. SendMessageToRandomPeersFunc func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) // SetStatusFunc mocks the SetStatus method. SetStatusFunc func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) // contains filtered or unexported fields }
SentryClientMock is a mock implementation of SentryClient.
func TestSomethingThatUsesSentryClient(t *testing.T) { // make and configure a mocked SentryClient mockedSentryClient := &SentryClientMock{ HandShakeFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) { panic("mock out the HandShake method") }, MessagesFunc: func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) { panic("mock out the Messages method") }, NodeInfoFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) { panic("mock out the NodeInfo method") }, PeerByIdFunc: func(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) { panic("mock out the PeerById method") }, PeerCountFunc: func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) { panic("mock out the PeerCount method") }, PeerEventsFunc: func(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) { panic("mock out the PeerEvents method") }, PeerMinBlockFunc: func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { panic("mock out the PeerMinBlock method") }, PeersFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) { panic("mock out the Peers method") }, PenalizePeerFunc: func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { panic("mock out the PenalizePeer method") }, SendMessageByIdFunc: func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) { panic("mock out the SendMessageById method") }, SendMessageByMinBlockFunc: func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) { panic("mock out the SendMessageByMinBlock method") }, SendMessageToAllFunc: func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) { panic("mock out the SendMessageToAll method") }, SendMessageToRandomPeersFunc: func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) { panic("mock out the SendMessageToRandomPeers method") }, SetStatusFunc: func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) { panic("mock out the SetStatus method") }, } // use mockedSentryClient in code that requires SentryClient // and then make assertions. }
func (*SentryClientMock) HandShake ¶
func (mock *SentryClientMock) HandShake(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error)
HandShake calls HandShakeFunc.
func (*SentryClientMock) HandShakeCalls ¶
func (mock *SentryClientMock) HandShakeCalls() []struct { Ctx context.Context In *emptypb.Empty Opts []grpc.CallOption }
HandShakeCalls gets all the calls that were made to HandShake. Check the length with:
len(mockedSentryClient.HandShakeCalls())
func (*SentryClientMock) Messages ¶
func (mock *SentryClientMock) Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error)
Messages calls MessagesFunc.
func (*SentryClientMock) MessagesCalls ¶
func (mock *SentryClientMock) MessagesCalls() []struct { Ctx context.Context In *MessagesRequest Opts []grpc.CallOption }
MessagesCalls gets all the calls that were made to Messages. Check the length with:
len(mockedSentryClient.MessagesCalls())
func (*SentryClientMock) NodeInfo ¶
func (mock *SentryClientMock) NodeInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error)
NodeInfo calls NodeInfoFunc.
func (*SentryClientMock) NodeInfoCalls ¶
func (mock *SentryClientMock) NodeInfoCalls() []struct { Ctx context.Context In *emptypb.Empty Opts []grpc.CallOption }
NodeInfoCalls gets all the calls that were made to NodeInfo. Check the length with:
len(mockedSentryClient.NodeInfoCalls())
func (*SentryClientMock) PeerById ¶
func (mock *SentryClientMock) PeerById(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error)
PeerById calls PeerByIdFunc.
func (*SentryClientMock) PeerByIdCalls ¶
func (mock *SentryClientMock) PeerByIdCalls() []struct { Ctx context.Context In *PeerByIdRequest Opts []grpc.CallOption }
PeerByIdCalls gets all the calls that were made to PeerById. Check the length with:
len(mockedSentryClient.PeerByIdCalls())
func (*SentryClientMock) PeerCount ¶
func (mock *SentryClientMock) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error)
PeerCount calls PeerCountFunc.
func (*SentryClientMock) PeerCountCalls ¶
func (mock *SentryClientMock) PeerCountCalls() []struct { Ctx context.Context In *PeerCountRequest Opts []grpc.CallOption }
PeerCountCalls gets all the calls that were made to PeerCount. Check the length with:
len(mockedSentryClient.PeerCountCalls())
func (*SentryClientMock) PeerEvents ¶
func (mock *SentryClientMock) PeerEvents(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error)
PeerEvents calls PeerEventsFunc.
func (*SentryClientMock) PeerEventsCalls ¶
func (mock *SentryClientMock) PeerEventsCalls() []struct { Ctx context.Context In *PeerEventsRequest Opts []grpc.CallOption }
PeerEventsCalls gets all the calls that were made to PeerEvents. Check the length with:
len(mockedSentryClient.PeerEventsCalls())
func (*SentryClientMock) PeerMinBlock ¶
func (mock *SentryClientMock) PeerMinBlock(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
PeerMinBlock calls PeerMinBlockFunc.
func (*SentryClientMock) PeerMinBlockCalls ¶
func (mock *SentryClientMock) PeerMinBlockCalls() []struct { Ctx context.Context In *PeerMinBlockRequest Opts []grpc.CallOption }
PeerMinBlockCalls gets all the calls that were made to PeerMinBlock. Check the length with:
len(mockedSentryClient.PeerMinBlockCalls())
func (*SentryClientMock) Peers ¶
func (mock *SentryClientMock) Peers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error)
Peers calls PeersFunc.
func (*SentryClientMock) PeersCalls ¶
func (mock *SentryClientMock) PeersCalls() []struct { Ctx context.Context In *emptypb.Empty Opts []grpc.CallOption }
PeersCalls gets all the calls that were made to Peers. Check the length with:
len(mockedSentryClient.PeersCalls())
func (*SentryClientMock) PenalizePeer ¶
func (mock *SentryClientMock) PenalizePeer(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
PenalizePeer calls PenalizePeerFunc.
func (*SentryClientMock) PenalizePeerCalls ¶
func (mock *SentryClientMock) PenalizePeerCalls() []struct { Ctx context.Context In *PenalizePeerRequest Opts []grpc.CallOption }
PenalizePeerCalls gets all the calls that were made to PenalizePeer. Check the length with:
len(mockedSentryClient.PenalizePeerCalls())
func (*SentryClientMock) SendMessageById ¶
func (mock *SentryClientMock) SendMessageById(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error)
SendMessageById calls SendMessageByIdFunc.
func (*SentryClientMock) SendMessageByIdCalls ¶
func (mock *SentryClientMock) SendMessageByIdCalls() []struct { Ctx context.Context In *SendMessageByIdRequest Opts []grpc.CallOption }
SendMessageByIdCalls gets all the calls that were made to SendMessageById. Check the length with:
len(mockedSentryClient.SendMessageByIdCalls())
func (*SentryClientMock) SendMessageByMinBlock ¶
func (mock *SentryClientMock) SendMessageByMinBlock(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error)
SendMessageByMinBlock calls SendMessageByMinBlockFunc.
func (*SentryClientMock) SendMessageByMinBlockCalls ¶
func (mock *SentryClientMock) SendMessageByMinBlockCalls() []struct { Ctx context.Context In *SendMessageByMinBlockRequest Opts []grpc.CallOption }
SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock. Check the length with:
len(mockedSentryClient.SendMessageByMinBlockCalls())
func (*SentryClientMock) SendMessageToAll ¶
func (mock *SentryClientMock) SendMessageToAll(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error)
SendMessageToAll calls SendMessageToAllFunc.
func (*SentryClientMock) SendMessageToAllCalls ¶
func (mock *SentryClientMock) SendMessageToAllCalls() []struct { Ctx context.Context In *OutboundMessageData Opts []grpc.CallOption }
SendMessageToAllCalls gets all the calls that were made to SendMessageToAll. Check the length with:
len(mockedSentryClient.SendMessageToAllCalls())
func (*SentryClientMock) SendMessageToRandomPeers ¶
func (mock *SentryClientMock) SendMessageToRandomPeers(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error)
SendMessageToRandomPeers calls SendMessageToRandomPeersFunc.
func (*SentryClientMock) SendMessageToRandomPeersCalls ¶
func (mock *SentryClientMock) SendMessageToRandomPeersCalls() []struct { Ctx context.Context In *SendMessageToRandomPeersRequest Opts []grpc.CallOption }
SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers. Check the length with:
len(mockedSentryClient.SendMessageToRandomPeersCalls())
func (*SentryClientMock) SetStatus ¶
func (mock *SentryClientMock) SetStatus(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error)
SetStatus calls SetStatusFunc.
func (*SentryClientMock) SetStatusCalls ¶
func (mock *SentryClientMock) SetStatusCalls() []struct { Ctx context.Context In *StatusData Opts []grpc.CallOption }
SetStatusCalls gets all the calls that were made to SetStatus. Check the length with:
len(mockedSentryClient.SetStatusCalls())
type SentryServer ¶
type SentryServer interface { // SetStatus - force new ETH client state of sentry - network_id, max_block, etc... SetStatus(context.Context, *StatusData) (*SetStatusReply, error) PenalizePeer(context.Context, *PenalizePeerRequest) (*emptypb.Empty, error) PeerMinBlock(context.Context, *PeerMinBlockRequest) (*emptypb.Empty, error) // HandShake - pre-requirement for all Send* methods - returns list of ETH protocol versions, // without knowledge of protocol - impossible encode correct P2P message HandShake(context.Context, *emptypb.Empty) (*HandShakeReply, error) SendMessageByMinBlock(context.Context, *SendMessageByMinBlockRequest) (*SentPeers, error) SendMessageById(context.Context, *SendMessageByIdRequest) (*SentPeers, error) SendMessageToRandomPeers(context.Context, *SendMessageToRandomPeersRequest) (*SentPeers, error) SendMessageToAll(context.Context, *OutboundMessageData) (*SentPeers, error) // Subscribe to receive messages. // Calling multiple times with a different set of ids starts separate streams. // It is possible to subscribe to the same set if ids more than once. Messages(*MessagesRequest, Sentry_MessagesServer) error Peers(context.Context, *emptypb.Empty) (*PeersReply, error) PeerCount(context.Context, *PeerCountRequest) (*PeerCountReply, error) PeerById(context.Context, *PeerByIdRequest) (*PeerByIdReply, error) // Subscribe to notifications about connected or lost peers. PeerEvents(*PeerEventsRequest, Sentry_PeerEventsServer) error // NodeInfo returns a collection of metadata known about the host. NodeInfo(context.Context, *emptypb.Empty) (*types.NodeInfoReply, error) // contains filtered or unexported methods }
SentryServer is the server API for Sentry service. All implementations must embed UnimplementedSentryServer for forward compatibility
type SentryServerMock ¶
type SentryServerMock struct { // HandShakeFunc mocks the HandShake method. HandShakeFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) // MessagesFunc mocks the Messages method. MessagesFunc func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error // NodeInfoFunc mocks the NodeInfo method. NodeInfoFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) // PeerByIdFunc mocks the PeerById method. PeerByIdFunc func(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error) // PeerCountFunc mocks the PeerCount method. PeerCountFunc func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) // PeerEventsFunc mocks the PeerEvents method. PeerEventsFunc func(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error // PeerMinBlockFunc mocks the PeerMinBlock method. PeerMinBlockFunc func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) // PeersFunc mocks the Peers method. PeersFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error) // PenalizePeerFunc mocks the PenalizePeer method. PenalizePeerFunc func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) // SendMessageByIdFunc mocks the SendMessageById method. SendMessageByIdFunc func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) // SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method. SendMessageByMinBlockFunc func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) // SendMessageToAllFunc mocks the SendMessageToAll method. SendMessageToAllFunc func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) // SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method. SendMessageToRandomPeersFunc func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) // SetStatusFunc mocks the SetStatus method. SetStatusFunc func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) // contains filtered or unexported fields }
SentryServerMock is a mock implementation of SentryServer.
func TestSomethingThatUsesSentryServer(t *testing.T) { // make and configure a mocked SentryServer mockedSentryServer := &SentryServerMock{ HandShakeFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) { panic("mock out the HandShake method") }, MessagesFunc: func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error { panic("mock out the Messages method") }, NodeInfoFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) { panic("mock out the NodeInfo method") }, PeerByIdFunc: func(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error) { panic("mock out the PeerById method") }, PeerCountFunc: func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) { panic("mock out the PeerCount method") }, PeerEventsFunc: func(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error { panic("mock out the PeerEvents method") }, PeerMinBlockFunc: func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) { panic("mock out the PeerMinBlock method") }, PeersFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error) { panic("mock out the Peers method") }, PenalizePeerFunc: func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) { panic("mock out the PenalizePeer method") }, SendMessageByIdFunc: func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) { panic("mock out the SendMessageById method") }, SendMessageByMinBlockFunc: func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) { panic("mock out the SendMessageByMinBlock method") }, SendMessageToAllFunc: func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) { panic("mock out the SendMessageToAll method") }, SendMessageToRandomPeersFunc: func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) { panic("mock out the SendMessageToRandomPeers method") }, SetStatusFunc: func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) { panic("mock out the SetStatus method") }, mustEmbedUnimplementedSentryServerFunc: func() { panic("mock out the mustEmbedUnimplementedSentryServer method") }, } // use mockedSentryServer in code that requires SentryServer // and then make assertions. }
func (*SentryServerMock) HandShake ¶
func (mock *SentryServerMock) HandShake(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error)
HandShake calls HandShakeFunc.
func (*SentryServerMock) HandShakeCalls ¶
func (mock *SentryServerMock) HandShakeCalls() []struct { ContextMoqParam context.Context Empty *emptypb.Empty }
HandShakeCalls gets all the calls that were made to HandShake. Check the length with:
len(mockedSentryServer.HandShakeCalls())
func (*SentryServerMock) Messages ¶
func (mock *SentryServerMock) Messages(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error
Messages calls MessagesFunc.
func (*SentryServerMock) MessagesCalls ¶
func (mock *SentryServerMock) MessagesCalls() []struct { MessagesRequest *MessagesRequest Sentry_MessagesServer Sentry_MessagesServer }
MessagesCalls gets all the calls that were made to Messages. Check the length with:
len(mockedSentryServer.MessagesCalls())
func (*SentryServerMock) NodeInfo ¶
func (mock *SentryServerMock) NodeInfo(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error)
NodeInfo calls NodeInfoFunc.
func (*SentryServerMock) NodeInfoCalls ¶
func (mock *SentryServerMock) NodeInfoCalls() []struct { ContextMoqParam context.Context Empty *emptypb.Empty }
NodeInfoCalls gets all the calls that were made to NodeInfo. Check the length with:
len(mockedSentryServer.NodeInfoCalls())
func (*SentryServerMock) PeerById ¶
func (mock *SentryServerMock) PeerById(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error)
PeerById calls PeerByIdFunc.
func (*SentryServerMock) PeerByIdCalls ¶
func (mock *SentryServerMock) PeerByIdCalls() []struct { ContextMoqParam context.Context PeerByIdRequest *PeerByIdRequest }
PeerByIdCalls gets all the calls that were made to PeerById. Check the length with:
len(mockedSentryServer.PeerByIdCalls())
func (*SentryServerMock) PeerCount ¶
func (mock *SentryServerMock) PeerCount(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error)
PeerCount calls PeerCountFunc.
func (*SentryServerMock) PeerCountCalls ¶
func (mock *SentryServerMock) PeerCountCalls() []struct { ContextMoqParam context.Context PeerCountRequest *PeerCountRequest }
PeerCountCalls gets all the calls that were made to PeerCount. Check the length with:
len(mockedSentryServer.PeerCountCalls())
func (*SentryServerMock) PeerEvents ¶
func (mock *SentryServerMock) PeerEvents(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error
PeerEvents calls PeerEventsFunc.
func (*SentryServerMock) PeerEventsCalls ¶
func (mock *SentryServerMock) PeerEventsCalls() []struct { PeerEventsRequest *PeerEventsRequest Sentry_PeerEventsServer Sentry_PeerEventsServer }
PeerEventsCalls gets all the calls that were made to PeerEvents. Check the length with:
len(mockedSentryServer.PeerEventsCalls())
func (*SentryServerMock) PeerMinBlock ¶
func (mock *SentryServerMock) PeerMinBlock(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error)
PeerMinBlock calls PeerMinBlockFunc.
func (*SentryServerMock) PeerMinBlockCalls ¶
func (mock *SentryServerMock) PeerMinBlockCalls() []struct { ContextMoqParam context.Context PeerMinBlockRequest *PeerMinBlockRequest }
PeerMinBlockCalls gets all the calls that were made to PeerMinBlock. Check the length with:
len(mockedSentryServer.PeerMinBlockCalls())
func (*SentryServerMock) Peers ¶
func (mock *SentryServerMock) Peers(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error)
Peers calls PeersFunc.
func (*SentryServerMock) PeersCalls ¶
func (mock *SentryServerMock) PeersCalls() []struct { ContextMoqParam context.Context Empty *emptypb.Empty }
PeersCalls gets all the calls that were made to Peers. Check the length with:
len(mockedSentryServer.PeersCalls())
func (*SentryServerMock) PenalizePeer ¶
func (mock *SentryServerMock) PenalizePeer(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error)
PenalizePeer calls PenalizePeerFunc.
func (*SentryServerMock) PenalizePeerCalls ¶
func (mock *SentryServerMock) PenalizePeerCalls() []struct { ContextMoqParam context.Context PenalizePeerRequest *PenalizePeerRequest }
PenalizePeerCalls gets all the calls that were made to PenalizePeer. Check the length with:
len(mockedSentryServer.PenalizePeerCalls())
func (*SentryServerMock) SendMessageById ¶
func (mock *SentryServerMock) SendMessageById(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error)
SendMessageById calls SendMessageByIdFunc.
func (*SentryServerMock) SendMessageByIdCalls ¶
func (mock *SentryServerMock) SendMessageByIdCalls() []struct { ContextMoqParam context.Context SendMessageByIdRequest *SendMessageByIdRequest }
SendMessageByIdCalls gets all the calls that were made to SendMessageById. Check the length with:
len(mockedSentryServer.SendMessageByIdCalls())
func (*SentryServerMock) SendMessageByMinBlock ¶
func (mock *SentryServerMock) SendMessageByMinBlock(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error)
SendMessageByMinBlock calls SendMessageByMinBlockFunc.
func (*SentryServerMock) SendMessageByMinBlockCalls ¶
func (mock *SentryServerMock) SendMessageByMinBlockCalls() []struct { ContextMoqParam context.Context SendMessageByMinBlockRequest *SendMessageByMinBlockRequest }
SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock. Check the length with:
len(mockedSentryServer.SendMessageByMinBlockCalls())
func (*SentryServerMock) SendMessageToAll ¶
func (mock *SentryServerMock) SendMessageToAll(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error)
SendMessageToAll calls SendMessageToAllFunc.
func (*SentryServerMock) SendMessageToAllCalls ¶
func (mock *SentryServerMock) SendMessageToAllCalls() []struct { ContextMoqParam context.Context OutboundMessageData *OutboundMessageData }
SendMessageToAllCalls gets all the calls that were made to SendMessageToAll. Check the length with:
len(mockedSentryServer.SendMessageToAllCalls())
func (*SentryServerMock) SendMessageToRandomPeers ¶
func (mock *SentryServerMock) SendMessageToRandomPeers(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error)
SendMessageToRandomPeers calls SendMessageToRandomPeersFunc.
func (*SentryServerMock) SendMessageToRandomPeersCalls ¶
func (mock *SentryServerMock) SendMessageToRandomPeersCalls() []struct { ContextMoqParam context.Context SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest }
SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers. Check the length with:
len(mockedSentryServer.SendMessageToRandomPeersCalls())
func (*SentryServerMock) SetStatus ¶
func (mock *SentryServerMock) SetStatus(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error)
SetStatus calls SetStatusFunc.
func (*SentryServerMock) SetStatusCalls ¶
func (mock *SentryServerMock) SetStatusCalls() []struct { ContextMoqParam context.Context StatusData *StatusData }
SetStatusCalls gets all the calls that were made to SetStatus. Check the length with:
len(mockedSentryServer.SetStatusCalls())
type Sentry_MessagesClient ¶
type Sentry_MessagesClient interface { Recv() (*InboundMessage, error) grpc.ClientStream }
type Sentry_MessagesServer ¶
type Sentry_MessagesServer interface { Send(*InboundMessage) error grpc.ServerStream }
type Sentry_PeerEventsClient ¶
type Sentry_PeerEventsClient interface { Recv() (*PeerEvent, error) grpc.ClientStream }
type Sentry_PeerEventsServer ¶
type Sentry_PeerEventsServer interface { Send(*PeerEvent) error grpc.ServerStream }
type SetStatusReply ¶
type SetStatusReply struct {
// contains filtered or unexported fields
}
func (*SetStatusReply) Descriptor
deprecated
func (*SetStatusReply) Descriptor() ([]byte, []int)
Deprecated: Use SetStatusReply.ProtoReflect.Descriptor instead.
func (*SetStatusReply) ProtoMessage ¶
func (*SetStatusReply) ProtoMessage()
func (*SetStatusReply) ProtoReflect ¶
func (x *SetStatusReply) ProtoReflect() protoreflect.Message
func (*SetStatusReply) Reset ¶
func (x *SetStatusReply) Reset()
func (*SetStatusReply) String ¶
func (x *SetStatusReply) String() string
type StatusData ¶
type StatusData struct { NetworkId uint64 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` TotalDifficulty *types.H256 `protobuf:"bytes,2,opt,name=total_difficulty,json=totalDifficulty,proto3" json:"total_difficulty,omitempty"` BestHash *types.H256 `protobuf:"bytes,3,opt,name=best_hash,json=bestHash,proto3" json:"best_hash,omitempty"` ForkData *Forks `protobuf:"bytes,4,opt,name=fork_data,json=forkData,proto3" json:"fork_data,omitempty"` MaxBlockHeight uint64 `protobuf:"varint,5,opt,name=max_block_height,json=maxBlockHeight,proto3" json:"max_block_height,omitempty"` MaxBlockTime uint64 `protobuf:"varint,6,opt,name=max_block_time,json=maxBlockTime,proto3" json:"max_block_time,omitempty"` // contains filtered or unexported fields }
func (*StatusData) Descriptor
deprecated
func (*StatusData) Descriptor() ([]byte, []int)
Deprecated: Use StatusData.ProtoReflect.Descriptor instead.
func (*StatusData) GetBestHash ¶
func (x *StatusData) GetBestHash() *types.H256
func (*StatusData) GetForkData ¶
func (x *StatusData) GetForkData() *Forks
func (*StatusData) GetMaxBlockHeight ¶
func (x *StatusData) GetMaxBlockHeight() uint64
func (*StatusData) GetMaxBlockTime ¶
func (x *StatusData) GetMaxBlockTime() uint64
func (*StatusData) GetNetworkId ¶
func (x *StatusData) GetNetworkId() uint64
func (*StatusData) GetTotalDifficulty ¶
func (x *StatusData) GetTotalDifficulty() *types.H256
func (*StatusData) ProtoMessage ¶
func (*StatusData) ProtoMessage()
func (*StatusData) ProtoReflect ¶
func (x *StatusData) ProtoReflect() protoreflect.Message
func (*StatusData) Reset ¶
func (x *StatusData) Reset()
func (*StatusData) String ¶
func (x *StatusData) String() string
type UnimplementedSentryServer ¶
type UnimplementedSentryServer struct { }
UnimplementedSentryServer must be embedded to have forward compatible implementations.
func (UnimplementedSentryServer) HandShake ¶
func (UnimplementedSentryServer) HandShake(context.Context, *emptypb.Empty) (*HandShakeReply, error)
func (UnimplementedSentryServer) Messages ¶
func (UnimplementedSentryServer) Messages(*MessagesRequest, Sentry_MessagesServer) error
func (UnimplementedSentryServer) NodeInfo ¶
func (UnimplementedSentryServer) NodeInfo(context.Context, *emptypb.Empty) (*types.NodeInfoReply, error)
func (UnimplementedSentryServer) PeerById ¶
func (UnimplementedSentryServer) PeerById(context.Context, *PeerByIdRequest) (*PeerByIdReply, error)
func (UnimplementedSentryServer) PeerCount ¶
func (UnimplementedSentryServer) PeerCount(context.Context, *PeerCountRequest) (*PeerCountReply, error)
func (UnimplementedSentryServer) PeerEvents ¶
func (UnimplementedSentryServer) PeerEvents(*PeerEventsRequest, Sentry_PeerEventsServer) error
func (UnimplementedSentryServer) PeerMinBlock ¶
func (UnimplementedSentryServer) PeerMinBlock(context.Context, *PeerMinBlockRequest) (*emptypb.Empty, error)
func (UnimplementedSentryServer) Peers ¶
func (UnimplementedSentryServer) Peers(context.Context, *emptypb.Empty) (*PeersReply, error)
func (UnimplementedSentryServer) PenalizePeer ¶
func (UnimplementedSentryServer) PenalizePeer(context.Context, *PenalizePeerRequest) (*emptypb.Empty, error)
func (UnimplementedSentryServer) SendMessageById ¶
func (UnimplementedSentryServer) SendMessageById(context.Context, *SendMessageByIdRequest) (*SentPeers, error)
func (UnimplementedSentryServer) SendMessageByMinBlock ¶
func (UnimplementedSentryServer) SendMessageByMinBlock(context.Context, *SendMessageByMinBlockRequest) (*SentPeers, error)
func (UnimplementedSentryServer) SendMessageToAll ¶
func (UnimplementedSentryServer) SendMessageToAll(context.Context, *OutboundMessageData) (*SentPeers, error)
func (UnimplementedSentryServer) SendMessageToRandomPeers ¶
func (UnimplementedSentryServer) SendMessageToRandomPeers(context.Context, *SendMessageToRandomPeersRequest) (*SentPeers, error)
func (UnimplementedSentryServer) SetStatus ¶
func (UnimplementedSentryServer) SetStatus(context.Context, *StatusData) (*SetStatusReply, error)
type UnsafeSentryServer ¶
type UnsafeSentryServer interface {
// contains filtered or unexported methods
}
UnsafeSentryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SentryServer will result in compilation errors.