Skip to content

Commit 9ee2baa

Browse files
committed
Update README
1 parent e95f04e commit 9ee2baa

File tree

2 files changed

+45
-22
lines changed

2 files changed

+45
-22
lines changed

README.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# LDK Node
2-
A ready-to-go Lightning node library built using [LDK](https://lightningdevkit.org/) and [BDK](https://bitcoindevkit.org/).
32

4-
LDK Node is a non-custodial Lightning node in library form. Its central goal is to provide a small, simple, and straightforward interface that enables users to easily set up and run a Lightning node with an integrated on-chain wallet. While minimalism is at its core, LDK Node aims to be sufficiently modular and configurable to be useful for a variety of use cases.
3+
[![Crate](https://img.shields.io/crates/v/ldk-node.svg?logo=rust)](https://crates.io/crates/ldk-node)
4+
[![Documentation](https://img.shields.io/static/v1?logo=read-the-docs&label=docs.rs&message=ldk-node&color=informational)](https://docs.rs/ldk-node)
55

6-
## Getting Started
6+
A ready-to-go Lightning node library built using [LDK][ldk] and [BDK][bdk].
7+
8+
LDK Node is a self-custodial Lightning node in library form. Its central goal is to provide a small, simple, and straightforward interface that enables users to easily set up and run a Lightning node with an integrated on-chain wallet. While minimalism is at its core, LDK Node aims to be sufficiently modular and configurable to be useful for a variety of use cases.
79

8-
The primary abstraction of the library is the `Node`, which can be retrieved by setting up and configuring a `Builder` to your liking and calling `build()`. `Node` can then be controlled via commands such as `start`, `stop`, `connect_open_channel`, `send_payment`, etc.:
10+
## Getting Started
11+
The primary abstraction of the library is the [`Node`][api_docs_node], which can be retrieved by setting up and configuring a [`Builder`][api_docs_builder] to your liking and calling one of the `build` methods. `Node` can then be controlled via commands such as `start`, `stop`, `connect_open_channel`, `send_payment`, etc.
912

1013
```rust
1114
use ldk_node::{Builder, NetAddress};
@@ -15,23 +18,27 @@ use ldk_node::bitcoin::Network;
1518
use std::str::FromStr;
1619

1720
fn main() {
18-
let mut builder = Builder::new();
21+
let builder = Builder::new();
1922
builder.set_network(Network::Testnet);
20-
builder.set_esplora_server_url("https://blockstream.info/testnet/api".to_string());
23+
builder.set_esplora_server("https://blockstream.info/testnet/api".to_string());
24+
builder.set_gossip_source_rgs("https://rapidsync.lightningdevkit.org/testnet/snapshot".to_string());
2125

2226
let node = builder.build();
27+
2328
node.start().unwrap();
2429

25-
let _funding_address = node.new_funding_address();
30+
let funding_address = node.new_funding_address();
2631

2732
// .. fund address ..
2833

29-
node.sync_wallets().unwrap();
30-
3134
let node_id = PublicKey::from_str("NODE_ID").unwrap();
3235
let node_addr = NetAddress::from_str("IP_ADDR:PORT").unwrap();
3336
node.connect_open_channel(node_id, node_addr, 10000, None, false).unwrap();
3437

38+
let event = node.wait_next_event();
39+
println!("EVENT: {:?}", event);
40+
node.event_handled();
41+
3542
let invoice = Invoice::from_str("INVOICE_STR").unwrap();
3643
node.send_payment(&invoice).unwrap();
3744

@@ -41,15 +48,27 @@ fn main() {
4148

4249
## Modularity
4350

44-
LDK Node currently comes with a decidedly opionated set of design choices:
45-
46-
- On-chain data is handled by the integrated BDK wallet
47-
- Chain data is accessed via Esplora (support for Electrum and `bitcoind` RPC will follow)
48-
- Wallet and channel state is persisted to file system (support for SQLite will follow)
49-
- Gossip data is sourced via Lightnings peer-to-peer network (support for [Rapid Gossip Sync](https://docs.rs/lightning-rapid-gossip-sync/*/lightning_rapid_gossip_sync/) will follow)
50-
- Entropy for the Lightning and on-chain wallets may be generated and persisted for or provided by the user (as raw bytes or [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) mnemonic)
51+
LDK Node currently comes with a decidedly opinionated set of design choices:
5152

53+
- On-chain data is handled by the integrated [BDK][bdk] wallet.
54+
- Chain data may currently be sourced from an [Esplora][esplora] server, while support for Electrum and `bitcoind` RPC will follow soon.
55+
- Wallet and channel state may be persisted to an [SQLite][sqlite] database, to file system, or to a custom back-end to be implemented by the user.
56+
- Gossip data may be sourced via Lightning's peer-to-peer network or the [Rapid Gossip Sync](https://docs.rs/lightning-rapid-gossip-sync/*/lightning_rapid_gossip_sync/) protocol.
57+
- Entropy for the Lightning and on-chain wallets may be sourced from raw bytes or a [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) mnemonic. In addition, LDK Node offers the means to generate and persist the entropy bytes to disk.
5258

5359
## Language Support
54-
55-
LDK Node is written in [Rust](https://www.rust-lang.org/) and may therefore be natively included in any `std` Rust program. Beyond its Rust API it also offers language bindings for Swift, Kotlin, and Python based on [UniFFI](https://github.com/mozilla/uniffi-rs/).
60+
LDK Node itself is written in [Rust][rust] and may therefore be natively added as a library dependency to any `std` Rust program. However, beyond its Rust API it also offers language bindings for [Swift][swift], [Kotlin][kotlin], and [Python][python] based on the [UniFFI](https://github.com/mozilla/uniffi-rs/). Moreover, [Flutter bindings][flutter_bindings] are also available.
61+
62+
[api_docs]: https://docs.rs/ldk-node/*/ldk_node/
63+
[api_docs_node]: https://docs.rs/ldk-node/*/ldk_node/struct.Node.html
64+
[api_docs_builder]: https://docs.rs/ldk-node/*/ldk_node/struct.Builder.html
65+
[rust_crate]: https://crates.io/
66+
[ldk]: https://lightningdevkit.org/
67+
[bdk]: https://bitcoindevkit.org/
68+
[esplora]: https://github.com/Blockstream/esplora
69+
[sqlite]: https://sqlite.org/
70+
[rust]: https://www.rust-lang.org/
71+
[swift]: https://www.swift.org/
72+
[kotlin]: https://kotlinlang.org/
73+
[python]: https://www.python.org/
74+
[flutter_bindings]: https://github.com/LtbLightning/ldk-node-flutter

src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,27 @@
3333
//! use std::str::FromStr;
3434
//!
3535
//! fn main() {
36-
//! let mut builder = Builder::new();
36+
//! let builder = Builder::new();
3737
//! builder.set_network(Network::Testnet);
3838
//! builder.set_esplora_server("https://blockstream.info/testnet/api".to_string());
39+
//! builder.set_gossip_source_rgs("https://rapidsync.lightningdevkit.org/testnet/snapshot".to_string());
3940
//!
4041
//! let node = builder.build();
42+
//!
4143
//! node.start().unwrap();
4244
//!
43-
//! let _funding_address = node.new_funding_address();
45+
//! let funding_address = node.new_funding_address();
4446
//!
4547
//! // .. fund address ..
4648
//!
47-
//! node.sync_wallets().unwrap();
48-
//!
4949
//! let node_id = PublicKey::from_str("NODE_ID").unwrap();
5050
//! let node_addr = NetAddress::from_str("IP_ADDR:PORT").unwrap();
5151
//! node.connect_open_channel(node_id, node_addr, 10000, None, false).unwrap();
5252
//!
53+
//! let event = node.wait_next_event();
54+
//! println!("EVENT: {:?}", event);
55+
//! node.event_handled();
56+
//!
5357
//! let invoice = Invoice::from_str("INVOICE_STR").unwrap();
5458
//! node.send_payment(&invoice).unwrap();
5559
//!

0 commit comments

Comments
 (0)