mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-13 12:33:20 +02:00
- --days must be a strictly positive integer. Reject 0 and negative
values which would push window_start_ts into the future or get
silently treated as unset.
- --db, when provided, must reference an existing file. Raise a
clear argparse error at startup instead of bubbling up as a
sqlite OperationalError later from inside the feemon loader.
|
||
|---|---|---|
| .. | ||
| clboss | ||
| clboss-earnings-history | ||
| clboss-forwarding-stats | ||
| clboss-recent-earnings | ||
| clboss-routing-stats | ||
| fee-log-parser | ||
| feemon-validate | ||
| feemon_data.py | ||
| plot-aggregate | ||
| plot-balance-price | ||
| plot-fees | ||
| plot-size-balance | ||
| plot-size-price | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
| recently-closed | ||
| sys_stats_report | ||
Contributed CLBOSS Utilities
Installing
There are two ways to install the requirements:
- poetry
- nix
Poetry
There are two ways to install poetry:
- pipx
- official installer
Pipx
# Install pipx
sudo apt update
sudo apt install pipx
pipx install poetry
Or, click here for the official installer
Once poetry is installed, install the Python dependencies:
# The following commands need to be run as the user who will be running
# the clboss utility commands (connecting to the CLN RPC port)
# Install clboss contrib utilities
poetry shell
poetry install
Nix
If you have nix, you can just do, from the project root:
nix-shell contrib-shell.nix
Then before running the commands below, be sure to do:
cd contrib/
Running
./clboss-earnings-history
./clboss-recent-earnings
./clboss-routing-stats
./clboss-forwarding-stats
./recently-closed
The `clboss-routing-stats` and `clboss-forwarding-stats` scripts now accept `--days` to limit
how many days of earnings history are considered when ranking channels.
Script Details
clboss-earnings-historynow supports additional options:--csv-file <file>writes the raw earnings data as CSV.--graph-file <file>generates a PNG plot of net earnings.--bucketlets you aggregate byday,week,fortnight,month, orquarter.
clboss-forwarding-statssummarizes channel forwarding data and can be restricted with--days.clboss-routing-statsranks peers using recent earnings data and also accepts the--daysoption.recently-closedlists channels that closed within the last N days, also controlled via--days.fee-log-parseris a parser that streams DEBUG-level logging and writes a sqlite database containing fee algorithm information. CLBOSS now records the same schema in its internal database (data.clboss, tablesfeemon_peersandfeemon_change_events) during normal operation.clboss-feemon-historyis a CLBOSS command that returns per-peer fee modifier history between optionalsince/beforetimestamps.clboss-feemon-peersis a CLBOSS command that returns peer nodeids with fee monitor history between optionalsince/beforetimestamps.feemon-validatecomparesfee-log-parsersqlite history againstclboss-feemon-historyper peer over a requested time window. It reports per-peer progress, prints compact timestamp diagnostics for missing/extra records, prints full-record diagnostics for field mismatches, and exits non-zero when discrepancies are found. Default external DB path is./clboss-fee-info.sqlite3and default timestamp tolerance is 60 seconds. Default float tolerance is1e-5and is scaled by value magnitude (tol * max(1, |a|, |b|)) to avoid false mismatches from JSON float rendering precision (notablymult_product). Derived integer fieldsest_baseandest_ppmuse a relative tolerance with default1e-3(--int-rel-tolerance) so small rounding effects at large magnitudes do not trigger mismatches.--since/--beforeaccept Unix epoch seconds in addition to the existing human-readable time formats. Naive timestamps are interpreted in local time; Unix epoch input is UTC; explicit timezone offsets are honored.plot-feesplots fee-related time series for a peer from merged fee monitor data: API history (clboss-feemon-history) plus legacy sqlite history (fee-log-parser). When both sources cover a period, API records are preferred and sqlite is used only for earlier history. By default it uses API data only; pass--dbto include legacy sqlite history.--peeraccepts a nodeid, alias (via lightning-cli/listnodes), or SCID (via lightning-cli/listpeerchannels). The combo view includes a daily earnings panel (incoming/outgoing msat per day) when lightning-cli is available, and theincoming-earnings/outgoing-earningsviews render those panels on their own. In thetheorypanel, atheory_centerline is drawn only where API records includeprice_center; legacy-only spans omit that line. Use--titleto override the plot title (defaults to the peer label; pass empty to omit).plot-aggregateplots aggregate percentile summaries from merged fee monitor data (API preferred over overlapping legacy sqlite history). By default it uses API data only; pass--dbto include legacy sqlite history. Views includebaseline-base,baseline-ppm,size,balance,theory,advertised-base,advertised-ppm,earnings, and acomboview. Each view shows daily p00/p10/p25/p50/p75/p90/p100 percentiles across nodes. Theearningsview usesclboss-earnings-history allto compute net earnings percentiles (sat/day). In API mode, peer discovery usesclboss-feemon-peers [since] [before]so windowed aggregate plots include peers that were active during the selected period (even if currently closed).