Skip to content

Add a decdn node channels command that prints a live snapshot of all open payment channels with per-channel nonce, outstanding balance, time since last voucher, and settlement eligibility #749

Closed

Description

@alpergundogdu

Operators currently have no CLI visibility into open payment channel state without reading raw metrics or internal logs. A decdn node channels subcommand that queries the admin RPC surface would let operators quickly identify channels approaching settlement thresholds, stale channels, or channels with unusually high outstanding balances before they become a liquidity risk.


Filed via GitDailyReporterBot

Activity

  1. added
    kind:feature
    design:economics
    area:cli
    on May 31, 2026
  2. github-actions commented on May 31, 2026

    @github-actions

    🎯 Triage report

    Request to add a decdn node channels subcommand that queries the admin RPC for a live snapshot of open payment channels — showing per-channel nonce, outstanding balance, time since last voucher, and settlement eligibility. The motivation is operator liquidity risk management: currently this data is only accessible via raw metrics or internal logs. The scope is well-bounded (new CLI subcommand + one admin RPC endpoint) and aligns directly with the existing cli → common (AdminRpc trait) architecture.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature New operator-facing capability; no existing functionality is broken
    Labels enhancement, economics, technical, cli (already applied) All four are accurate; no priority label is warranted without further operator input
    Coding agent Suitable Requirements are clear and self-contained: extend AdminRpc with a channels method, implement it in node, add the decdn node channels subcommand in cli. Success criteria (output columns) are explicitly enumerated

    🔗 Similar issues

    No similar or duplicate issues found.

    💡 Notes and suggestions

    Implementation path:

    1. common crate — add a ChannelSnapshot DTO (fields: peer_id, nonce: u64, outstanding_balance: U256, secs_since_last_voucher: u64, settlement_eligible: bool) and a channels() -> Vec<ChannelSnapshot> method on the AdminRpc trait.
    2. node crate — implement channels() by reading the in-memory channel map from the incentive crate's payment-channel state; compute settlement_eligible from the channel's timeout threshold (see ADR 016 §Payment channels).
    3. cli crate — add decdn node channels as a subcommand (mirrors the existing decdn node peers pattern); support a --json flag for machine-readable output alongside the default table view.

    Output columns to confirm:

    • Channel peer node ID (iroh NodeId)
    • Current nonce
    • Outstanding balance (USDC, formatted with 6 decimals)
    • Time since last voucher (human-readable, e.g. 2m 14s)
    • Settlement eligible (yes / no, with expiry timestamp if eligible)

    Edge cases to handle:

    • No open channels → print an empty table or a friendly no open channels message rather than erroring.
    • Admin RPC not reachable → surface a clear error (not a panic; anti-panic policy applies).
    • Very large balance values → ensure U256 formatting doesn't truncate.

    Testing suggestion: Add an integration test in the cli crate that spins up a mock admin RPC server returning a fixed Vec<ChannelSnapshot> and asserts the rendered table output.

    Generated by Agentic Triage for issue #749 · sonnet46 350.1K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clidesign:economicskind:feature

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions