lnrpc+rpcserver: add new GetDebugInfo RPC method
This commit is contained in:
8 files changed
+3609
-3238
No files matched your search
@@ -102,6 +102,11 @@ type LightningClient interface {
|
||||
// it's identity pubkey, alias, the chains it is connected to, and information
|
||||
// concerning the number of open+pending channels.
|
||||
GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
|
||||
// lncli: 'getdebuginfo'
|
||||
// GetDebugInfo returns debug information concerning the state of the daemon
|
||||
// and its subsystems. This includes the full configuration and the latest log
|
||||
// entries from the log file.
|
||||
GetDebugInfo(ctx context.Context, in *GetDebugInfoRequest, opts ...grpc.CallOption) (*GetDebugInfoResponse, error)
|
||||
// * lncli: `getrecoveryinfo`
|
||||
// GetRecoveryInfo returns information concerning the recovery mode including
|
||||
// whether it's in a recovery mode, whether the recovery is finished, and the
|
||||
@@ -611,6 +616,15 @@ func (c *lightningClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lightningClient) GetDebugInfo(ctx context.Context, in *GetDebugInfoRequest, opts ...grpc.CallOption) (*GetDebugInfoResponse, error) {
|
||||
out := new(GetDebugInfoResponse)
|
||||
err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetDebugInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lightningClient) GetRecoveryInfo(ctx context.Context, in *GetRecoveryInfoRequest, opts ...grpc.CallOption) (*GetRecoveryInfoResponse, error) {
|
||||
out := new(GetRecoveryInfoResponse)
|
||||
err := c.cc.Invoke(ctx, "/lnrpc.Lightning/GetRecoveryInfo", in, out, opts...)
|
||||
@@ -1409,6 +1423,11 @@ type LightningServer interface {
|
||||
// it's identity pubkey, alias, the chains it is connected to, and information
|
||||
// concerning the number of open+pending channels.
|
||||
GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
|
||||
// lncli: 'getdebuginfo'
|
||||
// GetDebugInfo returns debug information concerning the state of the daemon
|
||||
// and its subsystems. This includes the full configuration and the latest log
|
||||
// entries from the log file.
|
||||
GetDebugInfo(context.Context, *GetDebugInfoRequest) (*GetDebugInfoResponse, error)
|
||||
// * lncli: `getrecoveryinfo`
|
||||
// GetRecoveryInfo returns information concerning the recovery mode including
|
||||
// whether it's in a recovery mode, whether the recovery is finished, and the
|
||||
@@ -1773,6 +1792,9 @@ func (UnimplementedLightningServer) SubscribePeerEvents(*PeerEventSubscription,
|
||||
func (UnimplementedLightningServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
|
||||
}
|
||||
func (UnimplementedLightningServer) GetDebugInfo(context.Context, *GetDebugInfoRequest) (*GetDebugInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetDebugInfo not implemented")
|
||||
}
|
||||
func (UnimplementedLightningServer) GetRecoveryInfo(context.Context, *GetRecoveryInfoRequest) (*GetRecoveryInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRecoveryInfo not implemented")
|
||||
}
|
||||
@@ -2233,6 +2255,24 @@ func _Lightning_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lightning_GetDebugInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDebugInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LightningServer).GetDebugInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/lnrpc.Lightning/GetDebugInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LightningServer).GetDebugInfo(ctx, req.(*GetDebugInfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lightning_GetRecoveryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRecoveryInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -3267,6 +3307,10 @@ var Lightning_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetInfo",
|
||||
Handler: _Lightning_GetInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetDebugInfo",
|
||||
Handler: _Lightning_GetDebugInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRecoveryInfo",
|
||||
Handler: _Lightning_GetRecoveryInfo_Handler,
|
||||
|
||||
Reference in new issue
Block a user