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

Method getinfo

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

Source from the content-addressed store, hash-verified

27impl Node for Server
28{
29async fn getinfo(
30 &self,
31 request: tonic::Request<pb::GetinfoRequest>,
32) -> Result<tonic::Response<pb::GetinfoResponse>, tonic::Status> {
33 let req = request.into_inner();
34 let req: requests::GetinfoRequest = req.into();
35 debug!("Client asked for getinfo");
36 trace!("getinfo request: {:?}", req);
37 let mut rpc = ClnRpc::new(&self.rpc_path)
38 .await
39 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
40 let result = rpc.call(Request::Getinfo(req))
41 .await
42 .map_err(|e| Status::new(
43 Code::Unknown,
44 format!("Error calling method Getinfo: {:?}", e)))?;
45 match result {
46 Response::Getinfo(r) => {
47 trace!("getinfo response: {:?}", r);
48 Ok(tonic::Response::new(r.into()))
49 },
50 r => Err(Status::new(
51 Code::Internal,
52 format!(
53 "Unexpected result {:?} to method call Getinfo",
54 r
55 )
56 )),
57 }
58
59}
60
61async fn list_peers(
62 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected