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/building-a-node-with-ldk/setting-up-a-channel-manager.md
+66-28
Original file line number
Diff line number
Diff line change
@@ -931,16 +931,18 @@ _after_ the `ChannelMonitor`s and `ChannelManager` are synced to the chain tip (
931
931
932
932
### Sync `ChannelMonitor`s and `ChannelManager` to chain tip
933
933
934
-
**What it's used for:**this step is only necessary if you're restarting and have open channels. This step ensures that LDK channel state is up-to-date with the bitcoin blockchain
934
+
**What it's used for:**this step is only necessary if you're restarting and have open channels. This step ensures that LDK channel state is up-to-date with the bitcoin blockchain.
935
+
936
+
There are 2 main options for synchronizing to chain on startup:
937
+
938
+
#### Full Blocks or BIP 157/158 (Compact Block Filters)
If you are connecting full blocks or using BIP 157/158, then it is recommended to use
1020
+
LDK's [`lightning_block_sync`](https://docs.rs/lightning-block-sync/*/lightning_block_sync/) crate as in the example above: the high-level steps that must be done for both `ChannelManager` and each `ChannelMonitor` are as follows:
1021
+
1022
+
1. Get the last blockhash that each object saw.
1023
+
-Receive the latest block hash when through [deserializtion](https://docs.rs/lightning/*/lightning/ln/channelmanager/struct.ChannelManagerReadArgs.html) of the `ChannelManager` via `read()`
1024
+
-Each `ChannelMonitor`'s is in `channel_manager.channel_monitors`, as the 2nd element in each tuple
1025
+
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.
1026
+
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(..)`.
1027
+
4. Call `channel_manager.chain_sync_completed(..)` to complete the initial sync process.
1028
+
1029
+
1030
+
#### Electrum or Esplora
1031
+
1032
+
Alternatively, you can use LDK's [`lightning-transaction-sync`](https://docs.rs/lightning-transaction-sync/*/lightning_transaction_sync/) crate. This provides utilities for syncing LDK via the transaction-based [`Confirm`](https://docs.rs/lightning/*/lightning/chain/trait.Confirm.html)interface.
There are 2 main options for synchronizing to chain on startup:
1124
-
1125
-
**Full Blocks or BIP 157/158**
1126
-
1127
-
If you are connecting full blocks or using BIP 157/158, then it is recommended to use
1128
-
LDK's `lightning_block_sync` crate asin the example above: the high-level steps that must be done for both `ChannelManager` and each `ChannelMonitor` are as follows:
1129
-
1130
-
1. Get the last blockhash that each object saw.
1131
-
-Receive the latest block hash when through [deserializtion](https://docs.rs/lightning/*/lightning/ln/channelmanager/struct.ChannelManagerReadArgs.html) of the `ChannelManager` via `read()`
1132
-
-Each `ChannelMonitor`'s is in `channel_manager.channel_monitors`, as the 2nd element in each tuple
1133
-
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.
1134
-
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(..)`.
1135
-
4. Call `channel_manager.chain_sync_completed(..)` to complete the initial sync process.
1136
-
1137
-
**Electrum/Esplora**
1138
-
1139
-
Alternatively, you can use LDK's `lightning-transaction-sync` crate. This provides utilities for syncing LDK via the transaction-based `Confirm` interface.
0 commit comments