sentinel

package
v0.0.0-...-ff78b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sentinel_SubscribeGossip_FullMethodName = "/sentinel.Sentinel/SubscribeGossip"
	Sentinel_SendRequest_FullMethodName     = "/sentinel.Sentinel/SendRequest"
	Sentinel_SetStatus_FullMethodName       = "/sentinel.Sentinel/SetStatus"
	Sentinel_GetPeers_FullMethodName        = "/sentinel.Sentinel/GetPeers"
	Sentinel_BanPeer_FullMethodName         = "/sentinel.Sentinel/BanPeer"
	Sentinel_UnbanPeer_FullMethodName       = "/sentinel.Sentinel/UnbanPeer"
	Sentinel_PenalizePeer_FullMethodName    = "/sentinel.Sentinel/PenalizePeer"
	Sentinel_RewardPeer_FullMethodName      = "/sentinel.Sentinel/RewardPeer"
	Sentinel_PublishGossip_FullMethodName   = "/sentinel.Sentinel/PublishGossip"
)

Variables

View Source
var (
	GossipType_name = map[int32]string{
		0: "BeaconBlockGossipType",
		1: "AggregateAndProofGossipType",
		2: "VoluntaryExitGossipType",
		3: "ProposerSlashingGossipType",
		4: "AttesterSlashingGossipType",
		5: "BlobSidecarType",
		6: "BlsToExecutionChangeGossipType",
	}
	GossipType_value = map[string]int32{
		"BeaconBlockGossipType":          0,
		"AggregateAndProofGossipType":    1,
		"VoluntaryExitGossipType":        2,
		"ProposerSlashingGossipType":     3,
		"AttesterSlashingGossipType":     4,
		"BlobSidecarType":                5,
		"BlsToExecutionChangeGossipType": 6,
	}
)

Enum value maps for GossipType.

View Source
var File_p2psentinel_sentinel_proto protoreflect.FileDescriptor
View Source
var Sentinel_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sentinel.Sentinel",
	HandlerType: (*SentinelServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendRequest",
			Handler:    _Sentinel_SendRequest_Handler,
		},
		{
			MethodName: "SetStatus",
			Handler:    _Sentinel_SetStatus_Handler,
		},
		{
			MethodName: "GetPeers",
			Handler:    _Sentinel_GetPeers_Handler,
		},
		{
			MethodName: "BanPeer",
			Handler:    _Sentinel_BanPeer_Handler,
		},
		{
			MethodName: "UnbanPeer",
			Handler:    _Sentinel_UnbanPeer_Handler,
		},
		{
			MethodName: "PenalizePeer",
			Handler:    _Sentinel_PenalizePeer_Handler,
		},
		{
			MethodName: "RewardPeer",
			Handler:    _Sentinel_RewardPeer_Handler,
		},
		{
			MethodName: "PublishGossip",
			Handler:    _Sentinel_PublishGossip_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeGossip",
			Handler:       _Sentinel_SubscribeGossip_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "p2psentinel/sentinel.proto",
}

Sentinel_ServiceDesc is the grpc.ServiceDesc for Sentinel service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSentinelServer

func RegisterSentinelServer(s grpc.ServiceRegistrar, srv SentinelServer)

Types

type EmptyMessage

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

func (*EmptyMessage) Descriptor deprecated

func (*EmptyMessage) Descriptor() ([]byte, []int)

Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead.

func (*EmptyMessage) ProtoMessage

func (*EmptyMessage) ProtoMessage()

func (*EmptyMessage) ProtoReflect

func (x *EmptyMessage) ProtoReflect() protoreflect.Message

func (*EmptyMessage) Reset

func (x *EmptyMessage) Reset()

func (*EmptyMessage) String

func (x *EmptyMessage) String() string

type GossipData

type GossipData struct {
	Data      []byte     `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // SSZ encoded data
	Type      GossipType `protobuf:"varint,2,opt,name=type,proto3,enum=sentinel.GossipType" json:"type,omitempty"`
	Peer      *Peer      `protobuf:"bytes,3,opt,name=peer,proto3,oneof" json:"peer,omitempty"`
	BlobIndex *uint32    `protobuf:"varint,4,opt,name=blob_index,json=blobIndex,proto3,oneof" json:"blob_index,omitempty"` // Blob identifier for EIP4844
	// contains filtered or unexported fields
}

func (*GossipData) Descriptor deprecated

func (*GossipData) Descriptor() ([]byte, []int)

Deprecated: Use GossipData.ProtoReflect.Descriptor instead.

func (*GossipData) GetBlobIndex

func (x *GossipData) GetBlobIndex() uint32

func (*GossipData) GetData

func (x *GossipData) GetData() []byte

func (*GossipData) GetPeer

func (x *GossipData) GetPeer() *Peer

func (*GossipData) GetType

func (x *GossipData) GetType() GossipType

func (*GossipData) ProtoMessage

func (*GossipData) ProtoMessage()

func (*GossipData) ProtoReflect

func (x *GossipData) ProtoReflect() protoreflect.Message

func (*GossipData) Reset

func (x *GossipData) Reset()

func (*GossipData) String

func (x *GossipData) String() string

type GossipType

type GossipType int32
const (
	// Global gossip topics.
	GossipType_BeaconBlockGossipType          GossipType = 0
	GossipType_AggregateAndProofGossipType    GossipType = 1
	GossipType_VoluntaryExitGossipType        GossipType = 2
	GossipType_ProposerSlashingGossipType     GossipType = 3
	GossipType_AttesterSlashingGossipType     GossipType = 4
	GossipType_BlobSidecarType                GossipType = 5
	GossipType_BlsToExecutionChangeGossipType GossipType = 6
)

func (GossipType) Descriptor

func (GossipType) Descriptor() protoreflect.EnumDescriptor

func (GossipType) Enum

func (x GossipType) Enum() *GossipType

func (GossipType) EnumDescriptor deprecated

func (GossipType) EnumDescriptor() ([]byte, []int)

Deprecated: Use GossipType.Descriptor instead.

func (GossipType) Number

func (x GossipType) Number() protoreflect.EnumNumber

func (GossipType) String

func (x GossipType) String() string

func (GossipType) Type

type Peer

type Peer struct {
	Pid string `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*Peer) Descriptor deprecated

func (*Peer) Descriptor() ([]byte, []int)

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetPid

func (x *Peer) GetPid() string

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect

func (x *Peer) ProtoReflect() protoreflect.Message

func (*Peer) Reset

func (x *Peer) Reset()

func (*Peer) String

func (x *Peer) String() string

type PeerCount

type PeerCount struct {
	Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*PeerCount) Descriptor deprecated

func (*PeerCount) Descriptor() ([]byte, []int)

Deprecated: Use PeerCount.ProtoReflect.Descriptor instead.

func (*PeerCount) GetAmount

func (x *PeerCount) GetAmount() uint64

func (*PeerCount) ProtoMessage

func (*PeerCount) ProtoMessage()

func (*PeerCount) ProtoReflect

func (x *PeerCount) ProtoReflect() protoreflect.Message

func (*PeerCount) Reset

func (x *PeerCount) Reset()

func (*PeerCount) String

func (x *PeerCount) String() string

type RequestData

type RequestData struct {
	Data  []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // SSZ encoded data
	Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestData) Descriptor deprecated

func (*RequestData) Descriptor() ([]byte, []int)

Deprecated: Use RequestData.ProtoReflect.Descriptor instead.

func (*RequestData) GetData

func (x *RequestData) GetData() []byte

func (*RequestData) GetTopic

func (x *RequestData) GetTopic() string

func (*RequestData) ProtoMessage

func (*RequestData) ProtoMessage()

func (*RequestData) ProtoReflect

func (x *RequestData) ProtoReflect() protoreflect.Message

func (*RequestData) Reset

func (x *RequestData) Reset()

func (*RequestData) String

func (x *RequestData) String() string

type ResponseData

