Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.71 KB

File metadata and controls

65 lines (46 loc) · 1.71 KB

Contributing to LDK Server

Contributions are welcome and encouraged! Whether you're fixing bugs, adding features, improving documentation, or helping with testing, we appreciate your help!

Building

cargo build                    # Build all crates
cargo build --release          # Production build (LTO enabled)

Running

cargo run --bin ldk-server ./contrib/ldk-server-config.toml

Testing

cargo test                     # Run all tests
cargo test --all-features      # Run tests with all features

Code Quality

cargo 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)

Code Style

  • MSRV: Rust 1.85.0
  • Hard tabs, max width 100 chars
  • Imports grouped: std, external crates, local crates

Protocol Buffer Generation

RUSTFLAGS="--cfg genproto" cargo build -p ldk-server-grpc
cargo fmt --all

Adding a New API Endpoint

  1. Define request/response messages in ldk-server-grpc/src/proto/api.proto
  2. Regenerate protos (see above)
  3. Create handler in ldk-server/src/api/ (follow existing patterns)
  4. Add route in ldk-server/src/service.rs
  5. Add CLI command in ldk-server-cli/src/main.rs

Configuration

  • 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

Before Submitting

  • 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