#lightning #interface #sync #confirm #syncing #ldk #async

lightning-transaction-sync

Utilities for syncing LDK via the transaction-based Confirm interface

23 releases

0.1.0 Jan 16, 2025
0.1.0-beta1 Dec 22, 2024
0.0.125 Oct 14, 2024
0.0.123 May 9, 2024
0.0.114 Mar 4, 2023

#882 in Magic Beans

Download history 834/week @ 2024-10-07 2316/week @ 2024-10-14 690/week @ 2024-10-21 860/week @ 2024-10-28 1256/week @ 2024-11-04 1038/week @ 2024-11-11 1039/week @ 2024-11-18 730/week @ 2024-11-25 915/week @ 2024-12-02 1358/week @ 2024-12-09 721/week @ 2024-12-16 185/week @ 2024-12-23 483/week @ 2024-12-30 569/week @ 2025-01-06 1517/week @ 2025-01-13 914/week @ 2025-01-20

3,492 downloads per month
Used in 7 crates (2 directly)

MIT/Apache

7MB
121K SLoC

Provides utilities for syncing LDK via the transaction-based Confirm interface.

The provided synchronization clients need to be registered with a ChainMonitor via the Filter interface. Then, the respective fn sync needs to be called with the Confirm implementations to be synchronized, i.e., usually instances of ChannelManager and ChainMonitor.

Features and Backend Support

  • esplora-blocking enables syncing against an Esplora backend based on a blocking client.
  • esplora-async enables syncing against an Esplora backend based on an async client.
  • esplora-async-https enables the async Esplora client with support for HTTPS.

Version Compatibility

Currently this crate is compatible with LDK version 0.0.114 and above using channels which were created on LDK version 0.0.113 and above.

Usage Example:

let tx_sync = Arc::new(EsploraSyncClient::new(
	esplora_server_url,
	Arc::clone(&some_logger),
));

let chain_monitor = Arc::new(ChainMonitor::new(
	Some(Arc::clone(&tx_sync)),
	Arc::clone(&some_broadcaster),
	Arc::clone(&some_logger),
	Arc::clone(&some_fee_estimator),
	Arc::clone(&some_persister),
));

let channel_manager = Arc::new(ChannelManager::new(
	Arc::clone(&some_fee_estimator),
	Arc::clone(&chain_monitor),
	Arc::clone(&some_broadcaster),
	Arc::clone(&some_router),
	Arc::clone(&some_logger),
	Arc::clone(&some_entropy_source),
	Arc::clone(&some_node_signer),
	Arc::clone(&some_signer_provider),
	user_config,
	chain_params,
));

let confirmables = vec![
	&*channel_manager as &(dyn Confirm + Sync + Send),
	&*chain_monitor as &(dyn Confirm + Sync + Send),
];

tx_sync.sync(confirmables).unwrap();

Dependencies

~10–22MB
~265K SLoC