mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-18 21:25:09 +01:00
* feat(cdk-integration-tests): refactor regtest setup and mintd integration - Replace shell-based regtest setup with Rust binary (start_regtest_mints) - Add cdk-mintd crate to workspace and integration tests - Improve environment variable handling for test configurations - Update integration tests to use proper temp directory management - Remove deprecated start_regtest.rs binary - Enhance CLN client connection with retry logic - Simplify regtest shell script (itests.sh) to use new binary - Fix tracing filters and improve error handling in setup - Update dependencies and configurations for integration tests fix: killing chore: comment tests for ci debugging chore: compile Revert "chore: comment tests for ci debugging" This reverts commit bfc594c11cf37caeaa6445cb854ae5567d2da6bd. * chore: sql cipher * fix: removal of sqlite cipher * fix: auth password * refactor(cdk-mintd): improve database password handling and function signatures - Pass database password as parameter instead of parsing CLI args in setup_database - Update function signatures for run_mintd and run_mintd_with_shutdown to accept db_password - Remove direct CLI parsing from database setup logic - Fix auth database initialization to use correct type when sqlcipher feature enabled
CDK Payment Processor
The cdk-payment-processor is a Rust crate that provides both a binary and a library for handling payments to and from a cdk mint.
Overview
Library Components
- Payment Processor Server: Handles interaction with payment processor backend implementations
- Client: Used by mintd to query the server for payment information
- Backend Implementations: Supports CLN, LND, and a fake wallet (for testing)
Features
- Modular backend system supporting multiple Lightning implementations
- Extensible design allowing for custom backend implementations
Building from Source
Prerequisites
- Install Nix package manager
- Enter development environment:
nix develop
Configuration
The server requires different environment variables depending on your chosen Lightning Network backend.
Core Settings
# Choose backend: CLN, LND, or FAKEWALLET
export CDK_PAYMENT_PROCESSOR_LN_BACKEND="CLN"
# Server configuration
export CDK_PAYMENT_PROCESSOR_LISTEN_HOST="127.0.0.1"
export CDK_PAYMENT_PROCESSOR_LISTEN_PORT="8090"
Backend-Specific Configuration
Core Lightning (CLN)
# Path to CLN RPC socket
export CDK_PAYMENT_PROCESSOR_CLN_RPC_PATH="/path/to/lightning-rpc"
Lightning Network Daemon (LND)
# LND connection details
export CDK_PAYMENT_PROCESSOR_LND_ADDRESS="localhost:10009"
export CDK_PAYMENT_PROCESSOR_LND_CERT_FILE="/path/to/tls.cert"
export CDK_PAYMENT_PROCESSOR_LND_MACAROON_FILE="/path/to/macaroon"
Building and Running
Build and run the binary with your chosen backend:
# For CLN backend
cargo run --bin cdk-payment-processor --no-default-features --features cln
# For LND backend
cargo run --bin cdk-payment-processor --no-default-features --features lnd
# For fake wallet (testing only)
cargo run --bin cdk-payment-processor --no-default-features --features fake
Development
To implement a new backend:
- Create a new module implementing the payment processor traits
- Add appropriate feature flags
- Update the binary to support the new backend
For library usage examples and API documentation, refer to the crate documentation.