Skip to content

[cln-rpc] Support REST server #8665

@jblachly

Description

@jblachly

Motivated by cashubtc/cdk#1249

Summary

the cln-rpc rust crate is a great way to interact with a CLN node, but works only over a Unix domain socket.

Request

Given that the JSON-RPC is the same over local socket and HTTP REST server, it seems like the crate could support CLN's REST server with just some minor surgery.

Potential Solution

pub struct ClnRpc {
    transport: Transport,
    // Remove UnixStream
}

pub enum Transport {
    Unix(PathBuf),
    Http(Url),  // e.g., Url::parse("http://localhost:8080/")?
}

and then match on Transport in ClnRpc::call.

Before I did any work on this, I wanted to get a concept thumbs up or down from the maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions