-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1d6339
commit 8292d6f
Showing
7 changed files
with
215 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package flags | ||
|
||
import "github.com/urfave/cli/v2" | ||
|
||
var ( | ||
ConfigurationFileFlag = cli.StringFlag{ | ||
Name: "configuration-file", | ||
Usage: "Path to the configuration file", | ||
Required: true, | ||
Aliases: []string{"c"}, | ||
} | ||
|
||
AvsAddressesFlag = cli.StringSliceFlag{ | ||
Name: "avs-addresses", | ||
Usage: "Comma separated list of AVS addresses", | ||
Required: false, | ||
Aliases: []string{"a"}, | ||
} | ||
|
||
OperatorSetsFlag = cli.StringSliceFlag{ | ||
Name: "operator-sets", | ||
Usage: "Comma separated list of operator sets", | ||
Required: false, | ||
Aliases: []string{"os"}, | ||
} | ||
|
||
OperatorSetFlag = cli.StringFlag{ | ||
Name: "operator-set", | ||
Usage: "Operator set identifier", | ||
Required: true, | ||
Aliases: []string{"o"}, | ||
} | ||
|
||
NumberOfDaysFlag = cli.IntFlag{ | ||
Name: "number-of-days", | ||
Usage: "Number of days to show rewards for. Negative values to view retroactive rewards.", | ||
Required: false, | ||
DefaultText: "21", | ||
Aliases: []string{"n"}, | ||
} | ||
|
||
DryRunFlag = cli.BoolFlag{ | ||
Name: "dry-run", | ||
Usage: "Dry run the command", | ||
Required: false, | ||
Aliases: []string{"d"}, | ||
} | ||
|
||
BroadcastFlag = cli.BoolFlag{ | ||
Name: "broadcast", | ||
Usage: "Broadcast the transaction", | ||
Required: false, | ||
Aliases: []string{"b"}, | ||
} | ||
|
||
AllocationPercentageFlag = cli.StringFlag{ | ||
Name: "allocation-percentage", | ||
Usage: "Allocation to update", | ||
Required: true, | ||
Aliases: []string{"a"}, | ||
} | ||
|
||
StakeSourceFlag = cli.StringFlag{ | ||
Name: "stake-source", | ||
Usage: "The source of stake in case of allocation. The destination of stake if deallocation. Options are 'slashable', 'nonslashable' or 'both'. ", | ||
Required: true, | ||
Aliases: []string{"s"}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package operator | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/operator/rewards" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/utils" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func RewardsCmd(p utils.Prompter) *cli.Command { | ||
return &cli.Command{ | ||
Name: "rewards", | ||
Usage: "Rewards commands", | ||
Hidden: true, | ||
Subcommands: []*cli.Command{ | ||
rewards.ShowCmd(p), | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package rewards | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/Layr-Labs/eigenlayer-cli/pkg/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/utils" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func ShowCmd(p utils.Prompter) *cli.Command { | ||
return &cli.Command{ | ||
Name: "show", | ||
Aliases: []string{"s"}, | ||
Usage: "Show rewards", | ||
After: telemetry.AfterRunAction(), | ||
Action: showRewards, | ||
Flags: []cli.Flag{ | ||
&flags.ConfigurationFileFlag, | ||
&flags.NumberOfDaysFlag, | ||
&flags.OperatorSetsFlag, | ||
&flags.AvsAddressesFlag, | ||
}, | ||
} | ||
} | ||
|
||
func showRewards(cCtx *cli.Context) error { | ||
fmt.Println("unimplemented") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package operator | ||
|
||
import ( | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/operator/stakeallocation" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/utils" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func StakeAllocationCmd(p utils.Prompter) *cli.Command { | ||
return &cli.Command{ | ||
Name: "stake-allocation", | ||
Usage: "Stake allocation commands", | ||
Hidden: true, | ||
Subcommands: []*cli.Command{ | ||
stakeallocation.ShowCmd(p), | ||
stakeallocation.UpdateCmd(p), | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package stakeallocation | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/Layr-Labs/eigenlayer-cli/pkg/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/utils" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func ShowCmd(p utils.Prompter) *cli.Command { | ||
return &cli.Command{ | ||
Name: "show", | ||
Aliases: []string{"s"}, | ||
Usage: "Show stake allocation", | ||
Description: ` | ||
Show the stake allocation for the operator | ||
`, | ||
Action: showStakeAllocation, | ||
After: telemetry.AfterRunAction(), | ||
Flags: []cli.Flag{ | ||
&flags.ConfigurationFileFlag, | ||
&flags.AvsAddressesFlag, | ||
&flags.OperatorSetsFlag, | ||
}, | ||
} | ||
} | ||
|
||
func showStakeAllocation(ctx *cli.Context) error { | ||
fmt.Println("unimplemented") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package stakeallocation | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/Layr-Labs/eigenlayer-cli/pkg/flags" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/telemetry" | ||
"github.com/Layr-Labs/eigenlayer-cli/pkg/utils" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func UpdateCmd(p utils.Prompter) *cli.Command { | ||
return &cli.Command{ | ||
Name: "update", | ||
Aliases: []string{"u"}, | ||
Usage: "Update stake allocation", | ||
Description: ` | ||
Update the stake allocation for the operator | ||
`, | ||
Action: func(context *cli.Context) error { | ||
return updateStakeAllocation(context, p) | ||
}, | ||
After: telemetry.AfterRunAction(), | ||
Flags: []cli.Flag{ | ||
&flags.ConfigurationFileFlag, | ||
&flags.OperatorSetFlag, | ||
&flags.DryRunFlag, | ||
&flags.BroadcastFlag, | ||
&flags.AllocationPercentageFlag, | ||
&flags.StakeSourceFlag, | ||
}, | ||
} | ||
} | ||
|
||
func updateStakeAllocation(ctx *cli.Context, p utils.Prompter) error { | ||
fmt.Println("unimplemented") | ||
return nil | ||
} |