diff --git a/cmd/lilypad/jobcreator.go b/cmd/lilypad/jobcreator.go index 59dbb0cd..13d06f23 100644 --- a/cmd/lilypad/jobcreator.go +++ b/cmd/lilypad/jobcreator.go @@ -20,11 +20,12 @@ func newJobCreatorCmd() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { network, _ := cmd.Flags().GetString("network") + lilynext, _ := cmd.Flags().GetBool("lilynext") options, err := optionsfactory.ProcessOnChainJobCreatorOptions(options, args, network) if err != nil { return err } - return runJobCreator(cmd, options, network) + return runJobCreator(cmd, options, network, lilynext) }, } @@ -33,10 +34,14 @@ func newJobCreatorCmd() *cobra.Command { return solverCmd } -func runJobCreator(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network string) error { +func runJobCreator(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network string, lilynext bool) error { commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() + if lilynext { + log.Info().Msg("🍃 Running the new lilypad protocol") + } + telemetry, err := configureTelemetry(commandCtx.Ctx, system.JobCreatorService, network, options.Telemetry, nil, options.Web3) if err != nil { log.Warn().Msgf("failed to setup opentelemetry: %s", err) diff --git a/cmd/lilypad/resource-provider.go b/cmd/lilypad/resource-provider.go index 51337288..22ca70e3 100644 --- a/cmd/lilypad/resource-provider.go +++ b/cmd/lilypad/resource-provider.go @@ -20,13 +20,14 @@ func newResourceProviderCmd() *cobra.Command { Example: "", RunE: func(cmd *cobra.Command, _ []string) error { network, _ := cmd.Flags().GetString("network") + lilynext, _ := cmd.Flags().GetBool("lilynext") options, err := optionsfactory.ProcessResourceProviderOptions(options, network) if err != nil { return err } cmd.SilenceUsage = true - return runResourceProvider(cmd, options, network) + return runResourceProvider(cmd, options, network, lilynext) }, } @@ -35,10 +36,14 @@ func newResourceProviderCmd() *cobra.Command { return resourceProviderCmd } -func runResourceProvider(cmd *cobra.Command, options resourceprovider.ResourceProviderOptions, network string) error { +func runResourceProvider(cmd *cobra.Command, options resourceprovider.ResourceProviderOptions, network string, lilynext bool) error { commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() + if lilynext { + log.Info().Msg("🍃 Running the new lilypad protocol") + } + telemetry, err := configureTelemetry(commandCtx.Ctx, system.ResourceProviderService, network, options.Telemetry, nil, options.Web3) if err != nil { log.Warn().Msgf("failed to setup opentelemetry: %s", err) diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index e8999d54..8a1255d2 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -24,7 +24,9 @@ func NewRootCmd() *cobra.Command { } var network string + var lilynext bool RootCmd.PersistentFlags().StringVarP(&network, "network", "n", "testnet", "Sets a target network configuration") + RootCmd.PersistentFlags().BoolVar(&lilynext, "lilynext", false, "Use the new Lilypad protocol") RootCmd.AddCommand(newSolverCmd()) RootCmd.AddCommand(newResourceProviderCmd()) diff --git a/cmd/lilypad/run.go b/cmd/lilypad/run.go index 1c29716e..5be65d12 100644 --- a/cmd/lilypad/run.go +++ b/cmd/lilypad/run.go @@ -29,13 +29,14 @@ func newRunCmd() *cobra.Command { Example: "run cowsay:v0.0.1 -i Message=moo", RunE: func(cmd *cobra.Command, args []string) error { network, _ := cmd.Flags().GetString("network") + lilynext, _ := cmd.Flags().GetBool("lilynext") options, err := optionsfactory.ProcessJobCreatorOptions(options, args, network) if err != nil { return err } cmd.SilenceUsage = true - return runJob(cmd, options, network) + return runJob(cmd, options, network, lilynext) }, } @@ -44,7 +45,7 @@ func newRunCmd() *cobra.Command { return runCmd } -func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network string) error { +func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network string, lilynext bool) error { c := color.New(color.FgCyan).Add(color.Bold) header := ` ⠀⠀⠀⠀⠀⠀⣀⣤⣤⢠⣤⣀⠀⠀⠀⠀⠀ @@ -86,6 +87,10 @@ func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network st commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() + if lilynext { + log.Info().Msg("🍃 Running the new lilypad protocol") + } + telemetry, err := configureTelemetry(commandCtx.Ctx, system.JobCreatorService, network, options.Telemetry, nil, options.Web3) if err != nil { log.Warn().Msgf("failed to setup opentelemetry: %s", err) diff --git a/cmd/lilypad/solver.go b/cmd/lilypad/solver.go index 170a979e..aa1568df 100644 --- a/cmd/lilypad/solver.go +++ b/cmd/lilypad/solver.go @@ -25,13 +25,14 @@ func newSolverCmd() *cobra.Command { Example: "", RunE: func(cmd *cobra.Command, _ []string) error { network, _ := cmd.Flags().GetString("network") + lilynext, _ := cmd.Flags().GetBool("lilynext") options, err := optionsfactory.ProcessSolverOptions(options, network) if err != nil { return err } cmd.SilenceUsage = true - return runSolver(cmd, options, network) + return runSolver(cmd, options, network, lilynext) }, } @@ -40,10 +41,14 @@ func newSolverCmd() *cobra.Command { return solverCmd } -func runSolver(cmd *cobra.Command, options solver.SolverOptions, network string) error { +func runSolver(cmd *cobra.Command, options solver.SolverOptions, network string, lilynext bool) error { commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() + if lilynext { + log.Info().Msg("🍃 Running the new lilypad protocol") + } + telemetry, err := configureTelemetry(commandCtx.Ctx, system.SolverService, network, options.Telemetry, &options.Metrics, options.Web3) if err != nil { log.Warn().Msgf("failed to setup opentelemetry: %s", err)