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
- [ ] sending payments and getting the result of the payment
153
153
- [ ] connecting/disconnecting peers
154
-
155
-
156
-
<!-- In this guide, we'll be building a lightning node using LDK. -->
157
-
158
-
<!--The completed sample node built in this guide is available at [TODO(val) insert link].*Not intended for use in production.*This node is built using the Java bindings. See [TODO(val)] for all LDK language bindings options. -->
159
-
160
-
<!--Whether your project is an existing bitcoin-only wallet or a lightning wallet, the core process for-->
161
-
<!-- integrating LDK is the same. -->
162
-
163
-
<!--The process breaks down to 3 overarching steps:-->
164
-
<!--1.InitializingLDK's channel, peer, chain monitoring, and (optionally) routing objects. -->
165
-
<!-- * These objects will be parameterized by various other objects that can be from either your custom logic or one of LDK's supplied modules. -->
166
-
<!--2.Starting loops to (a) poll fornew peers and (b) tell LDK's channel and peer objects each time a minute passes, so they can properly maintain their state. -->
167
-
<!-- 2. Starting loops to (a) poll for new peers and (b) periodically nudge the channel and peer objects so they can properly maintain their state. -->
168
-
<!-- 3. Connect and disconnect blocks to LDK as they come in. -->
169
-
170
-
<!-- ## Requirements -->
171
-
<!-- 0. Some basic lightning knowledge like e.g. what a channel is, what force-closing means. -->
172
-
<!-- 1. A regtest bitcoind node (see [TODO(val) link to polar] for an easy way to spin this up) -->
173
-
<!-- 2. Java (this was tested using Java 11) -->
174
-
<!-- 3. LDK's Java bindings jar [TODO link] in your classpath -->
175
-
<!-- TODO revise requirements -->
176
-
177
-
<!-- ## Part 0: Setup -->
178
-
<!-- Import the bindings to your Java file and define a `main()`: -->
179
-
<!-- ```java -->
180
-
<!-- import org.ldk.impl.bindings; -->
181
-
182
-
<!-- publicstatic void main(String[] args) { -->
183
-
184
-
<!-- } -->
185
-
<!-- ``` -->
186
-
187
-
<!-- ## Part1:ManagingChannels-->
188
-
<!--We'll start by initializing probably the most core struct to Rust-Lightning (see FAQs[TODO add link] for the difference between Rust-Lightning and LDK): the channel manager. -->
189
-
190
-
<!-- First, we'll initialize the objects that the channel manager is parameterized by. -->
<!-- ## Part1:Set up ObjectsUsedForChainMonitoring-->
194
-
<!--Every lightning implementation needs a way to watch for relevant transactions appearing on-chain. -->
195
-
196
-
<!-- ### Setup-->
197
-
<!--But first, some housekeeping. -->
198
-
199
-
<!--1.Within `main`, initialize a logger. A logger can be anything that satisfies the `LoggerInterface` interface [TODO add link].Inthiscase, we'll just print to the console. -->
200
-
201
-
<!-- ```java -->
202
-
<!-- public static void main(String[] args) { -->
203
-
<!-- // LoggerInterface is a functional interface, so we can implement it with a lambda -->
204
-
<!-- final logger = Logger.new_impl((String log) -> System.out.println(log)); -->
205
-
<!-- } -->
206
-
<!-- ``` -->
207
-
208
-
<!-- 2. Add an on-chain fee estimator, which is anything that satisfies the `FeeEstimatorInterface` interface [TODO add link]. We need this because LDK's chain monitoring logic is responsible for broadcasting force-close transactions. -->
<!--3.Add a transaction broadcaster, which is anything that satisfies the `TransactionBroadcasterInterface` interface. We need this to broadcast the force-closing transaction if need be. -->
216
-
<!-- ```java -->
217
-
<!--..-->
218
-
<!--final tx_broadcaster =-->
219
-
<!-- ``` -->
220
-
221
-
222
-
<!--4.Add a data persister, which is anything that satisfies the `PersisterInterface` interface. We need this because our chain monitoring system also needs to ensure that crucial channel data is pesisted to disk and/or backups. -->
223
-
<!-- ```java -->
224
-
<!--..-->
225
-
<!--final persister =-->
226
-
<!-- ``` -->
227
-
228
-
<!--We're now ready to initialize our chain monitor. -->
229
-
230
-
<!-- ```java -->
231
-
<!-- .. -->
232
-
<!-- final chain_monitor = ChainMonitor.constructor_new(null, tx_broadcaster, logger, fee_estimator, persister); -->
233
-
<!-- ``` -->
234
-
235
-
<!-- Next, we'll add the feature of telling this object whenever we receive a connected or disconnected block. -->
236
-
237
-
238
-
<!-- ## -->
239
-
240
-
<!--// do it in the checklist format` -->
241
-
242
-
<!-- [ ] fee estimator -->
243
-
<!--< code sample>-->
244
-
245
-
<!-- [ ] tx broadcaster and a brief "what it's used for/context/info for each one -->
246
-
<!-- <Desription> -->
247
-
<!-- What it's used for: ... -->
248
-
<!-- What it depends on: ... -->
249
-
250
-
<!-- < code sample w/ comments AND commentary> -->
251
-
252
-
<!-- [ ] this depend son these items -->
253
-
<!-- ... -->
254
-
<!-- [ ] start loop to receive new peers -->
255
-
<!-- [ ] start loop to persist (these can be combined.. with these) -->
256
-
<!-- [ ] -->
257
-
258
-
259
-
<!-- get a meeting w/ matt -->
260
-
<!-- - write the checklist and then check w/ him -->
0 commit comments