Contributions are welcome and encouraged! Whether you're fixing bugs, adding features, improving documentation, or helping with testing, we appreciate your help!
cargo build # Build all crates
cargo build --release # Production build (LTO enabled)cargo run --bin ldk-server ./contrib/ldk-server-config.tomlcargo test # Run workspace tests
cargo test --all-features # Run workspace tests with all featuresRun the end-to-end tests from their separate workspace:
cargo test --manifest-path e2e-tests/Cargo.toml -- --test-threads=4cargo fmt --all # Format code
cargo fmt --all -- --check # Check formatting
cargo clippy --all-features -- -D warnings -A clippy::drop_non_drop # Lint (CI uses this on MSRV)- MSRV: Rust 1.85.0
- Hard tabs, max width 100 chars
- Imports grouped: std, external crates, local crates
RUSTFLAGS="--cfg genproto" cargo build -p ldk-server-grpc
cargo fmt --all- Define request/response messages in
ldk-server-grpc/src/proto/api.proto - Regenerate protos (see above)
- Create handler in
ldk-server/src/api/(follow existing patterns) - Add route in
ldk-server/src/service.rs - Map the RPC to its required permission in
method_authorizationinldk-server/src/macaroons/authorization.rs. Unmapped methods returnUNIMPLEMENTED, even for admin tokens. - Add CLI command in
ldk-server-cli/src/main.rs - For a unary RPC, add the MCP tool in
ldk-server-mcp/src/tools/and update the tool list test inldk-server-mcp/tests/integration.rs. Add a live test ine2e-tests/tests/mcp.rsif applicable. - Test allowed and denied requests, including admin access.
If the RPC needs a new permission, add it to ldk-server-grpc/src/permissions.rs and
ALL_PERMISSIONS. Update the presets that need it and add it to docs/api-guide.md.
- Config template with all options:
contrib/ldk-server-config.toml - When updating config options, also update the tests in
ldk-server/src/util/config.rs
- Ensure all tests pass
- Ensure all lints are fixed
- Run
cargo fmt --all - Please disclose the use of any AI tools in commit messages and PR descriptions