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

Method connect_peer

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

Source from the content-addressed store, hash-verified

435 }
436
437 async fn connect_peer(
438 &self,
439 request: tonic::Request<pb::ConnectRequest>,
440 ) -> Result<tonic::Response<pb::ConnectResponse>, tonic::Status> {
441 let req = request.into_inner();
442 let req: requests::ConnectRequest = req.into();
443 debug!("Client asked for connect_peer");
444 trace!("connect_peer request: {:?}", req);
445 let mut rpc = ClnRpc::new(&self.rpc_path)
446 .await
447 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
448 let result = rpc.call(Request::Connect(req))
449 .await
450 .map_err(|e| Status::new(
451 Code::Unknown,
452 format!("Error calling method Connect: {:?}", e)))?;
453 match result {
454 Response::Connect(r) => {
455 trace!("connect_peer response: {:?}", r);
456 Ok(tonic::Response::new(r.into()))
457 },
458 r => Err(Status::new(
459 Code::Internal,
460 format!(
461 "Unexpected result {:?} to method call Connect",
462 r
463 )
464 )),
465 }
466
467 }
468
469 async fn create_invoice(
470 &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