Skip to content

Commit

Permalink
msggen: add getlog method
Browse files Browse the repository at this point in the history
Changelog-None
  • Loading branch information
daywalker90 authored and cdecker committed Apr 25, 2024
1 parent cf5e882 commit 3189ff6
Show file tree
Hide file tree
Showing 9 changed files with 544 additions and 205 deletions.
95 changes: 50 additions & 45 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@
"torv3": 4,
"websocket": 5
},
"GetlogLevel": {
"broken": 0,
"debug": 3,
"info": 2,
"io": 4,
"unusual": 1
},
"GetlogLogType": {
"BROKEN": 1,
"DEBUG": 4,
"INFO": 3,
"IO_IN": 5,
"IO_OUT": 6,
"SKIPPED": 0,
"UNUSUAL": 2
},
"GetrouteRouteStyle": {
"tlv": 0
},
Expand Down Expand Up @@ -989,9 +1005,7 @@
},
"Fundchannel_startChannel_type": {
"FundChannel_Start.channel_type.bits[]": 1,
"FundChannel_Start.channel_type.names[]": 2,
"Fundchannel_Start.channel_type.bits[]": 1,
"Fundchannel_Start.channel_type.names[]": 2
"FundChannel_Start.channel_type.names[]": 2
},
"Fundchannel_startRequest": {
"FundChannel_Start.amount": 2,
Expand All @@ -1002,30 +1016,15 @@
"FundChannel_Start.id": 1,
"FundChannel_Start.mindepth": 7,
"FundChannel_Start.push_msat": 6,
"FundChannel_Start.reserve": 8,
"Fundchannel_Start.amount": 9,
"Fundchannel_Start.announce": 3,
"Fundchannel_Start.channel_type[]": 8,
"Fundchannel_Start.close_to": 4,
"Fundchannel_Start.feerate": 2,
"Fundchannel_Start.id": 1,
"Fundchannel_Start.mindepth": 6,
"Fundchannel_Start.push_msat": 5,
"Fundchannel_Start.reserve": 7
"FundChannel_Start.reserve": 8
},
"Fundchannel_startResponse": {
"FundChannel_Start.channel_type": 3,
"FundChannel_Start.close_to": 4,
"FundChannel_Start.funding_address": 1,
"FundChannel_Start.mindepth": 6,
"FundChannel_Start.scriptpubkey": 2,
"FundChannel_Start.warning_usage": 5,
"Fundchannel_Start.channel_type": 3,
"Fundchannel_Start.close_to": 4,
"Fundchannel_Start.funding_address": 1,
"Fundchannel_Start.mindepth": 6,
"Fundchannel_Start.scriptpubkey": 2,
"Fundchannel_Start.warning_usage": 5
"FundChannel_Start.warning_usage": 5
},
"FundpsbtRequest": {
"FundPsbt.excess_as_change": 8,
Expand Down Expand Up @@ -1092,6 +1091,24 @@
"Getinfo.warning_bitcoind_sync": 16,
"Getinfo.warning_lightningd_sync": 17
},
"GetlogLog": {
"GetLog.log[].data": 7,
"GetLog.log[].log": 5,
"GetLog.log[].node_id": 6,
"GetLog.log[].num_skipped": 2,
"GetLog.log[].source": 4,
"GetLog.log[].time": 3,
"GetLog.log[].type": 1
},
"GetlogRequest": {
"GetLog.level": 1
},
"GetlogResponse": {
"GetLog.bytes_max": 3,
"GetLog.bytes_used": 2,
"GetLog.created_at": 1,
"GetLog.log[]": 4
},
"GetrouteRequest": {
"GetRoute.amount_msat": 9,
"GetRoute.cltv": 4,
Expand Down Expand Up @@ -4235,67 +4252,55 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start": {
"GetLog": {
"added": "pre-v0.10.1",
"deprecated": null
},
"Fundchannel_Start.amount": {
"GetLog.bytes_max": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.announce": {
"GetLog.bytes_used": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.channel_type": {
"added": "v24.02",
"deprecated": false
},
"Fundchannel_Start.channel_type.bits[]": {
"added": "v24.02",
"deprecated": false
},
"Fundchannel_Start.channel_type.names[]": {
"added": "v24.02",
"deprecated": false
},
"Fundchannel_Start.channel_type[]": {
"GetLog.created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.close_to": {
"GetLog.level": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.feerate": {
"GetLog.log[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.funding_address": {
"GetLog.log[].data": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.id": {
"GetLog.log[].log": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.mindepth": {
"GetLog.log[].node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.push_msat": {
"GetLog.log[].num_skipped": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.reserve": {
"GetLog.log[].source": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.scriptpubkey": {
"GetLog.log[].time": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Fundchannel_Start.warning_usage": {
"GetLog.log[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
Expand Down
40 changes: 40 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions cln-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,38 @@ async fn fund_channel_start(

}

async fn get_log(
&self,
request: tonic::Request<pb::GetlogRequest>,
) -> Result<tonic::Response<pb::GetlogResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::GetlogRequest = req.into();
debug!("Client asked for get_log");
trace!("get_log request: {:?}", req);
let mut rpc = ClnRpc::new(&self.rpc_path)
.await
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
let result = rpc.call(Request::GetLog(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method GetLog: {:?}", e)))?;
match result {
Response::GetLog(r) => {
trace!("get_log response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call GetLog",
r
)
)),
}

}

async fn get_route(
&self,
request: tonic::Request<pb::GetrouteRequest>,
Expand Down
Loading

0 comments on commit 3189ff6

Please sign in to comment.