Skip to content

Commit f8f7404

Browse files
author
Conor Okus
committed
Remove JavaScript add Router
1 parent dfd8295 commit f8f7404

File tree

2 files changed

+58
-23
lines changed

2 files changed

+58
-23
lines changed

docs/tutorials/building-a-node-with-ldk/setting-up-a-channel-manager.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,36 @@ To add a `ChannelManager` to your application, run:
1616
&fee_estimator,
1717
&chain_monitor,
1818
&broadcaster,
19+
&router,
1920
&logger,
20-
&keys_manager,
21+
&entropy_source,
22+
&node_signer,
23+
&signer_provider,
2124
user_config,
2225
chain_params,
26+
current_timestamp
2327
);
2428
```
2529
</template>
2630

2731
<template v-slot:kotlin>
2832

29-
```java
33+
```kotlin
3034
import org.ldk.batteries.ChannelManagerConstructor
3135

3236
val channelManagerConstructor = ChannelManagerConstructor(
3337
Network.LDKNetwork_Regtest,
3438
userConfig,
3539
latestBlockHash,
3640
latestBlockHeight,
37-
keysManager.as_KeysInterface(),
41+
keysManager.as_EntropySource(),
42+
keysManager.as_NodeSigner(),
43+
keysManager.as_SignerProvider(),
3844
feeEstimator,
3945
chainMonitor,
4046
router,
47+
scoringParams,
48+
routerWrapper, // optional
4149
txBroadcaster,
4250
logger
4351
);
@@ -163,6 +171,47 @@ retrieving fresh ones every time
163171

164172
**References:** [Rust `FeeEstimator` docs](https://docs.rs/lightning/*/lightning/chain/chaininterface/trait.FeeEstimator.html), [Java `FeeEstimator` bindings](https://github.com/lightningdevkit/ldk-garbagecollected/blob/main/src/main/java/org/ldk/structs/FeeEstimator.java)
165173

174+
### Initialize the `Router`
175+
176+
**What it's used for:** Finds a Route for a payment between the given payer and a payee.
177+
178+
<CodeSwitcher :languages="{rust:'Rust', kotlin:'Kotlin', swift:'Swift'}">
179+
<template v-slot:rust>
180+
181+
```rust
182+
let router = DefaultRouter::new(
183+
network_graph.clone(),
184+
logger.clone(),
185+
keys_manager.get_secure_random_bytes(),
186+
scorer.clone(),
187+
ProbabilisticScoringFeeParameters::default()
188+
)
189+
```
190+
191+
</template>
192+
193+
<template v-slot:kotlin>
194+
195+
```java
196+
197+
```
198+
199+
</template>
200+
201+
<template v-slot:swift>
202+
203+
```Swift
204+
205+
```
206+
207+
</template>
208+
209+
</CodeSwitcher>
210+
211+
**Dependencies:** `P2PGossipSync`, `Logger`, `KeysManager`, `Scorer`
212+
213+
**References:** [Rust `Router` docs](https://docs.rs/lightning/*/lightning/routing/router/trait.Router.html), [Java `Router` bindings](https://github.com/lightningdevkit/ldk-garbagecollected/blob/main/src/main/java/org/ldk/structs/Router.java)
214+
166215
### Initialize the `Logger`
167216
**What it's used for:** LDK logging
168217

docs/tutorials/getting-started.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MacOS, Windows and Linux are supported.
99
## Installation
1010
To add LDK to a project, run:
1111

12-
<CodeSwitcher :languages="{rust:'Rust', kotlin:'Kotlin', javascript:'JavaScript'}">
12+
<CodeSwitcher :languages="{rust:'Rust', kotlin:'Kotlin'}">
1313
<template v-slot:rust>
1414

1515
```toml
@@ -53,18 +53,11 @@ To add LDK to a project, run:
5353

5454
</template>
5555

56-
<template v-slot:javascript>
57-
58-
```javascript
59-
npm i lightningdevkit --save
60-
```
61-
62-
</template>
6356
</CodeSwitcher>
6457

6558
Example usage after installation is complete:
6659

67-
<CodeSwitcher :languages="{rust:'Rust', kotlin:'Kotlin', javascript:'JavaScript'}">
60+
<CodeSwitcher :languages="{rust:'Rust', kotlin:'Kotlin'}">
6861
<template v-slot:rust>
6962

7063
```rust
@@ -80,16 +73,9 @@ Example usage after installation is complete:
8073
```
8174

8275
</template>
83-
<template v-slot:javascript>
84-
85-
```javascript
86-
import { FeeEstimator } from "lightningdevkit";
87-
import * as fs from "fs";
88-
import { strict as assert } from "assert";
8976

90-
const wasm_file = fs.readFileSync("node_modules/lightningdevkit/liblightningjs.wasm");
91-
await ldk.initializeWasmFromBinary(wasm_file);
92-
```
93-
94-
</template>
9577
</CodeSwitcher>
78+
79+
::: tip Installing LDK Swift
80+
Import LDK through the Swift package manager
81+
:::

0 commit comments

Comments
 (0)