-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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):
- Shows estimate: gross amount, proof penalty (if any), net amount, 0.5% network fee, final amount, gas estimate
- Confirm with Enter, cancel with Esc
- Submits on-chain transaction
- Waits for confirmation, shows tx hash
Withdrawal flow (W):
- Shows available balance
- Select recipient: owner address (default) or enter custom address
- Shows estimate: withdraw amount, gas estimate
- Confirm with Enter, cancel with Esc
- Submits on-chain transaction
- 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
-
payments.md - Update the "Withdrawing Funds" section (around line 61) to show actual CLI commands instead of vague "admin API" reference
-
Consider adding a new section or linking to CLI docs for
piri client admin payment status -
Include example output showing what operators will see
References
- PR docs: write operator guide docs #427 comment from alanshaw
- Source code:
cmd/cli/client/admin/payment/