type ResponseData struct {
	Data  []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`    // prefix-stripped SSZ encoded data
	Error bool   `protobuf:"varint,2,opt,name=error,proto3" json:"error,omitempty"` // did the peer encounter an error
	Peer  *Peer  `protobuf:"bytes,3,opt,name=peer,proto3" json:"peer,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseData) Descriptor deprecated

func (*ResponseData) Descriptor() ([]byte, []int)

Deprecated: Use ResponseData.ProtoReflect.Descriptor instead.

func (*ResponseData) GetData

func (x *ResponseData) GetData() []byte

func (*ResponseData) GetError

func (x *ResponseData) GetError() bool

func (*ResponseData) GetPeer

func (x *ResponseData) GetPeer() *Peer

func (*ResponseData) ProtoMessage

func (*ResponseData) ProtoMessage()

func (*ResponseData) ProtoReflect

func (x *ResponseData) ProtoReflect() protoreflect.Message

func (*ResponseData) Reset

func (x *ResponseData) Reset()

func (*ResponseData) String

func (x *ResponseData) String() string

type SentinelClient

type SentinelClient interface {
	SubscribeGossip(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (Sentinel_SubscribeGossipClient, error)
	SendRequest(ctx context.Context, in *RequestData, opts ...grpc.CallOption) (*ResponseData, error)
	SetStatus(ctx context.Context, in *Status, opts ...grpc.CallOption) (*EmptyMessage, error)
	GetPeers(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*PeerCount, error)
	BanPeer(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*EmptyMessage, error)
	UnbanPeer(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*EmptyMessage, error)
	PenalizePeer(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*EmptyMessage, error)
	RewardPeer(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*EmptyMessage, error)
	PublishGossip(ctx context.Context, in *GossipData, opts ...grpc.CallOption) (*EmptyMessage, error)
}

SentinelClient is the client API for Sentinel 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 NewSentinelClient

func NewSentinelClient(cc grpc.ClientConnInterface) SentinelClient

type SentinelServer

type SentinelServer interface {
	SubscribeGossip(*EmptyMessage, Sentinel_SubscribeGossipServer) error
	SendRequest(context.Context, *RequestData) (*ResponseData, error)
	SetStatus(context.Context, *Status) (*EmptyMessage, error)
	GetPeers(context.Context, *EmptyMessage) (*PeerCount, error)
	BanPeer(context.Context, *Peer) (*EmptyMessage, error)
	UnbanPeer(context.Context, *Peer) (*EmptyMessage, error)
	PenalizePeer(context.Context, *Peer) (*EmptyMessage, error)
	RewardPeer(context.Context, *Peer) (*EmptyMessage, error)
	PublishGossip(context.Context, *GossipData) (*EmptyMessage, error)
	// contains filtered or unexported methods
}

SentinelServer is the server API for Sentinel service. All implementations must embed UnimplementedSentinelServer for forward compatibility

type Sentinel_SubscribeGossipClient

type Sentinel_SubscribeGossipClient interface {
	Recv() (*GossipData, error)
	grpc.ClientStream
}

type Sentinel_SubscribeGossipServer

type Sentinel_SubscribeGossipServer interface {
	Send(*GossipData) error
	grpc.ServerStream
}

type Status

type Status struct {
	ForkDigest     uint32      `protobuf:"varint,1,opt,name=fork_digest,json=forkDigest,proto3" json:"fork_digest,omitempty"` // 4 bytes can be repressented in uint32.
	FinalizedRoot  *types.H256 `protobuf:"bytes,2,opt,name=finalized_root,json=finalizedRoot,proto3" json:"finalized_root,omitempty"`
	FinalizedEpoch uint64      `protobuf:"varint,3,opt,name=finalized_epoch,json=finalizedEpoch,proto3" json:"finalized_epoch,omitempty"`
	HeadRoot       *types.H256 `protobuf:"bytes,4,opt,name=head_root,json=headRoot,proto3" json:"head_root,omitempty"`
	HeadSlot       uint64      `protobuf:"varint,5,opt,name=head_slot,json=headSlot,proto3" json:"head_slot,omitempty"`
	// contains filtered or unexported fields
}

func (*Status) Descriptor deprecated

func (*Status) Descriptor() ([]byte, []int)

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetFinalizedEpoch

func (x *Status) GetFinalizedEpoch() uint64

func (*Status) GetFinalizedRoot

func (x *Status) GetFinalizedRoot() *types.H256

func (*Status) GetForkDigest

func (x *Status) GetForkDigest() uint32

func (*Status) GetHeadRoot

func (x *Status) GetHeadRoot() *types.H256

func (*Status) GetHeadSlot

func (x *Status) GetHeadSlot() uint64

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type UnimplementedSentinelServer

type UnimplementedSentinelServer struct {
}

UnimplementedSentinelServer must be embedded to have forward compatible implementations.

func (UnimplementedSentinelServer) BanPeer

func (UnimplementedSentinelServer) GetPeers

func (UnimplementedSentinelServer) PenalizePeer

func (UnimplementedSentinelServer) PublishGossip

func (UnimplementedSentinelServer) RewardPeer

func (UnimplementedSentinelServer) SendRequest

func (UnimplementedSentinelServer) SetStatus

func (UnimplementedSentinelServer) SubscribeGossip

func (UnimplementedSentinelServer) UnbanPeer

type UnsafeSentinelServer

type UnsafeSentinelServer interface {
	// contains filtered or unexported methods
}

UnsafeSentinelServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SentinelServer will result in compilation errors.

Jump to

Keyboard shortcuts

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