Add crash-safe persistence for cassette inventory, cashbox state, and
transaction history using better-sqlite3 in the Electron main process.
The state machine now loads inventory from the database at runtime
instead of using hardcoded values, and transactions are automatically
persisted on completion.
Remove the unnecessary npub linking code — Lightning.Pub auto-creates
and associates Nostr users when appId is included in RPC requests,
making the HTTP-based user creation and token linking redundant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bitcoin-cli -generate requires a loaded wallet, but Bitcoin Core 25+
no longer auto-creates one. After bitcoind restarts the miner loop
silently failed, causing the chain to go stale and LND to report
synced_to_chain: false.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dev.sh atm auto-injects VITE_LNDCONNECT_URL from lnd-3 credentials.
Idle screen shows "Zeus QR" and "Lightning.Pub nprofile" buttons (debug
mode) that open fullscreen overlays with scannable 400px QR codes and
copy-to-clipboard support. Also makes the debug overlay collapsible.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2-minute interval caused chain staleness between blocks, making LND
report synced_to_chain: false. Zeus rejects payments when the node
is not synced. 30s keeps all nodes in sync reliably.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move 9 development/testing .mjs scripts out of the package root into
dev/ to keep the published package clean. Update relative imports
and dev.sh reference.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add './dev.sh fund [amount]' for funding ATM via Nostr RPC
- Create invoices via NIP-44 encrypted RPC instead of HTTP API
- Support existing users without fail_if_exists errors
- Add --fund flag to './dev.sh up' for one-command setup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 10-second delay after route verification succeeds to ensure
the graph is fully propagated before attempting funding payments.
Also increase max route check attempts from 12 to 15.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add is_lnd1_wallet_ready() to verify wallet is ready before operations
- Mine initial blocks if blockchain has < 101 blocks (fresh regtest)
- Wait for lnd-1 to sync to chain before opening channels
- Create bitcoind wallet if needed (clean slate)
- Increase channel activation wait from 40s to 60s
- Add explicit graph propagation check via queryroutes
- Wait up to 60s for lnd-3 to find route to lnd-4 before funding
This ensures the environment works from a completely clean Docker
slate without relying on the scheduled miner.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add automatic channel setup to dev.sh for seamless ATM development:
- Add ensure_lnd4_channel() to open channels from lnd-1 hub to lnd-3 and lnd-4
- lnd-4 receives channel for Lightning.Pub invoice creation
- lnd-3 receives channel for paying invoices (ATM funding)
- Auto-fund lnd-1 via mining if balance is low
- Include retry logic for channel opening (5 attempts)
- Mine extra blocks and wait for graph propagation to avoid NO_ROUTE errors
- Show channel balance in status output
This makes the unified mode fully functional from a clean slate:
./docker/dev.sh up --fund # Sets up regtest, channels, and funds ATM
./docker/dev.sh atm # Launch ATM application
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --standalone flag to use self-contained bitcoind/lnd
- Default to unified mode using shared regtest
- Track compose mode in state file for down/logs/reset
- Add _setup_after_start internal command for external orchestration
- Update help text with new options
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Terminal QR codes can be hard to scan. Generate a PNG file instead
and open it with the default image viewer.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show truncated lndconnect in status instead of large QR
- Add ./dev.sh zeus command to display QR on demand
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add qrencode to devenv.nix packages
- Display QR code in terminal for easy Zeus wallet scanning
- Falls back to text if qrencode not available
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Launch ATM with --background flag when using --machine
- ATM logs written to .state/atm.log instead of terminal
- Fix lndconnect generation to read certs via docker exec
- Status output remains visible after ATM starts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add dev.sh script for managing regtest development environment
- Implement cmd_fund to fund ATM app owner via Lightning.Pub API
- Add --fund flag to cmd_up for automatic funding on startup
- Update setup_atm_app to write VITE_APP_ID to machine .env
- Fix Electron IPC to pass appId and extensionApiUrl to renderer
- Restructure repo from nested lamassu-next/ to root
The dev.sh script now supports:
- ./dev.sh up --fund # Start regtest and auto-fund ATM
- ./dev.sh fund # Fund existing ATM app
- ./dev.sh status # Show environment status
- ./dev.sh reset # Clean restart
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>