From a5e7bd17fe1b9b490003fb8e5a42a62791cec507 Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Mon, 4 Jul 2022 17:16:13 +0100 Subject: [PATCH 1/6] Adds getting started installation instructions --- docs/.vuepress/config.js | 1 + docs/tutorials/getting-started.md | 109 ++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 docs/tutorials/getting-started.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 1724bc36e..9569bac5c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -89,6 +89,7 @@ const tutorialSidebar = [ title: 'Tutorials', collapsable: false, children: [ + '/tutorials/getting-started', '/tutorials/build_a_node_in_java', '/tutorials/build_a_node_in_rust' ], diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md new file mode 100644 index 000000000..919a35de0 --- /dev/null +++ b/docs/tutorials/getting-started.md @@ -0,0 +1,109 @@ +# Getting started + +Welcome to the Lightning Development Kit documentation! + +If you have any questions about anything related to LDK, feel free to ask our community on [GitHub Discussions](https://github.com/orgs/lightningdevkit/discussions) or join us on [Discord](https://discord.gg/5AcknnMfBw). + +## System Requirements +MacOS, Windows and Linux are supported. + +## Installation +To add LDK to a project, run: + +:::: tabs +::: tab "Rust" +```rust +/* +Add the following dependencies to your cargo.toml and replace {VERSION} with the +version number you want to use from +*/ + +[dependencies] +lightning = { version = VERSION, features = ["max_level_trace"] } +lightning-block-sync = { version = VERSION, features = [ "rpc-client" ] } +lightning-invoice = { version = VERSION } +lightning-net-tokio = { version = VERSION } +lightning-persister = { version = VERSION } +lightning-background-processor = { version = VERSION } +lightning-rapid-gossip-sync = { version = VERSION } +``` +::: +::: tab "Java" + +```xml + + + + org.lightningdevkit + ldk-java + {VERSION} + +``` + +```kotlin +/* +For Gradle, add the following dependency to your build.gradle and replace {VERSION} with +the version number you want to use from +*/ + +dependencies { + // ... + implementation 'org.lightningdevkit:ldk-java:{VERSION}' + // ... +} +``` +::: +::: tab "Kotlin" +```kotlin +/* 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. +Then add to your build.gradle file: +*/ + +dependencies { + // ... + implementation fileTree(include: ['*.aar'], dir: 'libs') + // ... +} +``` +::: + +::: tab "Javascript/Typescript" +```javascript +npm i lightningdevkit --save +``` +::: +:::: + +Example usage after installation is complete: +:::: tabs +::: tab "Rust" +```rust +use lightning::chain::chaininterface::{FeeEstimator};``` +::: + +::: tab "Java" +```java +import org.ldk.structs.FeeEstimator +``` +::: + +::: tab "Kotlin" +```kotlin +import org.ldk.structs.FeeEstimator +``` +::: + +::: tab "JavaScript/Typescript" +```javascript +import { FeeEstimator } from "lightningdevkit"; +import * as fs from "fs"; +import { strict as assert } from "assert"; + +const wasm_file = fs.readFileSync("node_modules/lightningdevkit/liblightningjs.wasm"); +await ldk.initializeWasmFromBinary(wasm_file); +``` +::: +:::: \ No newline at end of file From ef11087222c2bfb081d67e1eb6f0dae2f401ec3f Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Fri, 8 Jul 2022 16:18:43 +0100 Subject: [PATCH 2/6] Point tutorials link at getting started page --- docs/.vuepress/config.js | 2 +- docs/tutorials/getting-started.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 9569bac5c..c141541a9 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -147,7 +147,7 @@ module.exports = { }, { text: 'Tutorials', - link: '/tutorials/build_a_node_in_java' + link: '/tutorials/getting-started' }, { text: 'Blog', diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 919a35de0..ac558dc4f 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -81,7 +81,8 @@ Example usage after installation is complete: :::: tabs ::: tab "Rust" ```rust -use lightning::chain::chaininterface::{FeeEstimator};``` +use lightning::chain::chaininterface::{FeeEstimator}; +``` ::: ::: tab "Java" From 3a1090719676e2b5e1a3c5a6f14bc7e87ed377b2 Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Thu, 14 Jul 2022 16:25:02 +0100 Subject: [PATCH 3/6] Adds toml syntax highlighting --- docs/tutorials/getting-started.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index ac558dc4f..6e1b5c70b 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -11,12 +11,11 @@ MacOS, Windows and Linux are supported. To add LDK to a project, run: :::: tabs -::: tab "Rust" -```rust -/* -Add the following dependencies to your cargo.toml and replace {VERSION} with the -version number you want to use from -*/ + +::: tab Rust +```toml + +# Add the following dependencies to your cargo.toml and replace {VERSION} with the version number you want to use from [dependencies] lightning = { version = VERSION, features = ["max_level_trace"] } @@ -28,8 +27,8 @@ lightning-background-processor = { version = VERSION } lightning-rapid-gossip-sync = { version = VERSION } ``` ::: -::: tab "Java" +::: tab Java ```xml @@ -45,7 +45,7 @@ version number you want to use from ```kotlin /* For Gradle, add the following dependency to your build.gradle and replace {VERSION} with -the version number you want to use from +the version number you want to use. */ dependencies { @@ -81,7 +81,7 @@ Example usage after installation is complete: :::: tabs ::: tab Rust ```rust -use lightning::chain::chaininterface::{FeeEstimator}; +use lightning::chain::chaininterface::FeeEstimator; ``` ::: From b1d8e3163b5d412bff5fd30d9d10defdd4b6625a Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Mon, 18 Jul 2022 15:02:46 +0100 Subject: [PATCH 5/6] Add CodeSwitcher for tab syncing --- docs/tutorials/getting-started.md | 154 ++++++++++++++++-------------- 1 file changed, 83 insertions(+), 71 deletions(-) diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 6c5f87d37..343dab9b0 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -6,34 +6,34 @@ If you have any questions about anything related to LDK, feel free to ask our co ## System Requirements MacOS, Windows and Linux are supported. - ## Installation To add LDK to a project, run: -:::: tabs - -::: tab Rust -```toml - -# Add the following dependencies to your cargo.toml and replace {VERSION} with the version number you want to use. - -[dependencies] -lightning = { version = {VERSION}, features = ["max_level_trace"] } -lightning-block-sync = { version = {VERSION}, features = [ "rpc-client" ] } -lightning-invoice = { version = {VERSION} } -lightning-net-tokio = { version = {VERSION} } -lightning-persister = { version = {VERSION} } -lightning-background-processor = { version = {VERSION} } -lightning-rapid-gossip-sync = { version = {VERSION} } -``` -::: - -::: tab Java + + + + + + + Example usage after installation is complete: -:::: tabs -::: tab Rust -```rust -use lightning::chain::chaininterface::FeeEstimator; -``` -::: -::: tab Java -```java -import org.ldk.structs.FeeEstimator -``` -::: + + + + + + + + + From e1513d6001d7f6b6df8a96f299b546a8d3361eef Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Mon, 18 Jul 2022 22:12:59 +0100 Subject: [PATCH 6/6] Fixes formatting --- docs/tutorials/getting-started.md | 42 ++++++++++++++----------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 343dab9b0..3a28a8e09 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -26,34 +26,33 @@ To add LDK to a project, run: ``` - - - -