Skip to content

Add initial guides & documentation#186

Merged
tnull merged 1 commit intolightningdevkit:mainfrom
benthecarman:docs
Apr 16, 2026
Merged

Add initial guides & documentation#186
tnull merged 1 commit intolightningdevkit:mainfrom
benthecarman:docs

Conversation

@benthecarman
Copy link
Copy Markdown
Collaborator

Add docs/ directory with guides for getting started, configuration, the gRPC API, Tor setup, and production operations. Add per-crate READMEs for ldk-server-client, ldk-server-grpc, and ldk-server-cli.

Include READMEs in lib.rs via doc = include_str! so rustdoc validates the code examples. Update the root README to link to the new docs and fix outdated REST/port references.

Some of the things documented are still subject to change (auth) but if we're able to land this first, we can then just update the docs with the changes as well.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 14, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@benthecarman benthecarman requested a review from tnull April 14, 2026 21:47
@benthecarman benthecarman force-pushed the docs branch 4 times, most recently from ba54d2f to fbba9ba Compare April 14, 2026 21:54
Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread docs/api-guide.md
## Transport

- **Protocol:** gRPC over HTTP/2 with TLS (self-signed by default)
- **Default address:** `127.0.0.1:3536`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, but especially if we want to document concrete values, do we have a plan for how to keep the API docs here in-sync and up-to-date with the actual implementation? Could we somehow check that in CI? Or would it make sense to have this live in or generated by rustdoc, so that we can link to the actual values in the code?

Copy link
Copy Markdown
Collaborator Author

@benthecarman benthecarman Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could put these as docs in the rust files so we could use the consts but feels out of place. Otherwise, not really sure how we'd enforce because its pretty unstructured and hard to detect, maybe having claude verify?

I agree this can be a problem but most of these things should be pretty unchanging (don't see why we'd change the default port). Maybe just remove the Endpoint Reference section as that will have the most changes and just keep sections like Hodl Invoice Lifecycle and Pagination that just explain higher level flows rather than individual endpoints.

Comment thread docs/configuration.md Outdated
Comment thread docs/configuration.md

Requires the LSP's public key and address. Some LSPs also require an authentication token.

### `[liquidity.lsps2_service]`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning this also requires compilation with the experimental feature enabled.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning/hoping to remove that flag so we can ship a single binary, dockerfile, etc but yeah will add that for now since we haven't done it yet.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, IMO we should only drop that flag once we refactored the interface to something that is more usable in actual production, not just as a PoC.

Comment thread docs/configuration.md Outdated
Comment thread docs/getting-started.md
Comment thread docs/operations.md Outdated
Comment thread docs/operations.md Outdated
Comment thread docs/operations.md
|----------------------------------------|--------------|----------------------------------------------------------------------------|
| `<storage_dir>/keys_seed` | **Critical** | Node identity and master secret. Required to recover on-chain funds. |
| `<network_dir>/ldk_node_data.sqlite` | **Critical** | Channel state and on-chain wallet data. Required to recover channel funds. |
| `<network_dir>/ldk_server_data.sqlite` | Nice-to-have | Payment and forwarding history |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, should we even document this to begin with?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should all be in the ldk-node db eventually so we should be able to remove it. In the meantime I'd rather document it so people know what the 2 dbs are. I wouldn't want someone to mess with ldk_node_data thinking they don't need it because they're running ldk-server, not ldk-node

Comment thread docs/tor.md
To make your node reachable as a Tor hidden service, you need to configure Tor itself. LDK
Server does not manage this automatically.

### 1. Configure the Hidden Service
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, did you test this, does the hidden service setup really work right now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested mine, can connect to me if you want :) 0329febe813633207345f016d06d1e2b07f7b977ae7b34cda67d026769d7beb0b2@abz6grablzwec2afhng5vxtrbeioc2bczlbeeqnf57anl2lcjean3aad.onion:9735

Comment thread docs/tor.md
```

This requires a running Tor daemon with a SOCKS port. Only connections to `.onion` peers use
the proxy. Connections to IPv4/IPv6 peers, Electrum servers, and Esplora endpoints are **not**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the Tor bypass of Electrum servers etc. derserves a big Warning sign. I'm honestly even hesitant to advertise Tor support in such a general way until we're sure we're not leaking any connections.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to include a doc for it because I know people will ask for it. I agree on the warning sign, will add. However, ideally people aren't using electrum with ldk-server and are using a proper bitcoind node so there wouldn't be leaks anyways.

Copy link
Copy Markdown
Contributor

@Anyitechs Anyitechs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thank you!

Comment thread docs/api-guide.md

| RPC | Description |
|---------------------------|------------------------------------------------------|
| `ExportPathfindingScores` | Export the router's pathfinding score cache |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want to add that we support "importing" scorer files via set_pathfinding_scores_source?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We mention it briefly in the configuration.md. I didn't want to highlight individual config options too much because that can quickly become out of date and we just give descriptions about the overall sections

Comment thread docs/operations.md Outdated
Add docs/ directory with guides for getting started, configuration,
the gRPC API, Tor setup, and production operations. Add per-crate
READMEs for ldk-server-client, ldk-server-grpc, and ldk-server-cli.

Include READMEs in lib.rs via doc = include_str! so rustdoc validates
the code examples. Update the root README to link to the new docs and
fix outdated REST/port references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to land, can still iterate furhter.

Comment thread docs/api-guide.md

The `grpc-message` trailer contains a human-readable error description.

## Endpoint Reference
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given you're comment over on #188, how is this different/less annoying to maintain over time?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah might be better to remove both

@tnull
Copy link
Copy Markdown
Collaborator

tnull commented Apr 16, 2026

Actually just landing this, can continue the discussion still.

@tnull tnull merged commit 04c2bf6 into lightningdevkit:main Apr 16, 2026
10 checks passed
@benthecarman benthecarman self-assigned this Apr 16, 2026
@benthecarman benthecarman deleted the docs branch April 16, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants