diff --git a/CHANGELOG.md b/CHANGELOG.md index 879c07135..5168d1e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,34 @@ -# 0.1-alpha - Apr 27, 2023 +# 0.1-alpha.1 - Jun 6, 2023 +- Generation of Swift, Kotlin (JVM and Android), and Python bindings is now supported through UniFFI (#25). +- Lists of connected peers and channels may now be retrieved in bindings (#56). +- Gossip data may now be sourced from the P2P network, or a Rapid Gossip Sync server (#70). +- Network addresses are now stored and resolved via a `NetAddress` type (#85). +- The `next_event` method has been renamed `wait_next_event` and a new non-blocking method for event queue access has been introduces as `next_event` (#91). +- Node announcements are now regularly broadcasted (#93). +- Duplicate payments are now only avoided if we actually sent them out (#96). +- The `Node` may now be used to sign and verify arbitrary messages (#99). +- A `KVStore` interface is introduced that may be used to implement custom persistence backends (#101). +- An `SqliteStore` persistence backend is added and set as the new default (#100). +- Successful fee rate updates are now mandatory on `Node` startup (#102). +- The wallet sync intervals are now configurable (#102). +- Granularity of logging can now be configured (#108). + + +In total, this release includes changes in 64 commits from 4 authors: +- Steve Myers +- Elias Rohrer +- Jurvis Tan +- televis +**Note:** This release is still considered experimental, should not be run in +production, and no compatibility guarantees are given until the release of 0.1. + +# 0.1-alpha - Apr 27, 2023 This is the first alpha release of LDK Node. It features support for sourcing -chain data via an Esplora server, filesystem persistence, gossip sourcing via -the Lightning peer-to-peer network, and configurble entropy sources for the +chain data via an Esplora server, file system persistence, gossip sourcing via +the Lightning peer-to-peer network, and configurable entropy sources for the integrated LDK and BDK-based wallets. -Note that this release is still considered experimental, should not be run in +**Note:** This release is still considered experimental, should not be run in production, and no compatibility guarantees are given until the release of 0.1. diff --git a/Cargo.toml b/Cargo.toml index 0be56137d..462828cb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ldk-node" -version = "0.1.0-alpha" +version = "0.1.0-alpha.1" authors = ["Elias Rohrer "] homepage = "https://lightningdevkit.org/" license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index ae67af6b8..35f880e11 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # LDK Node -A ready-to-go Lightning node library built using [LDK](https://lightningdevkit.org/) and [BDK](https://bitcoindevkit.org/). -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. +[![Crate](https://img.shields.io/crates/v/ldk-node.svg?logo=rust)](https://crates.io/crates/ldk-node) +[![Documentation](https://img.shields.io/static/v1?logo=read-the-docs&label=docs.rs&message=ldk-node&color=informational)](https://docs.rs/ldk-node) -## Getting Started +A ready-to-go Lightning node library built using [LDK][ldk] and [BDK][bdk]. + +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. -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.: +## Getting Started +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. ```rust use ldk_node::{Builder, NetAddress}; @@ -15,23 +18,27 @@ use ldk_node::bitcoin::Network; use std::str::FromStr; fn main() { - let mut builder = Builder::new(); + let builder = Builder::new(); builder.set_network(Network::Testnet); - builder.set_esplora_server_url("https://blockstream.info/testnet/api".to_string()); + builder.set_esplora_server("https://blockstream.info/testnet/api".to_string()); + builder.set_gossip_source_rgs("https://rapidsync.lightningdevkit.org/testnet/snapshot".to_string()); let node = builder.build(); + node.start().unwrap(); - let _funding_address = node.new_funding_address(); + let funding_address = node.new_funding_address(); // .. fund address .. - node.sync_wallets().unwrap(); - let node_id = PublicKey::from_str("NODE_ID").unwrap(); let node_addr = NetAddress::from_str("IP_ADDR:PORT").unwrap(); node.connect_open_channel(node_id, node_addr, 10000, None, false).unwrap(); + let event = node.wait_next_event(); + println!("EVENT: {:?}", event); + node.event_handled(); + let invoice = Invoice::from_str("INVOICE_STR").unwrap(); node.send_payment(&invoice).unwrap(); @@ -41,15 +48,27 @@ fn main() { ## Modularity -LDK Node currently comes with a decidedly opionated set of design choices: - -- On-chain data is handled by the integrated BDK wallet -- Chain data is accessed via Esplora (support for Electrum and `bitcoind` RPC will follow) -- Wallet and channel state is persisted to file system (support for SQLite will follow) -- 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) -- 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) +LDK Node currently comes with a decidedly opinionated set of design choices: +- On-chain data is handled by the integrated [BDK][bdk] wallet. +- Chain data may currently be sourced from an [Esplora][esplora] server, while support for Electrum and `bitcoind` RPC will follow soon. +- 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. +- 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. +- 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. ## Language Support - -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/). +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. + +[api_docs]: https://docs.rs/ldk-node/*/ldk_node/ +[api_docs_node]: https://docs.rs/ldk-node/*/ldk_node/struct.Node.html +[api_docs_builder]: https://docs.rs/ldk-node/*/ldk_node/struct.Builder.html +[rust_crate]: https://crates.io/ +[ldk]: https://lightningdevkit.org/ +[bdk]: https://bitcoindevkit.org/ +[esplora]: https://github.com/Blockstream/esplora +[sqlite]: https://sqlite.org/ +[rust]: https://www.rust-lang.org/ +[swift]: https://www.swift.org/ +[kotlin]: https://kotlinlang.org/ +[python]: https://www.python.org/ +[flutter_bindings]: https://github.com/LtbLightning/ldk-node-flutter diff --git a/bindings/kotlin/ldk-node-android/gradle.properties b/bindings/kotlin/ldk-node-android/gradle.properties index 1d9ba5f22..42d16f35a 100644 --- a/bindings/kotlin/ldk-node-android/gradle.properties +++ b/bindings/kotlin/ldk-node-android/gradle.properties @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official -libraryVersion=0.0.1-SNAPSHOT +libraryVersion=0.1-alpha.1 diff --git a/bindings/kotlin/ldk-node-jvm/gradle.properties b/bindings/kotlin/ldk-node-jvm/gradle.properties index 8c286a4ea..ab58807b9 100644 --- a/bindings/kotlin/ldk-node-jvm/gradle.properties +++ b/bindings/kotlin/ldk-node-jvm/gradle.properties @@ -1,3 +1,3 @@ org.gradle.jvmargs=-Xmx1536m kotlin.code.style=official -libraryVersion=0.0.1-SNAPSHOT +libraryVersion=0.1-alpha.1 diff --git a/src/lib.rs b/src/lib.rs index 0a8f4925e..85b085028 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,23 +33,27 @@ //! use std::str::FromStr; //! //! fn main() { -//! let mut builder = Builder::new(); +//! let builder = Builder::new(); //! builder.set_network(Network::Testnet); //! builder.set_esplora_server("https://blockstream.info/testnet/api".to_string()); +//! builder.set_gossip_source_rgs("https://rapidsync.lightningdevkit.org/testnet/snapshot".to_string()); //! //! let node = builder.build(); +//! //! node.start().unwrap(); //! -//! let _funding_address = node.new_funding_address(); +//! let funding_address = node.new_funding_address(); //! //! // .. fund address .. //! -//! node.sync_wallets().unwrap(); -//! //! let node_id = PublicKey::from_str("NODE_ID").unwrap(); //! let node_addr = NetAddress::from_str("IP_ADDR:PORT").unwrap(); //! node.connect_open_channel(node_id, node_addr, 10000, None, false).unwrap(); //! +//! let event = node.wait_next_event(); +//! println!("EVENT: {:?}", event); +//! node.event_handled(); +//! //! let invoice = Invoice::from_str("INVOICE_STR").unwrap(); //! node.send_payment(&invoice).unwrap(); //!