Skip to content

gl-sdk: Add C++ bindings#718

Merged
cdecker merged 1 commit into
Blockstream:mainfrom
ardier16:cpp-bindings
May 20, 2026
Merged

gl-sdk: Add C++ bindings#718
cdecker merged 1 commit into
Blockstream:mainfrom
ardier16:cpp-bindings

Conversation

@ardier16
Copy link
Copy Markdown
Contributor

Adds C++ bindings support to gl-sdk:

  • Introduce a cpp-bindings feature and C++ compatible resolve_input export.
  • Add task sdk:bindings-cpp and include it in task sdk:bindings-all.
  • Use uniffi-bindgen-cpp plus perl post-processing to rename generated register identifiers to register_node.
  • Update the SDK README with C++ bindings setup and generation instructions.

@cdecker
Copy link
Copy Markdown
Collaborator

cdecker commented May 20, 2026

Excellent addition @ardier16, thank you 🙏

Can we add a generation run in CI as a followup, so we can ensure that the CPP stub generation works as expected, and we don't accidentally break it?

Comment thread libs/gl-sdk/src/lib.rs
/// immediately without I/O.
///
/// Strips `lightning:` / `LIGHTNING:` prefixes automatically.
#[cfg(not(feature = "cpp-bindings"))]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make the entirety of the API sync, and then running async code inside of the Rust crate only. This would mean all the APIs are the same regardless of the host language are sync-only.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this in a followup PR. As @ardier16 pointed out in a call this is a breaking change, and together with #716 we will bump version to 0.4 once this is merged.

@cdecker cdecker merged commit 198f6ab into Blockstream:main May 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants