mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-24 15:25:42 +01:00
2.5 KiB
2.5 KiB
Mint Restart Feature
A new command has been added to restart the CDK mints after recompiling, perfect for development workflows when you're making changes to the mint code.
Command
just restart-mints
or
./misc/regtest_helper.sh restart-mints
What It Does
- Stops both running mints (CLN and LND mints)
- Recompiles the
cdk-mintdbinary with your latest changes - Restarts both mints with the same configuration
- Waits for both mints to be ready and responding
- Updates the state file with new process IDs
Development Workflow
Before this feature:
# Terminal 1: Start environment
just regtest
# Terminal 2: Make code changes, then manually restart everything
# Ctrl+C in Terminal 1 (stops entire environment including Lightning network)
just regtest # Start everything again (slow)
With this feature:
# Terminal 1: Start environment (once)
just regtest
# Terminal 2: Make code changes, then quickly restart just the mints
just restart-mints # Fast! Keeps Lightning network running
just mint-test # Test your changes
Benefits
- Faster Development Cycle - No need to restart the entire Lightning network
- Preserves Network State - Bitcoin blockchain, Lightning channels, and node states remain intact
- Automatic Recompilation - No need to manually run
cargo build - Status Validation - Ensures mints are responding before completing
- State Management - Updates process IDs for other commands to work correctly
Example Output
===============================
Restarting CDK Mints
===============================
Stopping existing mints...
Stopping CLN Mint (PID: 12345)
Stopping LND Mint (PID: 12346)
Recompiling cdk-mintd...
✓ Compilation successful
Starting CLN Mint...
Waiting for CLN mint to start...
✓ CLN Mint ready
Starting LND Mint...
Waiting for LND mint to start...
✓ LND Mint ready
✅ Mints restarted successfully!
CLN Mint: http://127.0.0.1:8085 (PID: 54321)
LND Mint: http://127.0.0.1:8087 (PID: 54322)
===============================
Use Cases
- Testing mint code changes without restarting the entire regtest environment
- Debugging mint behavior with fresh mint instances
- Performance testing with clean mint state but preserved Lightning network
- Integration testing after mint code modifications
This feature makes the development experience much smoother when working on CDK mint functionality!