lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Re-export `tonic` in `cln-grpc`

Open ErikDeSmedt opened this issue 1 year ago • 1 comments

Using cln-grpc in an outside crate is somewhat tricky. We currently do not have a way to describe the type of T in NodeClient<T>

The export allows the user to write the snippet below.

struct App {
  grpc_client: NodeClient<cln_grpc::tonic::transport::Channel>
}

impl App {

  fn create(destination: AsRef<str>) -> Self {
    NodeClient::connect(destination.as_ref())
      .await
      .unwrap("Failed to connect")
  }
}

async fn main() {
  App::create("http://localhost:1234")
}

ErikDeSmedt avatar Aug 09 '24 14:08 ErikDeSmedt

Hi @ErikDeSmedt I'm doing some spring cleaning and obviously the situation has changed since this PR was proposed... I'm wondering if you're still planning on returning to this work?

madelinevibes avatar Dec 08 '25 05:12 madelinevibes