-
Notifications
You must be signed in to change notification settings - Fork 44
Adds getting started installation instructions #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a5e7bd1
Adds getting started installation instructions
ef11087
Point tutorials link at getting started page
3a10907
Adds toml syntax highlighting
29edeeb
Minor copy changes
b1d8e31
Add CodeSwitcher for tab syncing
e1513d6
Fixes formatting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# 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: | ||
|
||
<CodeSwitcher :languages="{rust:'Rust', java:'Java', kotlin:'Kotlin', javascript:'JavaScript'}"> | ||
<template v-slot: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} } | ||
``` | ||
|
||
</template> | ||
<template v-slot:java> | ||
|
||
```xml | ||
<!-- | ||
For Maven, add the following dependency to your POM and replace {VERSION} with the | ||
version number you want to use. | ||
--> | ||
|
||
<dependency> | ||
<groupId>org.lightningdevkit</groupId> | ||
<artifactId>ldk-java</artifactId> | ||
<version>{VERSION}</version> | ||
</dependency> | ||
``` | ||
|
||
```kotlin | ||
/* | ||
For Gradle, add the following dependency to your build.gradle and replace {VERSION} with | ||
the version number you want to use. | ||
*/ | ||
|
||
dependencies { | ||
// ... | ||
implementation 'org.lightningdevkit:ldk-java:{VERSION}' | ||
// ... | ||
} | ||
``` | ||
|
||
</template> | ||
<template v-slot: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') | ||
// ... | ||
} | ||
``` | ||
|
||
</template> | ||
<template v-slot:javascript> | ||
|
||
```javascript | ||
npm i lightningdevkit --save | ||
``` | ||
|
||
</template> | ||
</CodeSwitcher> | ||
|
||
Example usage after installation is complete: | ||
|
||
<CodeSwitcher :languages="{rust:'Rust', java:'Java', kotlin:'Kotlin', javascript:'JavaScript'}"> | ||
<template v-slot:rust> | ||
|
||
```rust | ||
use lightning::chain::chaininterface::FeeEstimator; | ||
``` | ||
|
||
</template> | ||
<template v-slot:java> | ||
|
||
```java | ||
import org.ldk.structs.FeeEstimator | ||
``` | ||
|
||
</template> | ||
<template v-slot:kotlin> | ||
|
||
```kotlin | ||
import org.ldk.structs.FeeEstimator | ||
``` | ||
|
||
</template> | ||
<template v-slot:javascript> | ||
|
||
```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); | ||
``` | ||
|
||
</template> | ||
</CodeSwitcher> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation levels seem inconsistent across the first
CodeSwitcher
block, FWIW. The second block seems fine though with two spaces and one within the formatted language blocks.