Skip to content

Commit

Permalink
chore: fix readme for rewards show (#216)
Browse files Browse the repository at this point in the history
* chore: fix readme for rewards show

* chore: fix readme for rewards show
  • Loading branch information
shrimalmadhur authored Sep 26, 2024
1 parent 234f9a4 commit 8c6a319
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
26 changes: 26 additions & 0 deletions pkg/rewards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,32 @@ eigenlayer rewards set-claimer \
For testnet, remove the `--rewards-coordinator-address` flag and binary will automatically use the testnet rewards coordinator address.
### Show Rewards
```bash
eigenlayer rewards show --help
NAME:
eigenlayer rewards show - Show rewards for an address
USAGE:
show
DESCRIPTION:
Command to show rewards for earners
Currently supports past total rewards (claimed and unclaimed) and past unclaimed rewards
OPTIONS:
--avs-addresses value, -a value Comma seperated addresses of the AVS [$AVS_ADDRESSES]
--claim-type value, --ct value Type of claim you want to see. Can be 'all', 'unclaimed', or 'claimed' (default: "all") [$REWARDS_CLAIM_TYPE]
--earner-address value, --ea value Address of the earner [$REWARDS_EARNER_ADDRESS]
--environment value, --env value Environment to use. Currently supports 'preprod' ,'testnet' and 'prod'. If not provided, it will be inferred based on network [$ENVIRONMENT]
--network value, -n value Network to use. Currently supports 'holesky' and 'mainnet' (default: "holesky") [$NETWORK]
--number-of-days value, --nd value Number of past days to show rewards for. It should be negative. Only used for 'all' claim type (default: -21) [$REWARDS_NUMBER_OF_DAYS]
--output-file value, -o value Output file to write the data [$OUTPUT_FILE]
--verbose, -v Enable verbose logging (default: false) [$VERBOSE]
--help, -h show help
```
### Testnet
Show all Rewards
```bash
Expand Down
8 changes: 7 additions & 1 deletion pkg/rewards/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ var (
NumberOfDaysFlag = cli.IntFlag{
Name: "number-of-days",
Aliases: []string{"nd"},
Usage: "Number of days to show rewards for. Negative means past days, positive means future days (future days is not supported yet). Only used for 'all' claim type",
Usage: "Number of past days to show rewards for. It should be negative. Only used for 'all' claim type",
Value: -21,
EnvVars: []string{"REWARDS_NUMBER_OF_DAYS"},
Action: func(context *cli.Context, i int) error {
if i >= 0 {
return cli.Exit("Number of days should be negative to represent past days", 1)
}
return nil
},
}

AVSAddressesFlag = cli.StringFlag{
Expand Down
5 changes: 0 additions & 5 deletions pkg/rewards/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,6 @@ func readAndValidateConfig(cCtx *cli.Context, logger logging.Logger) (*ShowConfi
earnerAddress := gethcommon.HexToAddress(cCtx.String(EarnerAddressFlag.Name))
output := cCtx.String(flags.OutputFileFlag.Name)
numberOfDays := cCtx.Int64(NumberOfDaysFlag.Name)
if numberOfDays >= 0 {
return nil, errors.New(
"future rewards projection is not supported yet. Please provide a negative number of days for past rewards",
)
}
network := cCtx.String(flags.NetworkFlag.Name)
env := cCtx.String(EnvironmentFlag.Name)
if env == "" {
Expand Down

0 comments on commit 8c6a319

Please sign in to comment.