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
Copy file name to clipboardExpand all lines: docs/tutorials/building-a-node-with-ldk/opening-a-channel.md
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -55,8 +55,13 @@ val createChannelResult = channelManager.create_channel(
55
55
56
56
# FundingGenerationReady Event Handling
57
57
58
-
At this point, an outbound channel has been initiated with your peer and it will appear in `ChannelManager::list_channels`. However, the channel is not yet funded. Once your peer accepts the channel, you will be notified with a `FundingGenerationReady` event. It's then your responsibility to construct the funding transaction and pass it to ChannelManager, which will broadcast it once it receives your channel counterparty's signature.
58
+
At this point, an outbound channel has been initiated with your peer and it will appear in `ChannelManager::list_channels`. However, the channel is not yet funded. Once your peer accepts the channel, you will be notified with a `FundingGenerationReady` event. It's then your responsibility to construct the funding transaction and pass it to ChannelManager, which will broadcast it once it receives your channel counterparty's signature.
59
59
60
+
::: tip Note
61
+
62
+
Remember that the funding transaction must only spend SegWit inputs.
@@ -719,28 +723,30 @@ If you are connecting full blocks or using BIP 157/158, then it is recommended t
719
723
LDK's `lightning_block_sync` sample module as in the example above: the high-level steps that must be done for both `ChannelManager` and each `ChannelMonitor` are as follows:
720
724
721
725
1. Get the last blockhash that each object saw.
722
-
*`ChannelManager`'s is in `channel_manager_constructor.channel_manager_latest_block_hash`
723
-
* Each `ChannelMonitor`'s is in `channel_manager_constructor.channel_monitors`, as the 2nd element in each tuple
726
+
*Receive the latest block hash when through [deserializtion](https://docs.rs/lightning/*/lightning/ln/channelmanager/struct.ChannelManagerReadArgs.html) of the `ChannelManager` via `read()`
727
+
* Each `ChannelMonitor`'s is in `channel_manager.channel_monitors`, as the 2nd element in each tuple
724
728
2. For each object, if its latest known blockhash has been reorged out of the chain, then disconnect blocks using `channel_manager.as_Listen().block_disconnected(..)` or `channel_monitor.block_disconnected(..)` until you reach the last common ancestor with the main chain.
725
729
3. For each object, reconnect blocks starting from the common ancestor until it gets to your best known chain tip using `channel_manager.as_Listen().block_connected(..)` and/or `channel_monitor.block_connected(..)`.
726
-
4. Call `channel_manager_constructor.chain_sync_completed(..)` to complete the initial sync process.
730
+
4. Call `channel_manager.chain_sync_completed(..)` to complete the initial sync process.
727
731
732
+
**Esplora**
728
733
734
+
Alternatively, you can use LDK's `lightning-block-sync` crate. This provides utilities for syncing LDK via the transaction-based Confirm interface.
729
735
730
-
**Electrum**
736
+
**Electrum/Esplora**
731
737
732
-
Otherwise, you can use LDK's `Confirm` interface as in the examples above. The high-level steps are as follows:
738
+
Otherwise, you can use LDK's `Confirm` interface directly as in the examples above. The high-level steps are as follows:
733
739
1. Tell LDK about relevant confirmed and unconfirmed transactions.
734
740
2. Tell LDK what your best known block header and height is.
735
741
3. Call `channel_manager_constructor.chain_sync_completed(..)` to complete the initial sync process.
**Optional dependency:**`Access`, a source of chain information. Recommended to be able to verify channels before adding them to the internal network graph.
/* To include the LDK Kotlin bindings in an Android project download the latest binary from https://github.com/lightningdevkit/ldk-garbagecollected/releases and place it in your libs directory.
0 commit comments