MCPcopy Create free account
hub / github.com/ElementsProject/lightning / getinfo

Method getinfo

cln-grpc/src/server.rs:85–115  ·  view source on GitHub ↗
(
        &self,
        request: tonic::Request<pb::GetinfoRequest>,
    )

Source from the content-addressed store, hash-verified

83impl Node for Server
84{
85 async fn getinfo(
86 &self,
87 request: tonic::Request<pb::GetinfoRequest>,
88 ) -> Result<tonic::Response<pb::GetinfoResponse>, tonic::Status> {
89 let req = request.into_inner();
90 let req: requests::GetinfoRequest = req.into();
91 debug!("Client asked for getinfo");
92 trace!("getinfo request: {:?}", req);
93 let mut rpc = ClnRpc::new(&self.rpc_path)
94 .await
95 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
96 let result = rpc.call(Request::Getinfo(req))
97 .await
98 .map_err(|e| Status::new(
99 Code::Unknown,
100 format!("Error calling method Getinfo: {:?}", e)))?;
101 match result {
102 Response::Getinfo(r) => {
103 trace!("getinfo response: {:?}", r);
104 Ok(tonic::Response::new(r.into()))
105 },
106 r => Err(Status::new(
107 Code::Internal,
108 format!(
109 "Unexpected result {:?} to method call Getinfo",
110 r
111 )
112 )),
113 }
114
115 }
116
117 async fn list_peers(
118 &self,

Callers

nothing calls this directly

Calls 3

into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected