Skip to content

Commit 3189ff6

Browse files
daywalker90cdecker
authored andcommitted
msggen: add getlog method
Changelog-None
1 parent cf5e882 commit 3189ff6

File tree

9 files changed

+544
-205
lines changed

9 files changed

+544
-205
lines changed

.msggen.json

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@
8989
"torv3": 4,
9090
"websocket": 5
9191
},
92+
"GetlogLevel": {
93+
"broken": 0,
94+
"debug": 3,
95+
"info": 2,
96+
"io": 4,
97+
"unusual": 1
98+
},
99+
"GetlogLogType": {
100+
"BROKEN": 1,
101+
"DEBUG": 4,
102+
"INFO": 3,
103+
"IO_IN": 5,
104+
"IO_OUT": 6,
105+
"SKIPPED": 0,
106+
"UNUSUAL": 2
107+
},
92108
"GetrouteRouteStyle": {
93109
"tlv": 0
94110
},
@@ -989,9 +1005,7 @@
9891005
},
9901006
"Fundchannel_startChannel_type": {
9911007
"FundChannel_Start.channel_type.bits[]": 1,
992-
"FundChannel_Start.channel_type.names[]": 2,
993-
"Fundchannel_Start.channel_type.bits[]": 1,
994-
"Fundchannel_Start.channel_type.names[]": 2
1008+
"FundChannel_Start.channel_type.names[]": 2
9951009
},
9961010
"Fundchannel_startRequest": {
9971011
"FundChannel_Start.amount": 2,
@@ -1002,30 +1016,15 @@
10021016
"FundChannel_Start.id": 1,
10031017
"FundChannel_Start.mindepth": 7,
10041018
"FundChannel_Start.push_msat": 6,
1005-
"FundChannel_Start.reserve": 8,
1006-
"Fundchannel_Start.amount": 9,
1007-
"Fundchannel_Start.announce": 3,
1008-
"Fundchannel_Start.channel_type[]": 8,
1009-
"Fundchannel_Start.close_to": 4,
1010-
"Fundchannel_Start.feerate": 2,
1011-
"Fundchannel_Start.id": 1,
1012-
"Fundchannel_Start.mindepth": 6,
1013-
"Fundchannel_Start.push_msat": 5,
1014-
"Fundchannel_Start.reserve": 7
1019+
"FundChannel_Start.reserve": 8
10151020
},
10161021
"Fundchannel_startResponse": {
10171022
"FundChannel_Start.channel_type": 3,
10181023
"FundChannel_Start.close_to": 4,
10191024
"FundChannel_Start.funding_address": 1,
10201025
"FundChannel_Start.mindepth": 6,
10211026
"FundChannel_Start.scriptpubkey": 2,
1022-
"FundChannel_Start.warning_usage": 5,
1023-
"Fundchannel_Start.channel_type": 3,
1024-
"Fundchannel_Start.close_to": 4,
1025-
"Fundchannel_Start.funding_address": 1,
1026-
"Fundchannel_Start.mindepth": 6,
1027-
"Fundchannel_Start.scriptpubkey": 2,
1028-
"Fundchannel_Start.warning_usage": 5
1027+
"FundChannel_Start.warning_usage": 5
10291028
},
10301029
"FundpsbtRequest": {
10311030
"FundPsbt.excess_as_change": 8,
@@ -1092,6 +1091,24 @@
10921091
"Getinfo.warning_bitcoind_sync": 16,
10931092
"Getinfo.warning_lightningd_sync": 17
10941093
},
1094+
"GetlogLog": {
1095+
"GetLog.log[].data": 7,
1096+
"GetLog.log[].log": 5,
1097+
"GetLog.log[].node_id": 6,
1098+
"GetLog.log[].num_skipped": 2,
1099+
"GetLog.log[].source": 4,
1100+
"GetLog.log[].time": 3,
1101+
"GetLog.log[].type": 1
1102+
},
1103+
"GetlogRequest": {
1104+
"GetLog.level": 1
1105+
},
1106+
"GetlogResponse": {
1107+
"GetLog.bytes_max": 3,
1108+
"GetLog.bytes_used": 2,
1109+
"GetLog.created_at": 1,
1110+
"GetLog.log[]": 4
1111+
},
10951112
"GetrouteRequest": {
10961113
"GetRoute.amount_msat": 9,
10971114
"GetRoute.cltv": 4,
@@ -4235,67 +4252,55 @@
42354252
"added": "pre-v0.10.1",
42364253
"deprecated": false
42374254
},
4238-
"Fundchannel_Start": {
4255+
"GetLog": {
42394256
"added": "pre-v0.10.1",
42404257
"deprecated": null
42414258
},
4242-
"Fundchannel_Start.amount": {
4259+
"GetLog.bytes_max": {
42434260
"added": "pre-v0.10.1",
42444261
"deprecated": false
42454262
},
4246-
"Fundchannel_Start.announce": {
4263+
"GetLog.bytes_used": {
42474264
"added": "pre-v0.10.1",
42484265
"deprecated": false
42494266
},
4250-
"Fundchannel_Start.channel_type": {
4251-
"added": "v24.02",
4252-
"deprecated": false
4253-
},
4254-
"Fundchannel_Start.channel_type.bits[]": {
4255-
"added": "v24.02",
4256-
"deprecated": false
4257-
},
4258-
"Fundchannel_Start.channel_type.names[]": {
4259-
"added": "v24.02",
4260-
"deprecated": false
4261-
},
4262-
"Fundchannel_Start.channel_type[]": {
4267+
"GetLog.created_at": {
42634268
"added": "pre-v0.10.1",
42644269
"deprecated": false
42654270
},
4266-
"Fundchannel_Start.close_to": {
4271+
"GetLog.level": {
42674272
"added": "pre-v0.10.1",
42684273
"deprecated": false
42694274
},
4270-
"Fundchannel_Start.feerate": {
4275+
"GetLog.log[]": {
42714276
"added": "pre-v0.10.1",
42724277
"deprecated": false
42734278
},
4274-
"Fundchannel_Start.funding_address": {
4279+
"GetLog.log[].data": {
42754280
"added": "pre-v0.10.1",
42764281
"deprecated": false
42774282
},
4278-
"Fundchannel_Start.id": {
4283+
"GetLog.log[].log": {
42794284
"added": "pre-v0.10.1",
42804285
"deprecated": false
42814286
},
4282-
"Fundchannel_Start.mindepth": {
4287+
"GetLog.log[].node_id": {
42834288
"added": "pre-v0.10.1",
42844289
"deprecated": false
42854290
},
4286-
"Fundchannel_Start.push_msat": {
4291+
"GetLog.log[].num_skipped": {
42874292
"added": "pre-v0.10.1",
42884293
"deprecated": false
42894294
},
4290-
"Fundchannel_Start.reserve": {
4295+
"GetLog.log[].source": {
42914296
"added": "pre-v0.10.1",
42924297
"deprecated": false
42934298
},
4294-
"Fundchannel_Start.scriptpubkey": {
4299+
"GetLog.log[].time": {
42954300
"added": "pre-v0.10.1",
42964301
"deprecated": false
42974302
},
4298-
"Fundchannel_Start.warning_usage": {
4303+
"GetLog.log[].type": {
42994304
"added": "pre-v0.10.1",
43004305
"deprecated": false
43014306
},

cln-grpc/proto/node.proto

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/convert.rs

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/server.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,38 @@ async fn fund_channel_start(
17221722

17231723
}
17241724

1725+
async fn get_log(
1726+
&self,
1727+
request: tonic::Request<pb::GetlogRequest>,
1728+
) -> Result<tonic::Response<pb::GetlogResponse>, tonic::Status> {
1729+
let req = request.into_inner();
1730+
let req: requests::GetlogRequest = req.into();
1731+
debug!("Client asked for get_log");
1732+
trace!("get_log request: {:?}", req);
1733+
let mut rpc = ClnRpc::new(&self.rpc_path)
1734+
.await
1735+
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
1736+
let result = rpc.call(Request::GetLog(req))
1737+
.await
1738+
.map_err(|e| Status::new(
1739+
Code::Unknown,
1740+
format!("Error calling method GetLog: {:?}", e)))?;
1741+
match result {
1742+
Response::GetLog(r) => {
1743+
trace!("get_log response: {:?}", r);
1744+
Ok(tonic::Response::new(r.into()))
1745+
},
1746+
r => Err(Status::new(
1747+
Code::Internal,
1748+
format!(
1749+
"Unexpected result {:?} to method call GetLog",
1750+
r
1751+
)
1752+
)),
1753+
}
1754+
1755+
}
1756+
17251757
async fn get_route(
17261758
&self,
17271759
request: tonic::Request<pb::GetrouteRequest>,

0 commit comments

Comments
 (0)