Skip to content

cli: decdn node earnings prints settled and owed USDC per period #2598

Description

@thiras

Component

cli (decdn binary)

Who it affects

node operator

Problem

An operator cannot ask their node what it has earned. decdn node lanes shows per-lane owed amounts since #2588, decdn node top scrapes /metrics, and the chain has every Settled(operator, bytesDelivered, amount) event, but no command adds them up and prints a USDC figure. The only place that number exists is stats.decdn.org, per settlement row, in hex addresses.

The operator who is asked "is it worth running?" has to answer with Grafana.

Proposed solution

decdn node earnings:

$ decdn node earnings
period        bytes served   settled (USDC)   owed (USDC)   settlements
last 24h      412.3 GB       4.12             0.38          9
last 7d       2.9 TB         29.07                          61
all time      12.4 TB        121.41                         1160

last settlement: 2026-10-24 11:02 UTC, tx 0x…  (block 123456789)
pending redeem: 0.38 USDC over 3 lanes (next sweep in ~4 min)
  • Settled comes from FeeRouter.Settled for the operator address, read through the node's existing RPC provider (the watchers already page contract state at a pinned block; this is one more enumeration, with a block window per period).
  • Owed is the sum of lane owed from the admin RPC lanes response (fix(node): report each lane's owed amount in admin lanes #2588), so the two columns never double count: owed becomes settled when redeemMany lands.
  • --json for scripts, --since <date> / --period for ranges, --address to ask about another operator without a daemon (reads the chain only).
  • The same figures in node status as a one-line summary, so decdn setup's last step can print "your node earned X so far" on a re-run.

Alternatives considered

  • Point operators at stats.decdn.org. That page is network-wide and public; the operator wants their own number on their own box, including what is not yet redeemed.
  • A Grafana panel in devops. Exists for fleet operators with Grafana Cloud wired; most self-hosters do not have it, and a CLI answer works on every install.

Design scope

  • This proposal changes the protocol, the economics, or the contract surface.

Related

Activity

  1. added
    kind:feature
    prio:medium
    area:cli
    area:node
    on Oct 24, 2026
  2. added theissue type on Oct 24, 2026
  3. self-assigned this
    on Oct 25, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 25, 2026
  5. added a commit that references this issue on Oct 25, 2026
    74951f2
  6. moved this from In progress to Done in deCDNon Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:nodekind:featureprio:medium

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions