|
3 долоо хоног өмнө | |
---|---|---|
.. | ||
src | 3 долоо хоног өмнө | |
Cargo.toml | 1 сар өмнө | |
README.md | 3 долоо хоног өмнө | |
build.rs | 1 сар өмнө | |
example.config.toml | 3 долоо хоног өмнө |
Warning This project is in early development, it does however work with real sats! Always use amounts you don't mind losing.
Cashu mint daemon implementation for the Cashu Development Kit (CDK). This binary provides a complete Cashu mint server implementation with support for multiple database backends and Lightning Network integrations.
Download the latest release from the GitHub releases page.
git clone https://github.com/cashubtc/cdk.git
cd cdk
cargo build --bin cdk-mintd --release
# Binary will be at ./target/release/cdk-mintd
Important: You must create the working directory and configuration file before starting the mint. The mint does not create them automatically.
Create working directory:
mkdir -p ~/.cdk-mintd
Create configuration file:
# Copy and customize the example config
cp example.config.toml ~/.cdk-mintd/config.toml
# Edit ~/.cdk-mintd/config.toml with your settings
Start the mint:
cdk-mintd # Uses ~/.cdk-mintd/config.toml automatically
cdk-mintd --config /path/to/config.toml
./config.toml
(in current directory)~/.cdk-mintd/config.toml
Custom working directory:
mkdir -p /my/custom/path
cp example.config.toml /my/custom/path/config.toml
cdk-mintd --work-dir /my/custom/path
Environment variables only:
export CDK_MINTD_LISTEN_PORT=3000
export CDK_MINTD_LN_BACKEND=fakewallet
export CDK_MINTD_DATABASE=sqlite
cdk-mintd
[ln]
ln_backend = "ldk-node"
[ldk_node]
bitcoin_network = "signet" # Use "mainnet" for production
esplora_url = "https://mutinynet.com/api"
rgs_url = "https://rgs.mutinynet.com/snapshot/0"
gossip_source_type = "rgs"
storage_dir_path = "/var/lib/cdk-mintd/ldk-node"
[ln]
ln_backend = "cln"
[cln]
rpc_path = "/home/bitcoin/.lightning/bitcoin/lightning-rpc"
fee_percent = 0.01
reserve_fee_min = 10
[ln]
ln_backend = "lnd"
[lnd]
address = "https://localhost:10009"
macaroon_file = "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon"
cert_file = "/home/bitcoin/.lnd/tls.cert"
fee_percent = 0.01
reserve_fee_min = 10
[database]
engine = "postgres"
[database.postgres]
url = "postgresql://mint_user:password@localhost:5432/cdk_mint"
After setup and first run, your directory will look like:
~/.cdk-mintd/ # Working directory (create manually)
├── config.toml # Config file (create manually)
├── cdk-mintd.db # SQLite database (created automatically)
├── logs/ # Log files (created automatically if enabled)
│ ├── cdk-mintd.2024-01-01.log
│ └── cdk-mintd.2024-01-02.log
└── ldk-node/ # LDK Node data (if using LDK backend)
├── wallet/
└── graph/
What you must create manually:
~/.cdk-mintd/
)config.toml
)What gets created automatically:
Verify the mint is running:
curl http://127.0.0.1:8085/v1/info
Get mint keys:
curl http://127.0.0.1:8085/v1/keys
Test with CDK CLI wallet:
# Download from: https://github.com/cashubtc/cdk/releases
cdk-cli wallet add-mint http://127.0.0.1:8085
cdk-cli wallet mint-quote 100
For LDK Node backend: Access the management interface at http://127.0.0.1:8091
# Start with default configuration
cdk-mintd
# Start with custom config file
cdk-mintd --config /path/to/config.toml
# Start with custom working directory
cdk-mintd --work-dir /path/to/work/dir
# Disable logging
cdk-mintd --enable-logging false
# Show help
cdk-mintd --help
CDK_MINTD_DATABASE
: Database engine (sqlite
/postgres
/redb
)CDK_MINTD_DATABASE_URL
: PostgreSQL connection stringCDK_MINTD_LN_BACKEND
: Lightning backend (cln
/lnd
/lnbits
/ldk-node
/fakewallet
)CDK_MINTD_LISTEN_HOST
: Host to bind to (default: 127.0.0.1
)CDK_MINTD_LISTEN_PORT
: Port to bind to (default: 8085
)For complete configuration options, see the example configuration file.
This project is licensed under the MIT License.