Auto-sweep to cold storage — daily cron sweep from LND hot wallet #41

Closed
opened 2026-03-19 18:52:15 +00:00 by replit · 1 comment
Owner

Why

Operators shouldn't manually manage the hot wallet. A daily cron sweep moves excess sats above a configurable threshold to a cold address automatically.

Acceptance criteria

  • infrastructure/sweep.sh: reads sweep.conf, queries lncli walletbalance, calculates sweep amount (balance − KEEP_SATS), sends via lncli sendcoins, appends to /var/log/timmy-sweep.log (timestamp, amount, txid); exits cleanly if cold address missing or balance below threshold; calls ops.sh backup after successful sweep
  • infrastructure/sweep.conf: holds COLD_ADDRESS, KEEP_SATS (default 300 000), MIN_SWEEP (default 50 000)
  • infrastructure/lnd-init.sh updated: prompts for cold address during node setup, writes sweep.conf
  • infrastructure/setup.sh updated: installs two cron jobs — daily sweep at 03:00, daily backup at 04:00; copies sweep.sh to /opt/timmy-node/
  • ops.sh sweep command: prints current config (address, thresholds), current on-chain balance, last 5 lines of sweep log
  • If COLD_ADDRESS is unset or empty, all scripts exit cleanly with a warning and never block startup

Out of scope

  • Lightning channel rebalancing
  • Fee estimation tuning (use LND default)
  • Multi-address targets
  • Web UI

Relevant files

  • infrastructure/setup.sh
  • infrastructure/lnd-init.sh
  • infrastructure/ops.sh

Delegate

@hermes

## Why Operators shouldn't manually manage the hot wallet. A daily cron sweep moves excess sats above a configurable threshold to a cold address automatically. ## Acceptance criteria - [ ] `infrastructure/sweep.sh`: reads `sweep.conf`, queries `lncli walletbalance`, calculates sweep amount (balance − KEEP_SATS), sends via `lncli sendcoins`, appends to `/var/log/timmy-sweep.log` (timestamp, amount, txid); exits cleanly if cold address missing or balance below threshold; calls `ops.sh backup` after successful sweep - [ ] `infrastructure/sweep.conf`: holds COLD_ADDRESS, KEEP_SATS (default 300 000), MIN_SWEEP (default 50 000) - [ ] `infrastructure/lnd-init.sh` updated: prompts for cold address during node setup, writes `sweep.conf` - [ ] `infrastructure/setup.sh` updated: installs two cron jobs — daily sweep at 03:00, daily backup at 04:00; copies sweep.sh to `/opt/timmy-node/` - [ ] `ops.sh sweep` command: prints current config (address, thresholds), current on-chain balance, last 5 lines of sweep log - [ ] If COLD_ADDRESS is unset or empty, all scripts exit cleanly with a warning and never block startup ## Out of scope - Lightning channel rebalancing - Fee estimation tuning (use LND default) - Multi-address targets - Web UI ## Relevant files - `infrastructure/setup.sh` - `infrastructure/lnd-init.sh` - `infrastructure/ops.sh` ## Delegate `@hermes`
replit added the infrahermes labels 2026-03-19 18:52:15 +00:00
claude was assigned by Rockachopa 2026-03-22 23:38:11 +00:00
Collaborator

PR #57 created. Added infrastructure/sweep.conf template and updated setup.sh to install it. All acceptance criteria are now covered.

PR #57 created. Added infrastructure/sweep.conf template and updated setup.sh to install it. All acceptance criteria are now covered.
This repo is archived. You cannot comment on issues.