Documentation ¶
Index ¶
- Variables
- func RegisterV1Server(s grpc.ServiceRegistrar, srv V1Server)
- type GetBlocksRequest
- func (*GetBlocksRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlocksRequest) GetFrom() uint64
- func (x *GetBlocksRequest) GetTo() uint64
- func (*GetBlocksRequest) ProtoMessage()
- func (x *GetBlocksRequest) ProtoReflect() protoreflect.Message
- func (x *GetBlocksRequest) Reset()
- func (x *GetBlocksRequest) String() string
- type GetBlocksResponse
- func (*GetBlocksResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlocksResponse) GetBlocks() [][]byte
- func (x *GetBlocksResponse) GetFrom() uint64
- func (x *GetBlocksResponse) GetTo() uint64
- func (*GetBlocksResponse) ProtoMessage()
- func (x *GetBlocksResponse) ProtoReflect() protoreflect.Message
- func (x *GetBlocksResponse) Reset()
- func (x *GetBlocksResponse) String() string
- type GetCurrentResponse
- type GetHeadersRequest
- func (*GetHeadersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetHeadersRequest) GetAmount() int64
- func (x *GetHeadersRequest) GetHash() string
- func (x *GetHeadersRequest) GetNumber() int64
- func (x *GetHeadersRequest) GetSkip() int64
- func (*GetHeadersRequest) ProtoMessage()
- func (x *GetHeadersRequest) ProtoReflect() protoreflect.Message
- func (x *GetHeadersRequest) Reset()
- func (x *GetHeadersRequest) String() string
- type HashRequest
- func (h *HashRequest) DecodeHashes() ([]types.Hash, error)
- func (*HashRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HashRequest) GetHash() []string
- func (x *HashRequest) GetType() HashRequest_Type
- func (*HashRequest) ProtoMessage()
- func (x *HashRequest) ProtoReflect() protoreflect.Message
- func (x *HashRequest) Reset()
- func (x *HashRequest) String() string
- type HashRequest_Type
- func (HashRequest_Type) Descriptor() protoreflect.EnumDescriptor
- func (x HashRequest_Type) Enum() *HashRequest_Type
- func (HashRequest_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x HashRequest_Type) Number() protoreflect.EnumNumber
- func (x HashRequest_Type) String() string
- func (HashRequest_Type) Type() protoreflect.EnumType
- type NotifyReq
- type NumberRequest
- type Response
- type Response_Component
- func (*Response_Component) Descriptor() ([]byte, []int)deprecated
- func (x *Response_Component) GetSpec() *anypb.Any
- func (*Response_Component) ProtoMessage()
- func (x *Response_Component) ProtoReflect() protoreflect.Message
- func (x *Response_Component) Reset()
- func (x *Response_Component) String() string
- type SyncPeerStatus
- type UnimplementedV1Server
- func (UnimplementedV1Server) GetBlocks(context.Context, *GetBlocksRequest) (*GetBlocksResponse, error)
- func (UnimplementedV1Server) GetCurrent(context.Context, *emptypb.Empty) (*V1Status, error)
- func (UnimplementedV1Server) GetHeaders(context.Context, *GetHeadersRequest) (*Response, error)
- func (UnimplementedV1Server) GetObjectsByHash(context.Context, *HashRequest) (*Response, error)
- func (UnimplementedV1Server) GetStatus(context.Context, *emptypb.Empty) (*SyncPeerStatus, error)
- func (UnimplementedV1Server) Notify(context.Context, *NotifyReq) (*emptypb.Empty, error)
- type UnsafeV1Server
- type V1Client
- type V1Server
- type V1Status
- func (*V1Status) Descriptor() ([]byte, []int)deprecated
- func (x *V1Status) GetDifficulty() string
- func (x *V1Status) GetHash() string
- func (x *V1Status) GetNumber() uint64
- func (*V1Status) ProtoMessage()
- func (x *V1Status) ProtoReflect() protoreflect.Message
- func (x *V1Status) Reset()
- func (x *V1Status) String() string
Constants ¶
This section is empty.
Variables ¶
var ( HashRequest_Type_name = map[int32]string{ 0: "UNKNOWN", 1: "BODIES", 2: "RECEIPTS", } HashRequest_Type_value = map[string]int32{ "UNKNOWN": 0, "BODIES": 1, "RECEIPTS": 2, } )
Enum value maps for HashRequest_Type.
var File_protocol_proto_v1_proto protoreflect.FileDescriptor
var V1_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v1.V1", HandlerType: (*V1Server)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCurrent", Handler: _V1_GetCurrent_Handler, }, { MethodName: "GetObjectsByHash", Handler: _V1_GetObjectsByHash_Handler, }, { MethodName: "GetHeaders", Handler: _V1_GetHeaders_Handler, }, { MethodName: "Notify", Handler: _V1_Notify_Handler, }, { MethodName: "GetBlocks", Handler: _V1_GetBlocks_Handler, }, { MethodName: "GetStatus", Handler: _V1_GetStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protocol/proto/v1.proto", }
V1_ServiceDesc is the grpc.ServiceDesc for V1 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterV1Server ¶
func RegisterV1Server(s grpc.ServiceRegistrar, srv V1Server)
Types ¶
type GetBlocksRequest ¶ added in v1.2.1
type GetBlocksRequest struct { // The height of beginning block to sync From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` // The height of ending block to sync To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` // contains filtered or unexported fields }
GetBlocksRequest is a request for GetBlocks
func (*GetBlocksRequest) Descriptor
deprecated
added in
v1.2.1
func (*GetBlocksRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlocksRequest.ProtoReflect.Descriptor instead.
func (*GetBlocksRequest) GetFrom ¶ added in v1.2.1
func (x *GetBlocksRequest) GetFrom() uint64
func (*GetBlocksRequest) GetTo ¶ added in v1.2.1
func (x *GetBlocksRequest) GetTo() uint64
func (*GetBlocksRequest) ProtoMessage ¶ added in v1.2.1
func (*GetBlocksRequest) ProtoMessage()
func (*GetBlocksRequest) ProtoReflect ¶ added in v1.2.1
func (x *GetBlocksRequest) ProtoReflect() protoreflect.Message
func (*GetBlocksRequest) Reset ¶ added in v1.2.1
func (x *GetBlocksRequest) Reset()
func (*GetBlocksRequest) String ¶ added in v1.2.1
func (x *GetBlocksRequest) String() string
type GetBlocksResponse ¶ added in v1.2.1
type GetBlocksResponse struct { // The height of beginning block From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` // The height of ending block To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` // RLP encoded block data Blocks [][]byte `protobuf:"bytes,3,rep,name=blocks,proto3" json:"blocks,omitempty"` // contains filtered or unexported fields }
func (*GetBlocksResponse) Descriptor
deprecated
added in
v1.2.1
func (*GetBlocksResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlocksResponse.ProtoReflect.Descriptor instead.
func (*GetBlocksResponse) GetBlocks ¶ added in v1.2.1
func (x *GetBlocksResponse) GetBlocks() [][]byte
func (*GetBlocksResponse) GetFrom ¶ added in v1.2.1
func (x *GetBlocksResponse) GetFrom() uint64
func (*GetBlocksResponse) GetTo ¶ added in v1.2.1
func (x *GetBlocksResponse) GetTo() uint64
func (*GetBlocksResponse) ProtoMessage ¶ added in v1.2.1
func (*GetBlocksResponse) ProtoMessage()
func (*GetBlocksResponse) ProtoReflect ¶ added in v1.2.1
func (x *GetBlocksResponse) ProtoReflect() protoreflect.Message
func (*GetBlocksResponse) Reset ¶ added in v1.2.1
func (x *GetBlocksResponse) Reset()
func (*GetBlocksResponse) String ¶ added in v1.2.1
func (x *GetBlocksResponse) String() string
type GetCurrentResponse ¶
type GetCurrentResponse struct {
// contains filtered or unexported fields
}
func (*GetCurrentResponse) Descriptor
deprecated
func (*GetCurrentResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCurrentResponse.ProtoReflect.Descriptor instead.
func (*GetCurrentResponse) ProtoMessage ¶
func (*GetCurrentResponse) ProtoMessage()
func (*GetCurrentResponse) ProtoReflect ¶
func (x *GetCurrentResponse) ProtoReflect() protoreflect.Message
func (*GetCurrentResponse) Reset ¶
func (x *GetCurrentResponse) Reset()
func (*GetCurrentResponse) String ¶
func (x *GetCurrentResponse) String() string
type GetHeadersRequest ¶
type GetHeadersRequest struct { // Provide a number or hash Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // Provide a number or hash Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Skip int64 `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"` // Provide an amount not greater than 190 Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
func (*GetHeadersRequest) Descriptor
deprecated
func (*GetHeadersRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetHeadersRequest.ProtoReflect.Descriptor instead.
func (*GetHeadersRequest) GetAmount ¶
func (x *GetHeadersRequest) GetAmount() int64
func (*GetHeadersRequest) GetHash ¶
func (x *GetHeadersRequest) GetHash() string
func (*GetHeadersRequest) GetNumber ¶
func (x *GetHeadersRequest) GetNumber() int64
func (*GetHeadersRequest) GetSkip ¶
func (x *GetHeadersRequest) GetSkip() int64
func (*GetHeadersRequest) ProtoMessage ¶
func (*GetHeadersRequest) ProtoMessage()
func (*GetHeadersRequest) ProtoReflect ¶
func (x *GetHeadersRequest) ProtoReflect() protoreflect.Message
func (*GetHeadersRequest) Reset ¶
func (x *GetHeadersRequest) Reset()
func (*GetHeadersRequest) String ¶
func (x *GetHeadersRequest) String() string
type HashRequest ¶
type HashRequest struct { Hash []string `protobuf:"bytes,1,rep,name=hash,proto3" json:"hash,omitempty"` Type HashRequest_Type `protobuf:"varint,2,opt,name=type,proto3,enum=v1.HashRequest_Type" json:"type,omitempty"` // contains filtered or unexported fields }
func (*HashRequest) DecodeHashes ¶
func (h *HashRequest) DecodeHashes() ([]types.Hash, error)
DecodeHashes decode to types Hash in the request
func (*HashRequest) Descriptor
deprecated
func (*HashRequest) Descriptor() ([]byte, []int)
Deprecated: Use HashRequest.ProtoReflect.Descriptor instead.
func (*HashRequest) GetHash ¶
func (x *HashRequest) GetHash() []string
func (*HashRequest) GetType ¶
func (x *HashRequest) GetType() HashRequest_Type
func (*HashRequest) ProtoMessage ¶
func (*HashRequest) ProtoMessage()
func (*HashRequest) ProtoReflect ¶
func (x *HashRequest) ProtoReflect() protoreflect.Message
func (*HashRequest) Reset ¶
func (x *HashRequest) Reset()
func (*HashRequest) String ¶
func (x *HashRequest) String() string
type HashRequest_Type ¶
type HashRequest_Type int32
const ( HashRequest_UNKNOWN HashRequest_Type = 0 HashRequest_BODIES HashRequest_Type = 1 HashRequest_RECEIPTS HashRequest_Type = 2 )
func (HashRequest_Type) Descriptor ¶
func (HashRequest_Type) Descriptor() protoreflect.EnumDescriptor
func (HashRequest_Type) Enum ¶
func (x HashRequest_Type) Enum() *HashRequest_Type
func (HashRequest_Type) EnumDescriptor
deprecated
func (HashRequest_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use HashRequest_Type.Descriptor instead.
func (HashRequest_Type) Number ¶
func (x HashRequest_Type) Number() protoreflect.EnumNumber
func (HashRequest_Type) String ¶
func (x HashRequest_Type) String() string
func (HashRequest_Type) Type ¶
func (HashRequest_Type) Type() protoreflect.EnumType
type NotifyReq ¶
type NotifyReq struct { Status *V1Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` Raw *anypb.Any `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"` // contains filtered or unexported fields }
func (*NotifyReq) Descriptor
deprecated
func (*NotifyReq) ProtoMessage ¶
func (*NotifyReq) ProtoMessage()
func (*NotifyReq) ProtoReflect ¶
func (x *NotifyReq) ProtoReflect() protoreflect.Message
type NumberRequest ¶
type NumberRequest struct { Number []int64 `protobuf:"varint,1,rep,packed,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*NumberRequest) Descriptor
deprecated
func (*NumberRequest) Descriptor() ([]byte, []int)
Deprecated: Use NumberRequest.ProtoReflect.Descriptor instead.
func (*NumberRequest) GetNumber ¶
func (x *NumberRequest) GetNumber() []int64
func (*NumberRequest) ProtoMessage ¶
func (*NumberRequest) ProtoMessage()
func (*NumberRequest) ProtoReflect ¶
func (x *NumberRequest) ProtoReflect() protoreflect.Message
func (*NumberRequest) Reset ¶
func (x *NumberRequest) Reset()
func (*NumberRequest) String ¶
func (x *NumberRequest) String() string
type Response ¶
type Response struct { Objs []*Response_Component `protobuf:"bytes,1,rep,name=objs,proto3" json:"objs,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetObjs ¶
func (x *Response) GetObjs() []*Response_Component
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Response_Component ¶
type Response_Component struct { Spec *anypb.Any `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` // contains filtered or unexported fields }
func (*Response_Component) Descriptor
deprecated
func (*Response_Component) Descriptor() ([]byte, []int)
Deprecated: Use Response_Component.ProtoReflect.Descriptor instead.
func (*Response_Component) GetSpec ¶
func (x *Response_Component) GetSpec() *anypb.Any
func (*Response_Component) ProtoMessage ¶
func (*Response_Component) ProtoMessage()
func (*Response_Component) ProtoReflect ¶
func (x *Response_Component) ProtoReflect() protoreflect.Message
func (*Response_Component) Reset ¶
func (x *Response_Component) Reset()
func (*Response_Component) String ¶
func (x *Response_Component) String() string
type SyncPeerStatus ¶ added in v1.2.1
type SyncPeerStatus struct { // Latest block height Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
SyncPeerStatus contains peer status
func (*SyncPeerStatus) Descriptor
deprecated
added in
v1.2.1
func (*SyncPeerStatus) Descriptor() ([]byte, []int)
Deprecated: Use SyncPeerStatus.ProtoReflect.Descriptor instead.
func (*SyncPeerStatus) GetNumber ¶ added in v1.2.1
func (x *SyncPeerStatus) GetNumber() uint64
func (*SyncPeerStatus) ProtoMessage ¶ added in v1.2.1
func (*SyncPeerStatus) ProtoMessage()
func (*SyncPeerStatus) ProtoReflect ¶ added in v1.2.1
func (x *SyncPeerStatus) ProtoReflect() protoreflect.Message
func (*SyncPeerStatus) Reset ¶ added in v1.2.1
func (x *SyncPeerStatus) Reset()
func (*SyncPeerStatus) String ¶ added in v1.2.1
func (x *SyncPeerStatus) String() string
type UnimplementedV1Server ¶
type UnimplementedV1Server struct { }
UnimplementedV1Server must be embedded to have forward compatible implementations.
func (UnimplementedV1Server) GetBlocks ¶ added in v1.2.1
func (UnimplementedV1Server) GetBlocks(context.Context, *GetBlocksRequest) (*GetBlocksResponse, error)
func (UnimplementedV1Server) GetCurrent ¶
func (UnimplementedV1Server) GetHeaders ¶
func (UnimplementedV1Server) GetHeaders(context.Context, *GetHeadersRequest) (*Response, error)
func (UnimplementedV1Server) GetObjectsByHash ¶
func (UnimplementedV1Server) GetObjectsByHash(context.Context, *HashRequest) (*Response, error)
func (UnimplementedV1Server) GetStatus ¶ added in v1.2.1
func (UnimplementedV1Server) GetStatus(context.Context, *emptypb.Empty) (*SyncPeerStatus, error)
type UnsafeV1Server ¶
type UnsafeV1Server interface {
// contains filtered or unexported methods
}
UnsafeV1Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to V1Server will result in compilation errors.
type V1Client ¶
type V1Client interface { GetCurrent(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*V1Status, error) GetObjectsByHash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*Response, error) GetHeaders(ctx context.Context, in *GetHeadersRequest, opts ...grpc.CallOption) (*Response, error) Notify(ctx context.Context, in *NotifyReq, opts ...grpc.CallOption) (*emptypb.Empty, error) // Returns blocks from begin to end (which is determined by server) GetBlocks(ctx context.Context, in *GetBlocksRequest, opts ...grpc.CallOption) (*GetBlocksResponse, error) // Returns server's status GetStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SyncPeerStatus, error) }
V1Client is the client API for V1 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 NewV1Client ¶
func NewV1Client(cc grpc.ClientConnInterface) V1Client
type V1Server ¶
type V1Server interface { GetCurrent(context.Context, *emptypb.Empty) (*V1Status, error) GetObjectsByHash(context.Context, *HashRequest) (*Response, error) GetHeaders(context.Context, *GetHeadersRequest) (*Response, error) Notify(context.Context, *NotifyReq) (*emptypb.Empty, error) // Returns blocks from begin to end (which is determined by server) GetBlocks(context.Context, *GetBlocksRequest) (*GetBlocksResponse, error) // Returns server's status GetStatus(context.Context, *emptypb.Empty) (*SyncPeerStatus, error) // contains filtered or unexported methods }
V1Server is the server API for V1 service. All implementations must embed UnimplementedV1Server for forward compatibility
type V1Status ¶
type V1Status struct { Difficulty string `protobuf:"bytes,1,opt,name=difficulty,proto3" json:"difficulty,omitempty"` Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Number uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*V1Status) Descriptor
deprecated
func (*V1Status) GetDifficulty ¶
func (*V1Status) ProtoMessage ¶
func (*V1Status) ProtoMessage()
func (*V1Status) ProtoReflect ¶
func (x *V1Status) ProtoReflect() protoreflect.Message