aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* analytics-geo: read rotated request log chunksAdam Soltys6 days1-6/+26
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* scripts: stubborn peer-force LN payer + boltz stuck-swap recoveryAdam Soltys2026-08-272-0/+250
| | | | | | | | | | | | | | | | | | | | | Add scripts/pay-hard.ts: a payment helper for well-connected but inbound-scarce destinations (exchange nodes) that cost-first payers (xpay/renepay) can't reach. When the normal xpay attempt fails, it enumerates the destination's peers, keeps the ones we can reach (preferring peers we already channel with enough outbound), and for each builds a route forced through peer->dest with the invoice's correct final CLTV, probes it with an unclaimable random hash, and pays through the first path that reaches the destination. Probe-before-send, refuses to start with a payment already pending, and stops rather than risk a second in-flight payment. Works against either the main node (cl) or the boltz node (bcln). Add scripts/boltz-recover-stuck.ts: a cron watcher that finds submarine swaps stuck at invoice.pending (lockup confirmed, invoice unexpired, idle past a threshold) and runs pay-hard against bcln to complete them, then lets boltz reconcile (restarting it only if it hasn't picked up the preimage within a grace period). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01DKkev76U4YRnRAqM6jqbae
* scripts: add lightning-backlog audit + kvrocks archive merge toolingAdam Soltys2026-08-223-0/+416
| | | | | | | | | | | | | audit-lightning-backlog.ts walks settled invoices from the stored pay_index to surface receives the listener may have missed crediting (companion to the listener backlog probe). merge-kvrocks-archives.ts overlays one Kvrocks/Redis archive onto a base without materializing keys in memory (raw SCAN to survive cursors beyond JS safe-integer range), with kvrocks-merge-lowmem.conf as the low-memory server config for the merge. All parameterized via CLI flags; no embedded hosts or secrets. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01XiwgmQKwKnRxUmVDd4xSf7
* scripts: add dedup-invoices cleanup for already-duplicated :invoicesAdam Soltys2026-06-181-0/+86
| | | | | | | | | | The source fix (LPOS guard in generate()) stops NEW duplicate entries but doesn't remove the ones already accumulated. This one-time script scrubs them: scans every <id>:invoices list and removes duplicate ids, keeping each id's original creation-order position. Dry-run by default; pass --apply to write. Idempotent. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* scripts: add wiped-history audit and rebalance-economics modelAdam Soltys2026-06-132-0/+181
| | | | | | | | | audit-wiped-history.ts (read-only) finds accounts whose :payments index was wiped by the changeid bug — balance>0 with empty history in both db and arc. rebalance-economics.ts models whether the lightning->liquid bridge throughput is fee-positive against on-chain rebalance cost. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* analytics: missing-history audit + lightning->liquid arb finderAdam Soltys2026-06-042-0/+232
| | | | | | | | | | | | | | | | | audit-missing-history.ts: read-only audit classifying every user's payment history as clean / recoverable (record in arc not db) / lost (gone from both). Full-scan finding: of 6,330 users with history, 77% are "arc-only" which is the NORMAL archived state — the payments route reads via gf() (archive fallback) so those render fine in the app. True loss is 58 users / 59 records (0.02%). So there is no widespread history loss; "missing history" reports are almost always either dropped receive-callbacks (record never written, like apk403's 1100 sats) or one of the rare 59. ln-liquid-arb.ts: finds users funding via lightning and withdrawing via liquid (the pattern draining the liquid hot wallet / forcing threshold cuts). Reports per-user through-flow + net liquid drainers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* analytics: --csv flag for month-over-month trend trackingAdam Soltys2026-06-041-1/+50
| | | | | | | | | | Appends one metrics row per run to a CSV (header written if file is new): date, users, MAU/WAU, payments, volume, custody, fee revenue, bolt12 recipients, and per-type volume/txn columns. Notice goes to stderr so it doesn't pollute the saved stdout report or --json output. Drives the new monthly snapshot cron (~/scripts/analytics-cron.sh). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* analytics: monthly insight reports + signup instrumentationAdam Soltys2026-06-032-0/+374
| | | | | | | | | | | | | | | | | | | | | scripts/analytics.ts — streams live db (SCAN, never KEYS) and reports for a trailing window (default 30d): MAU/WAU, new users, custody total + top holders, network volume by type (lightning/liquid/bitcoin/internal/bolt12/ fund), most-active and highest-volume users, and bolt12 recipients with a "regular" flag for the Ocean mining-reward stream. scripts/analytics-geo.ts — top countries from the request log. Counts only /login + /register events tied to a username (raw cf-ipcountry volume is dominated by datacenter/nostr traffic). Surfaces a distinct-IP-per-country column so proxy/VPN egress is visible, and filters a known credential-test bot IP. Honest result: US #1, then GB/CA/JP/DE/ES/BR. lib/register.ts — stamp `created` (ms epoch) and store `country` (CF/ ipregistry code) on new users, so future reports get real signup timing and geography from the db directly instead of log archaeology. Existing users predate this; backfill is out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* catch reverse errorsAdam Soltys2026-03-172-0/+1857
|
* adjust ln minfeeregtest-dataAdam Soltys2026-03-152-0/+300
|
* handle socket errorsAdam Soltys2026-02-251-0/+276
|
* tech debt jubileeAdam Soltys2023-01-083-101/+0
|
* prettierAdam Soltys2022-09-062-28/+42
|
* es6 migrationAdam Soltys2022-09-022-39/+2
|
* update uuid, refactor sync functionAdam Soltys2021-10-271-6/+0
|
* fix case for tableRan Guin2021-08-301-2/+1
|
* update search condition generatorRan Guin2021-07-291-5/+9
|
* add apiParse for generating common search conditionsRan Guin2021-07-281-0/+42
|
* Purge script to wipe coinos-server and coinos-ui clean but without ↵Derrick2021-07-241-0/+31
| | | | | | | destroying local git changes. It is alternative to removing the directories and cloning them again; using this script will accomplish the *same thing but without destroying your local stashes or branches *it will not stash or reset any modified files already tracked in git so those should be stashed separately if any exist for a true clean reset
* deps cleanupAdam Soltys2021-06-091-1/+1
|
* script for checking uploads folderAdam Soltys2020-12-162-0/+54