feat!: add node status endpoint (#15597)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
This commit is contained in:
co-authored by
Aleksandr Bezobchuk
Facundo Medica
parent
fb0656620b
commit
9e4fbb6db1
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Service_Config_FullMethodName = "/cosmos.base.node.v1beta1.Service/Config"
|
||||
Service_Status_FullMethodName = "/cosmos.base.node.v1beta1.Service/Status"
|
||||
)
|
||||
|
||||
// ServiceClient is the client API for Service service.
|
||||
@@ -28,6 +29,8 @@ const (
|
||||
type ServiceClient interface {
|
||||
// Config queries for the operator configuration.
|
||||
Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error)
|
||||
// Status queries for the node status.
|
||||
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
}
|
||||
|
||||
type serviceClient struct {
|
||||
@@ -47,12 +50,23 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServer is the server API for Service service.
|
||||
// All implementations must embed UnimplementedServiceServer
|
||||
// for forward compatibility
|
||||
type ServiceServer interface {
|
||||
// Config queries for the operator configuration.
|
||||
Config(context.Context, *ConfigRequest) (*ConfigResponse, error)
|
||||
// Status queries for the node status.
|
||||
Status(context.Context, *StatusRequest) (*StatusResponse, error)
|
||||
mustEmbedUnimplementedServiceServer()
|
||||
}
|
||||
|
||||
@@ -63,6 +77,9 @@ type UnimplementedServiceServer struct {
|
||||
func (UnimplementedServiceServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Config not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
|
||||
|
||||
// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -94,6 +111,24 @@ func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).Status(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Service_Status_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).Status(ctx, req.(*StatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -105,6 +140,10 @@ var Service_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Config",
|
||||
Handler: _Service_Config_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Status",
|
||||
Handler: _Service_Status_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/base/node/v1beta1/query.proto",
|
||||
|
||||
Reference in New Issue
Block a user