lnrpc+rpcserver: add new GetDebugInfo RPC method

This commit is contained in:
Oliver Gugger committed 2024-01-09 12:32:37 +01:00
1 parent becbe7085d
commit 8a2c3a3d85
8 files changed
+3609 -3238

No files matched your search

+25
View File
@@ -455,6 +455,31 @@ func RegisterLightningJSONCallbacks(registry map[string]func(ctx context.Context
callback(string(respBytes), nil)
}
registry["lnrpc.Lightning.GetDebugInfo"] = func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
req := &GetDebugInfoRequest{}
err := marshaler.Unmarshal([]byte(reqJSON), req)
if err != nil {
callback("", err)
return
}
client := NewLightningClient(conn)
resp, err := client.GetDebugInfo(ctx, req)
if err != nil {
callback("", err)
return
}
respBytes, err := marshaler.Marshal(resp)
if err != nil {
callback("", err)
return
}
callback(string(respBytes), nil)
}
registry["lnrpc.Lightning.GetRecoveryInfo"] = func(ctx context.Context,
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {