HTTP Beacon APIs for node (#13010)

This commit is contained in:
Radosław Kapka
2023-10-11 22:18:49 +02:00
committed by GitHub
parent c5501f8775
commit a536612c39
32 changed files with 1093 additions and 3011 deletions

View File

@@ -10,7 +10,6 @@ proto_library(
"beacon_chain_service.proto",
"beacon_debug_service.proto",
"events_service.proto",
"node_service.proto",
"validator_service.proto",
"key_management.proto",
],

View File

@@ -1,412 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.23.3
// source: proto/eth/service/node_service.proto
package service
import (
context "context"
reflect "reflect"
v1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/descriptorpb"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_proto_eth_service_node_service_proto protoreflect.FileDescriptor
var file_proto_eth_service_node_service_proto_rawDesc = []byte{
0x0a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x1c, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x32, 0xab, 0x05, 0x0a, 0x0a, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x4e, 0x6f, 0x64,
0x65, 0x12, 0x70, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65,
0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x74, 0x79, 0x12, 0x6f, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73,
0x12, 0x1d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
0x31, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70,
0x65, 0x65, 0x72, 0x73, 0x12, 0x75, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12,
0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
0x31, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e,
0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x65, 0x65, 0x72,
0x73, 0x2f, 0x7b, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x09, 0x50,
0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x69,
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e,
0x6f, 0x64, 0x65, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x6d,
0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x1a, 0x20, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d,
0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31,
0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x61, 0x0a,
0x09, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74,
0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68,
0x42, 0x91, 0x01, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x10, 0x4e,
0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x14,
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_proto_eth_service_node_service_proto_goTypes = []interface{}{
(*emptypb.Empty)(nil), // 0: google.protobuf.Empty
(*v1.PeersRequest)(nil), // 1: ethereum.eth.v1.PeersRequest
(*v1.PeerRequest)(nil), // 2: ethereum.eth.v1.PeerRequest
(*v1.IdentityResponse)(nil), // 3: ethereum.eth.v1.IdentityResponse
(*v1.PeersResponse)(nil), // 4: ethereum.eth.v1.PeersResponse
(*v1.PeerResponse)(nil), // 5: ethereum.eth.v1.PeerResponse
(*v1.PeerCountResponse)(nil), // 6: ethereum.eth.v1.PeerCountResponse
(*v1.VersionResponse)(nil), // 7: ethereum.eth.v1.VersionResponse
}
var file_proto_eth_service_node_service_proto_depIdxs = []int32{
0, // 0: ethereum.eth.service.BeaconNode.GetIdentity:input_type -> google.protobuf.Empty
1, // 1: ethereum.eth.service.BeaconNode.ListPeers:input_type -> ethereum.eth.v1.PeersRequest
2, // 2: ethereum.eth.service.BeaconNode.GetPeer:input_type -> ethereum.eth.v1.PeerRequest
0, // 3: ethereum.eth.service.BeaconNode.PeerCount:input_type -> google.protobuf.Empty
0, // 4: ethereum.eth.service.BeaconNode.GetVersion:input_type -> google.protobuf.Empty
0, // 5: ethereum.eth.service.BeaconNode.GetHealth:input_type -> google.protobuf.Empty
3, // 6: ethereum.eth.service.BeaconNode.GetIdentity:output_type -> ethereum.eth.v1.IdentityResponse
4, // 7: ethereum.eth.service.BeaconNode.ListPeers:output_type -> ethereum.eth.v1.PeersResponse
5, // 8: ethereum.eth.service.BeaconNode.GetPeer:output_type -> ethereum.eth.v1.PeerResponse
6, // 9: ethereum.eth.service.BeaconNode.PeerCount:output_type -> ethereum.eth.v1.PeerCountResponse
7, // 10: ethereum.eth.service.BeaconNode.GetVersion:output_type -> ethereum.eth.v1.VersionResponse
0, // 11: ethereum.eth.service.BeaconNode.GetHealth:output_type -> google.protobuf.Empty
6, // [6:12] is the sub-list for method output_type
0, // [0:6] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_proto_eth_service_node_service_proto_init() }
func file_proto_eth_service_node_service_proto_init() {
if File_proto_eth_service_node_service_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_eth_service_node_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_eth_service_node_service_proto_goTypes,
DependencyIndexes: file_proto_eth_service_node_service_proto_depIdxs,
}.Build()
File_proto_eth_service_node_service_proto = out.File
file_proto_eth_service_node_service_proto_rawDesc = nil
file_proto_eth_service_node_service_proto_goTypes = nil
file_proto_eth_service_node_service_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// BeaconNodeClient is the client API for BeaconNode service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BeaconNodeClient interface {
GetIdentity(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.IdentityResponse, error)
ListPeers(ctx context.Context, in *v1.PeersRequest, opts ...grpc.CallOption) (*v1.PeersResponse, error)
GetPeer(ctx context.Context, in *v1.PeerRequest, opts ...grpc.CallOption) (*v1.PeerResponse, error)
PeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.PeerCountResponse, error)
GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.VersionResponse, error)
GetHealth(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type beaconNodeClient struct {
cc grpc.ClientConnInterface
}
func NewBeaconNodeClient(cc grpc.ClientConnInterface) BeaconNodeClient {
return &beaconNodeClient{cc}
}
func (c *beaconNodeClient) GetIdentity(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.IdentityResponse, error) {
out := new(v1.IdentityResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/GetIdentity", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *beaconNodeClient) ListPeers(ctx context.Context, in *v1.PeersRequest, opts ...grpc.CallOption) (*v1.PeersResponse, error) {
out := new(v1.PeersResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/ListPeers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *beaconNodeClient) GetPeer(ctx context.Context, in *v1.PeerRequest, opts ...grpc.CallOption) (*v1.PeerResponse, error) {
out := new(v1.PeerResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/GetPeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *beaconNodeClient) PeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.PeerCountResponse, error) {
out := new(v1.PeerCountResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/PeerCount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *beaconNodeClient) GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.VersionResponse, error) {
out := new(v1.VersionResponse)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/GetVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *beaconNodeClient) GetHealth(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/ethereum.eth.service.BeaconNode/GetHealth", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BeaconNodeServer is the server API for BeaconNode service.
type BeaconNodeServer interface {
GetIdentity(context.Context, *emptypb.Empty) (*v1.IdentityResponse, error)
ListPeers(context.Context, *v1.PeersRequest) (*v1.PeersResponse, error)
GetPeer(context.Context, *v1.PeerRequest) (*v1.PeerResponse, error)
PeerCount(context.Context, *emptypb.Empty) (*v1.PeerCountResponse, error)
GetVersion(context.Context, *emptypb.Empty) (*v1.VersionResponse, error)
GetHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
}
// UnimplementedBeaconNodeServer can be embedded to have forward compatible implementations.
type UnimplementedBeaconNodeServer struct {
}
func (*UnimplementedBeaconNodeServer) GetIdentity(context.Context, *emptypb.Empty) (*v1.IdentityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetIdentity not implemented")
}
func (*UnimplementedBeaconNodeServer) ListPeers(context.Context, *v1.PeersRequest) (*v1.PeersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented")
}
func (*UnimplementedBeaconNodeServer) GetPeer(context.Context, *v1.PeerRequest) (*v1.PeerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented")
}
func (*UnimplementedBeaconNodeServer) PeerCount(context.Context, *emptypb.Empty) (*v1.PeerCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PeerCount not implemented")
}
func (*UnimplementedBeaconNodeServer) GetVersion(context.Context, *emptypb.Empty) (*v1.VersionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
}
func (*UnimplementedBeaconNodeServer) GetHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetHealth not implemented")
}
func RegisterBeaconNodeServer(s *grpc.Server, srv BeaconNodeServer) {
s.RegisterService(&_BeaconNode_serviceDesc, srv)
}
func _BeaconNode_GetIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).GetIdentity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/GetIdentity",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).GetIdentity(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNode_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.PeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).ListPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/ListPeers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).ListPeers(ctx, req.(*v1.PeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNode_GetPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.PeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).GetPeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/GetPeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).GetPeer(ctx, req.(*v1.PeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNode_PeerCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).PeerCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/PeerCount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).PeerCount(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNode_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).GetVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/GetVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).GetVersion(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _BeaconNode_GetHealth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BeaconNodeServer).GetHealth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.eth.service.BeaconNode/GetHealth",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BeaconNodeServer).GetHealth(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _BeaconNode_serviceDesc = grpc.ServiceDesc{
ServiceName: "ethereum.eth.service.BeaconNode",
HandlerType: (*BeaconNodeServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetIdentity",
Handler: _BeaconNode_GetIdentity_Handler,
},
{
MethodName: "ListPeers",
Handler: _BeaconNode_ListPeers_Handler,
},
{
MethodName: "GetPeer",
Handler: _BeaconNode_GetPeer_Handler,
},
{
MethodName: "PeerCount",
Handler: _BeaconNode_PeerCount_Handler,
},
{
MethodName: "GetVersion",
Handler: _BeaconNode_GetVersion_Handler,
},
{
MethodName: "GetHealth",
Handler: _BeaconNode_GetHealth_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/eth/service/node_service.proto",
}

View File

@@ -1,535 +0,0 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: proto/eth/service/node_service.proto
/*
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package service
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
v1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
var _ = emptypb.Empty{}
func request_BeaconNode_GetIdentity_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := client.GetIdentity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_GetIdentity_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := server.GetIdentity(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_BeaconNode_ListPeers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_BeaconNode_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq v1.PeersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNode_ListPeers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq v1.PeersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNode_ListPeers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListPeers(ctx, &protoReq)
return msg, metadata, err
}
func request_BeaconNode_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq v1.PeerRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["peer_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "peer_id")
}
peer_id, err := runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "peer_id", err)
}
protoReq.PeerId = (peer_id)
msg, err := client.GetPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq v1.PeerRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["peer_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "peer_id")
}
peer_id, err := runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "peer_id", err)
}
protoReq.PeerId = (peer_id)
msg, err := server.GetPeer(ctx, &protoReq)
return msg, metadata, err
}
func request_BeaconNode_PeerCount_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := client.PeerCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_PeerCount_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := server.PeerCount(ctx, &protoReq)
return msg, metadata, err
}
func request_BeaconNode_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := client.GetVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := server.GetVersion(ctx, &protoReq)
return msg, metadata, err
}
func request_BeaconNode_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := client.GetHealth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_BeaconNode_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := server.GetHealth(ctx, &protoReq)
return msg, metadata, err
}
// RegisterBeaconNodeHandlerServer registers the http handlers for service BeaconNode to "mux".
// UnaryRPC :call BeaconNodeServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconNodeHandlerFromEndpoint instead.
func RegisterBeaconNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconNodeServer) error {
mux.Handle("GET", pattern_BeaconNode_GetIdentity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetIdentity")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_GetIdentity_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetIdentity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/ListPeers")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetPeer")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_GetPeer_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_PeerCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/PeerCount")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_PeerCount_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_PeerCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetVersion")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_GetVersion_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetHealth")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BeaconNode_GetHealth_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterBeaconNodeHandlerFromEndpoint is same as RegisterBeaconNodeHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBeaconNodeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterBeaconNodeHandler(ctx, mux, conn)
}
// RegisterBeaconNodeHandler registers the http handlers for service BeaconNode to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterBeaconNodeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterBeaconNodeHandlerClient(ctx, mux, NewBeaconNodeClient(conn))
}
// RegisterBeaconNodeHandlerClient registers the http handlers for service BeaconNode
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BeaconNodeClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BeaconNodeClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "BeaconNodeClient" to call the correct interceptors.
func RegisterBeaconNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconNodeClient) error {
mux.Handle("GET", pattern_BeaconNode_GetIdentity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetIdentity")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_GetIdentity_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetIdentity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/ListPeers")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetPeer")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_GetPeer_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_PeerCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/PeerCount")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_PeerCount_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_PeerCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetVersion")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_GetVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_BeaconNode_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.BeaconNode/GetHealth")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BeaconNode_GetHealth_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BeaconNode_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_BeaconNode_GetIdentity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "node", "identity"}, ""))
pattern_BeaconNode_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "node", "peers"}, ""))
pattern_BeaconNode_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "eth", "v1", "node", "peers", "peer_id"}, ""))
pattern_BeaconNode_PeerCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "node", "peer_count"}, ""))
pattern_BeaconNode_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "node", "version"}, ""))
pattern_BeaconNode_GetHealth_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"internal", "eth", "v1", "node", "health"}, ""))
)
var (
forward_BeaconNode_GetIdentity_0 = runtime.ForwardResponseMessage
forward_BeaconNode_ListPeers_0 = runtime.ForwardResponseMessage
forward_BeaconNode_GetPeer_0 = runtime.ForwardResponseMessage
forward_BeaconNode_PeerCount_0 = runtime.ForwardResponseMessage
forward_BeaconNode_GetVersion_0 = runtime.ForwardResponseMessage
forward_BeaconNode_GetHealth_0 = runtime.ForwardResponseMessage
)

View File

@@ -1,84 +0,0 @@
// Copyright 2020 Prysmatic Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package ethereum.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "proto/eth/v1/node.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v4/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "NodeServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Beacon chain node API
//
// The beacon chain node API is a set of endpoints to query node information.
service BeaconNode {
// GetIdentity retrieves data about the node's network presence.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNetworkIdentity
rpc GetIdentity(google.protobuf.Empty) returns (v1.IdentityResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/identity"};
}
// ListPeers retrieves data about the node's network peers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeers
rpc ListPeers(v1.PeersRequest) returns (v1.PeersResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peers"};
}
// GetPeer retrieves data about the given peer.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeer
rpc GetPeer(v1.PeerRequest) returns (v1.PeerResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peers/{peer_id}"};
}
// PeerCount retrieves number of known peers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeerCount
rpc PeerCount(google.protobuf.Empty) returns (v1.PeerCountResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peer_count"};
}
// GetVersion requests that the beacon node identify information about its implementation in a
// format similar to a HTTP User-Agent field.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNodeVersion
rpc GetVersion(google.protobuf.Empty) returns (v1.VersionResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/version"};
}
// GetHealth returns node health status in http status codes. Useful for load balancers.
// Response Usage:
// "200":
// description: Node is ready
// "206":
// description: Node is syncing but can serve incomplete data
// "503":
// description: Node not initialized or having issues
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getHealth
rpc GetHealth(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (google.api.http) = {get: "/internal/eth/v1/node/health"};
}
}

971
proto/eth/v1/node.pb.go generated

File diff suppressed because it is too large Load Diff

View File

@@ -26,71 +26,6 @@ option java_outer_classname = "BeaconNodeProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message IdentityResponse {
Identity data = 1;
}
message Identity {
// The peer id of the node.
string peer_id = 1;
// The latest ENR of the node.
string enr = 2;
// All the p2p multiaddresses of the peer, specified as a full multiaddr.
repeated string p2p_addresses = 3;
// All the discv5 multiaddresses of the peer, specified as a full multiaddr.
repeated string discovery_addresses = 4;
// Additional metadata that the node would like to provide. Includes extra networking information.
Metadata metadata = 5;
}
message Metadata {
// Sequence number starts at 0 used to version the node's metadata. If any other field in the local MetaData changes,
// the node MUST increment seq_number by 1.
uint64 seq_number = 1;
// Attnets is a bitvector representing the node's persistent attestation subnet subscriptions.
bytes attnets = 2 [(ethereum.eth.ext.ssz_size) = "8", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector64"];
}
message PeerRequest {
// Peer id of the peer requested.
string peer_id = 1;
}
message PeersRequest {
// Requested peer states (available values: disconnected, connecting, connected, disconnecting).
repeated ConnectionState state = 1;
// Requested peer directions (available values: inbound, outbound).
repeated PeerDirection direction = 2;
}
message PeerResponse {
Peer data = 1;
Meta meta = 2;
message Meta {
uint64 count = 1;
}
}
message PeersResponse {
repeated Peer data = 1;
}
message PeerCountResponse {
PeerCount data = 1;
message PeerCount {
// The number of disconnected peers.
uint64 disconnected = 1;
// The number of connecting peers.
uint64 connecting = 2;
// The number of connected peers.
uint64 connected = 3;
// The number of disconnecting peers.
uint64 disconnecting = 4;
}
}
// Peer provides details of a peer on the network.
message Peer {
// The peer id of the peer.
@@ -119,13 +54,3 @@ enum ConnectionState {
CONNECTED = 2;
DISCONNECTING = 3;
}
message VersionResponse {
Version data = 1;
}
// Information about the node version.
message Version {
// A string that uniquely identifies the node and its version.
string version = 1;
}