Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add partial CLN support with potential for other node types in the future #92

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Cargo
# will have compiled files and executables
/target/
**/target

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ url = "2.2.1"
drop-root = "0.1.1"
dbif = { path = 'dbif'}
lnd-rs = { path = "lnd-rs" }
cln-rs = { path = "cln-rs" }
configure_me = "0.4.0"
handlebars = "4.2.1"
chrono = "0.4.35"
Expand All @@ -33,6 +34,7 @@ axum-extra = { version = "0.9.3", features = ["cookie"] }
axum_typed_multipart = "0.11.0"
tempfile = "3.10.1"
tower-http = { version = "0.5.2", features = ["fs", "cors"] }
async-trait = "0.1.81"

[build-dependencies]
configure_me_codegen = "0.4.1"
14 changes: 14 additions & 0 deletions cln-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "cln-rs"
version = "0.1.0"
edition = "2021"

[lib]
name = "cln_rs"

[dependencies]
prost = "0.13.1"
tonic = { version = "0.12.1", features = ["tls"] }

[build-dependencies]
tonic-build = "0.12.1"
6 changes: 6 additions & 0 deletions cln-rs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Note

CLN provides a `cln-grpc` crate that provides the same definitions as this crate. I was not able to get CLN's crate to work, due to potential version
differences in tonic, prost, axum, or maybe another library we're using.

As a result, I've built this crate using the proto files extracted from the `cln-gprc` crate.
8 changes: 8 additions & 0 deletions cln-rs/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// builds the src/cln.rs from the node.proto and primities.proto definitions
fn main() -> Result<(), std::io::Error> {
tonic_build::configure()
.build_client(true)
.build_server(false)
.out_dir("src")
.compile(&["protos/node.proto", "protos/primitives.proto"], &["protos"])
}
Loading