Files
cdk/crates/cdk-payment-processor
thesimplekid 0b9ca1a474 Time time series (#708)
* feat: Add created_time and paid_time fields to MintQuote struct

* feat: Add serde default of 0 for created_time in MintQuote

* feat: Add created_time and paid_time to MintQuote and MeltQuote structs

* feat: Add paid_time update when setting melt quote state to Paid

* fix: Update melt quote state with current Unix timestamp

* feat: Add paid_time update for mint quote when state is set to Paid

* feat: Add issued_time field to MintQuote conversion from SQLite row

* feat: Add issued_time tracking for MintQuoteState::Issued state

* feat: Add migration script for mint time of quotes

* feat: Add timestamp columns to mint_quote and melt_quote tables

* feat: Add timestamp columns to `add_mint_quote` method

* refactor: Improve code formatting and readability in mint quote state update logic

* feat: Add created_time and paid_time columns to melt_quote query

* feat: time on mint and melt quotes

* feat: Add migration script for mint created time signature

feat: Add created_time column to blind_signature table

feat: Add created_time to blind_signature insertion

feat: Add created_time column to proof table and update insert query

feat: time on mint and melt quotes

* feat: Add new table to track blind signature creation time

* feat: Add timestamp tracking for proofs in ReDB database

* feat: redb proof time

* chore: fmt
2025-04-07 12:51:14 +01:00
..
2025-04-07 12:51:14 +01:00
2025-03-25 23:27:38 +00:00
2025-03-25 23:27:38 +00:00
2025-03-10 14:44:57 +00:00

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

  1. Install Nix package manager
  2. 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:

  1. Create a new module implementing the payment processor traits
  2. Add appropriate feature flags
  3. Update the binary to support the new backend

For library usage examples and API documentation, refer to the crate documentation.