You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(building-a-node): update all samples to LDK 0.2, add TypeScript, drop Swift
Rewrite every code sample across the "Building a Node with LDK" tutorial to
the current LDK APIs, verified against docs.rs/lightning/0.2.2, ldk-sample,
and ldk-garbagecollected v0.2.0.0:
- Rust -> lightning 0.2.2 (the samples were ~0.0.x-era): ConfirmationTarget
variants, ChannelManager::new/ReadArgs (+router, +message_router),
KeysManager/ChainMonitor/Persist, events, create_bolt11_invoice/
pay_for_bolt11_invoice (old invoice/payment utils removed),
process_events_async, list_peers, OutputSpender.
- Kotlin -> ldk-java 0.2.0 where the API changed.
- Add non-Node.js TypeScript (lightningdevkit 0.2.0-0) to every code-group,
with honest notes where the bindings have gaps: pin 0.2.0-0 + WASM init,
SocketDescriptor over a WebSocket->TCP proxy for peer connections, and
manual event pumping (no BackgroundProcessor).
- Remove all Swift tabs (ldk-swift has no 0.1/0.2 release).
- Refresh implementation notes, dependencies, and reference links
(docs.rs 0.2.2 / ldk-garbagecollected v0.2.0.0 / TS bindings).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/building-a-node-with-ldk/connect-to-peers.md
+65-25Lines changed: 65 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ In this section you'll learn how to join the lightning network.
4
4
5
5
Firstly we need to have the ability to do high performance I/O operations. LDK provides default implementations for initializing all of your networking needs. If you are using Rust, you can use our simple socket handling library `lightning_net_tokio`. In Kotlin/Java you can use the `NioPeerHandler` which uses Java's NIO I/O interface.
6
6
7
+
In TypeScript there is no networking module for non-Node.js (browser) environments: WASM cannot open raw TCP sockets. Instead you implement a `SocketDescriptor` that bridges LDK to a transport you do have — typically a `WebSocket` talking to a WebSocket-to-TCP proxy you run server-side — and feed bytes to the `PeerManager` yourself. (Node.js users can use the separate [`lightningdevkit-node-net`](https://www.npmjs.com/package/lightningdevkit-node-net) package instead.)
8
+
7
9
**What it's used for**: making peer connections, facilitating peer data to and from LDK
8
10
9
11
::: code-group
@@ -13,14 +15,15 @@ use lightning_net_tokio; // use LDK's sample networking module
0 commit comments