Skip to content

docs: document payment CLI commands for settlement and withdrawal #437

@frrist

Description

@frrist

Summary

Document the piri client admin payment CLI commands in the operator guide, specifically in the payments.md file where settlement and withdrawal are discussed.

Context

From PR #427 review feedback (alanshaw) - the payments.md doc mentions "View your payment balance via the admin API" but doesn't explain what that means or show the actual CLI commands operators should use.

Commands to Document

piri client admin payment

Parent command for payment account management.

Subcommands

piri client admin payment account

  • Purpose: Get payment account information as JSON
  • Args: None
  • Flags: None
  • Output: JSON dump of account info

piri client admin payment status

  • Purpose: Display payment account status with interactive TUI
  • Args: None
  • Flags: --format (default: "table") - Output format: "table" (TUI) or "json"

Interactive TUI Features

The status command provides a rich interactive interface:

Main View displays:

  • Current Epoch
  • Settled Balance (funds in payment contract, withdrawable)
  • Earnings summary (Gross, Net, Forfeited)
  • Rails table (Rail ID, Dataset ID, Payer, Rate/epoch, Settled To, Net Earnings)

Keyboard shortcuts:

Key Action
r Refresh status
S Settle selected rail
W Withdraw funds
↑/↓ Navigate rails table
q Quit

Settlement flow (S):

  1. Shows estimate: gross amount, proof penalty (if any), net amount, 0.5% network fee, final amount, gas estimate
  2. Confirm with Enter, cancel with Esc
  3. Submits on-chain transaction
  4. Waits for confirmation, shows tx hash

Withdrawal flow (W):

  1. Shows available balance
  2. Select recipient: owner address (default) or enter custom address
  3. Shows estimate: withdraw amount, gas estimate
  4. Confirm with Enter, cancel with Esc
  5. Submits on-chain transaction
  6. Waits for confirmation, shows tx hash

Key Terminology (shown in TUI)

  • Settled Balance: Funds held in payment contract (withdrawable)
  • Gross: Total earnings before deductions
  • Net Earnings: Settleable earnings (Gross - Forfeited)
  • Forfeited: Earnings lost to missed proofs
  • Settled To: Last epoch settled for this rail

Documentation Updates Needed

  1. payments.md - Update the "Withdrawing Funds" section (around line 61) to show actual CLI commands instead of vague "admin API" reference

  2. Consider adding a new section or linking to CLI docs for piri client admin payment status

  3. Include example output showing what operators will see

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions