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

lightning-transaction-sync

Utilities for syncing LDK via the transaction-based Confirm interface

16 releases

new 0.0.123-beta Apr 19, 2024
0.0.121 Jan 23, 2024
0.0.119 Dec 16, 2023
0.0.118 Oct 24, 2023
0.0.114 Mar 4, 2023

#5 in #ldk

Download history 21/week @ 2023-12-22 277/week @ 2023-12-29 528/week @ 2024-01-05 246/week @ 2024-01-12 738/week @ 2024-01-19 595/week @ 2024-01-26 786/week @ 2024-02-02 846/week @ 2024-02-09 1081/week @ 2024-02-16 785/week @ 2024-02-23 1352/week @ 2024-03-01 437/week @ 2024-03-08 68/week @ 2024-03-15 82/week @ 2024-03-22 76/week @ 2024-03-29 180/week @ 2024-04-05

472 downloads per month
Used in 2 crates

MIT/Apache

6.5MB
105K 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

~8–21MB
~249K SLoC