# Blockchain watcher — cron setup

The watcher confirms payments. Add ONE cron job in cPanel → Cron Jobs (every minute):

    * * * * * /usr/local/bin/php /home/xcryptoipg/cryptoipg-php/bin/watch.php >> /home/xcryptoipg/cryptoipg-php/storage/logs/watch.log 2>&1

What it does each run:
- Loads open invoices from the last 24h.
- Expires ones past their window with no payment.
- For UTXO coins (BTC, LTC, DOGE) it queries Blockchair for the deposit address and
  matches an output whose value equals the invoice's unique amount, then counts
  confirmations and flips the invoice: awaiting → detected → confirming → paid.
- On first "paid", it meters volume and queues webhook deliveries.

ETH / TRX / SOL / DOT adapters plug into ChainWatcher::checkOne() next (some need a
free API key set in config.php → providers).

Manual test run:  php ~/cryptoipg-php/bin/watch.php
