Skip to content
This repository was archived by the owner on Sep 8, 2026. It is now read-only.

feat(contributor-rewards): add read-rewards command - #212

Merged
karl-dz merged 3 commits into
mainfrom
rg/read-rewards
Nov 26, 2025
Merged

feat(contributor-rewards): add read-rewards command#212
karl-dz merged 3 commits into
mainfrom
rg/read-rewards

Conversation

@vihu

@vihu vihu commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Summary

Add read-rewards command and --json flag support

Fixes: malbeclabs/doublezero#2298

Adds a new read-rewards command to fetch all contributor rewards for an epoch in a single RPC call, and adds --json output support to both read-rewards and check-reward commands.

Changes

  • Add ReadRewards command with -e/--epoch and --json flags
  • Add --json flag to existing CheckReward command
  • Add read_all_rewards() function in ledger_operations to fetch and display all rewards
  • Add CheckRewardOutput, RewardEntry, AllRewardsOutput structs for JSON serialization
  • Update check_contributor_reward() to support JSON output format
  • Add read_all_rewards() method to orchestrator

Usage

# Read all rewards (table)
$ doublezero-contributor-rewards read-rewards -e 56

# Read all rewards (JSON)
$ doublezero-contributor-rewards read-rewards -e 56 --json

# Check single reward (JSON)
$ doublezero-contributor-rewards check-reward -e 56 -c <PUBKEY> --json

@karl-dz karl-dz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the changelog?

@vihu

vihu commented Nov 26, 2025

Copy link
Copy Markdown
Contributor Author

Can you update the changelog?

done 👍

@karl-dz
karl-dz merged commit 51b700f into main Nov 26, 2025
2 checks passed
@karl-dz
karl-dz deleted the rg/read-rewards branch November 26, 2025 19:39
bgm-malbeclabs pushed a commit to malbeclabs/doublezero that referenced this pull request Aug 28, 2026
…ezero-offchain#212)

# Summary

Add `read-rewards` command and `--json` flag support

Fixes: #2298

Adds a new `read-rewards` command to fetch all contributor rewards for
an epoch in a single RPC call, and adds --json output support to both
read-rewards and check-reward commands.

## Changes

- Add `ReadRewards` command with `-e/--epoch` and `--json` flags
- Add `--json` flag to existing CheckReward command
- Add `read_all_rewards()` function in ledger_operations to fetch and
display all rewards
- Add `CheckRewardOutput, RewardEntry, AllRewardsOutput` structs for
JSON serialization
- Update `check_contributor_reward()` to support JSON output format
- Add `read_all_rewards()` method to orchestrator

## Usage

```bash
# Read all rewards (table)
$ doublezero-contributor-rewards read-rewards -e 56

# Read all rewards (JSON)
$ doublezero-contributor-rewards read-rewards -e 56 --json

# Check single reward (JSON)
$ doublezero-contributor-rewards check-reward -e 56 -c <PUBKEY> --json
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contributor-rewards: add a command to read all reward shares per dz epoch

2 participants