Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix readme for rewards show #216

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading