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

Method datastore

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

Source from the content-addressed store, hash-verified

379}
380
381async fn datastore(
382 &self,
383 request: tonic::Request<pb::DatastoreRequest>,
384) -> Result<tonic::Response<pb::DatastoreResponse>, tonic::Status> {
385 let req = request.into_inner();
386 let req: requests::DatastoreRequest = req.into();
387 debug!("Client asked for datastore");
388 trace!("datastore request: {:?}", req);
389 let mut rpc = ClnRpc::new(&self.rpc_path)
390 .await
391 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
392 let result = rpc.call(Request::Datastore(req))
393 .await
394 .map_err(|e| Status::new(
395 Code::Unknown,
396 format!("Error calling method Datastore: {:?}", e)))?;
397 match result {
398 Response::Datastore(r) => {
399 trace!("datastore response: {:?}", r);
400 Ok(tonic::Response::new(r.into()))
401 },
402 r => Err(Status::new(
403 Code::Internal,
404 format!(
405 "Unexpected result {:?} to method call Datastore",
406 r
407 )
408 )),
409 }
410
411}
412
413async fn create_onion(
414 &self,

Callers 4

test_datastoreFunction · 0.80
test_datastore_keylistFunction · 0.80
test_commando_runeFunction · 0.80
shutdownFunction · 0.80

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by 3

test_datastoreFunction · 0.64
test_datastore_keylistFunction · 0.64
test_commando_runeFunction · 0.64