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

Method datastore

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

Source from the content-addressed store, hash-verified

499 }
500
501 async fn datastore(
502 &self,
503 request: tonic::Request<pb::DatastoreRequest>,
504 ) -> Result<tonic::Response<pb::DatastoreResponse>, tonic::Status> {
505 let req = request.into_inner();
506 let req: requests::DatastoreRequest = req.try_into()?;
507 debug!("Client asked for datastore");
508 trace!("datastore request: {:?}", req);
509 let mut rpc = ClnRpc::new(&self.rpc_path)
510 .await
511 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
512 let result = rpc.call(Request::Datastore(req))
513 .await
514 .map_err(|e| Status::new(
515 Code::Unknown,
516 format!("Error calling method Datastore: {:?}", e)))?;
517 match result {
518 Response::Datastore(r) => {
519 trace!("datastore response: {:?}", r);
520 Ok(tonic::Response::new(r.into()))
521 },
522 r => Err(Status::new(
523 Code::Internal,
524 format!(
525 "Unexpected result {:?} to method call Datastore",
526 r
527 )
528 )),
529 }
530
531 }
532
533 async fn datastore_usage(
534 &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