Skip to content

Commit

Permalink
correct operation for registration
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Anderson <[email protected]>
  • Loading branch information
dmikey committed Jun 6, 2024
1 parent 57d450c commit 013b8bc
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import (
"os"

sdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa"
sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
avs "github.com/zees-dev/blockless-avs"
"github.com/zees-dev/blockless-avs/core/config"
"github.com/zees-dev/blockless-avs/core/logging"
"github.com/zees-dev/blockless-avs/operator"
"github.com/zees-dev/blockless-avs/types"
)

const AppName = "Blockless AVS Tools"
Expand All @@ -20,39 +23,39 @@ func main() {
app.Usage = "Tools for interacting with Blockless AVS contracts"

// globally required flags
// app.Flags = []cli.Flag{
// config.DevModeFlag,
// config.ConfigFileFlag,
// config.HeadlessFlag,
// }
app.Flags = []cli.Flag{
// config.DevModeFlag,
config.ConfigFileFlag,
// config.HeadlessFlag,
}

// init app state, store in context
app.Before = func(c *cli.Context) error {
logger := logging.NewZeroLogger(logging.Development)

// setup operator from config file - provided as flag
// devMode := c.Bool(config.DevModeFlag.Name)
// configPath := c.String(config.ConfigFileFlag.Name)
configPath := c.String(config.ConfigFileFlag.Name)
// headless := c.Bool(config.HeadlessFlag.Name)

// nodeConfig := types.NodeConfig{}
// if err := sdkutils.ReadYamlConfig(configPath, &nodeConfig); err != nil {
// return err
// }
// operator, err := operator.NewOperatorFromConfig(logger, nodeConfig)
// if err != nil {
// return err
// }
nodeConfig := types.NodeConfig{}
if err := sdkutils.ReadYamlConfig(configPath, &nodeConfig); err != nil {
return err
}
operator, err := operator.NewOperatorFromConfig(logger, nodeConfig)
if err != nil {
return err
}

// if !headless {
// return errors.New("only headless mode is supported")
// }

c.App.Metadata[avs.AppConfigKey] = &avs.AppConfig{
AppName: AppName,
Logger: logger,
// NodeConfig: &nodeConfig,
// Operator: operator,
AppName: AppName,
Logger: logger,
NodeConfig: &nodeConfig,
Operator: operator,
// DevMode: devMode,
// Headless: headless,
}
Expand Down

0 comments on commit 013b8bc

Please sign in to comment.