Skip to content

Commit

Permalink
chore(cli): add prefix to avs commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhalliday committed Dec 19, 2024
1 parent 8c8e022 commit 87ad074
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions cli/cmd/register.go → cli/cmd/avs_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ type RegDeps struct {

type regOpt func(*RegDeps)

// Register registers the operator with the omni AVS contract.
// AVSRegister registers the operator with the omni AVS contract.
//
// It assumes that the operator is already registered with the Eigen-Layer
// and that the eigen-layer configuration file (and ecdsa keystore) is present on disk.
func Register(ctx context.Context, cfg RegConfig, opts ...regOpt) error {
func AVSRegister(ctx context.Context, cfg RegConfig, opts ...regOpt) error {
// Default dependencies.
deps := RegDeps{
Prompter: eigenutils.NewPrompter(),
Expand Down Expand Up @@ -137,8 +137,8 @@ func Register(ctx context.Context, cfg RegConfig, opts ...regOpt) error {
return nil
}

// Deregister deregisters the operator from the omni AVS contract.
func Deregister(ctx context.Context, cfg RegConfig, opts ...regOpt) error {
// AVSDeregister deregisters the operator from the omni AVS contract.
func AVSDeregister(ctx context.Context, cfg RegConfig, opts ...regOpt) error {
// Default dependencies.
deps := RegDeps{
Prompter: eigenutils.NewPrompter(),
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/register_test.go → cli/cmd/avs_register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ func registerOperator(t *testing.T, ctx context.Context, contracts Contracts, b
AVSAddr: contracts.OmniAVSAddr.Hex(),
}

err = clicmd.Register(ctx, regCfg, testOpts)
err = clicmd.AVSRegister(ctx, regCfg, testOpts)
tutil.RequireNoError(t, err)
}

Expand Down Expand Up @@ -570,7 +570,7 @@ func deregisterOperator(t *testing.T, ctx context.Context, contracts Contracts,
AVSAddr: contracts.OmniAVSAddr.Hex(),
}

err = clicmd.Deregister(ctx, regCfg, testOpts)
err = clicmd.AVSDeregister(ctx, regCfg, testOpts)
tutil.RequireNoError(t, err)
}

Expand Down
16 changes: 8 additions & 8 deletions cli/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func newOperatorCmds() *cobra.Command {
}

cmd.AddCommand(
newRegisterCmd(),
newDeregisterCmd(),
newAVSRegisterCmd(),
newAVSDeregisterCmd(),
newInitCmd(),
newCreateValCmd(),
newCreateOperatorKeyCmd(),
Expand All @@ -41,19 +41,19 @@ func newOperatorCmds() *cobra.Command {
return cmd
}

func newRegisterCmd() *cobra.Command {
func newAVSRegisterCmd() *cobra.Command {
var cfg RegConfig

cmd := &cobra.Command{
Use: "register",
Use: "avs-register",
Short: "Register an operator with the Omni AVS contract",
Long: `Register command expects a Eigen-Layer yaml config file as an argument
to successfully register an operator address with the Omni AVS contract.
Note the operator must already be registered with Eigen-Layer.`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
err := Register(cmd.Context(), cfg)
err := AVSRegister(cmd.Context(), cfg)
if err != nil {
return errors.Wrap(err, "registration failed")
}
Expand All @@ -67,19 +67,19 @@ Note the operator must already be registered with Eigen-Layer.`,
return cmd
}

func newDeregisterCmd() *cobra.Command {
func newAVSDeregisterCmd() *cobra.Command {
var cfg RegConfig

cmd := &cobra.Command{
Use: "deregister",
Use: "avs-deregister",
Short: "Deregister an operator from the Omni AVS contract",
Long: `Deregister command expects a EigenLayer yaml config file as an argument
to successfully deregister an operator from the Omni AVS contract.
Note the operator must already be registered on the Omni AVS contract.`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
err := Deregister(cmd.Context(), cfg)
err := AVSDeregister(cmd.Context(), cfg)
if err != nil {
return errors.Wrap(err, "deregistration failed")
}
Expand Down
3 changes: 2 additions & 1 deletion docs/content/operate/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ Note pure `halo` command is just `rollback`. But when running via `halovisor` on

Operators can still register with Omni's Eigenlayer AVS contract following Eigenlayer's instructions [here](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation) to register operator key with their contracts and then run the following command to register within the Omni AVS contract:
```bash
omni operator register --config-file ~/path/to/operator.yaml
omni operator avs-register --config-file ~/path/to/operator.yaml
# previously `omni operator register` (v0.11.0 or earlier)
```

<aside>
Expand Down

0 comments on commit 87ad074

Please sign in to comment.