From 44ef08df2c6c2f0fb705f0a04a67db0798d1bf73 Mon Sep 17 00:00:00 2001 From: Mike <41407352+hunjixin@users.noreply.github.com> Date: Thu, 27 Jun 2024 20:43:26 +0800 Subject: [PATCH] feat: default to enable pow (#203) Co-authored-by: hunjixin <16705420332lee@gmai.com> --- pkg/options/resource-provider.go | 8 ++++---- pkg/resourceprovider/resourceprovider.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/options/resource-provider.go b/pkg/options/resource-provider.go index 09016682..4cc21843 100644 --- a/pkg/options/resource-provider.go +++ b/pkg/options/resource-provider.go @@ -22,7 +22,7 @@ func NewResourceProviderOptions() resourceprovider.ResourceProviderOptions { func GetDefaultResourceProviderPowOptions() resourceprovider.ResourceProviderPowOptions { return resourceprovider.ResourceProviderPowOptions{ - EnablePow: GetDefaultServeOptionBool("ENABLE_POW", false), + DisablePow: GetDefaultServeOptionBool("DISABLE_POW", false), NumWorkers: GetDefaultServeOptionInt("NUM_WORKER", 0), CudaGridSize: GetDefaultServeOptionInt("CUDA_GRID_SIZE", 256), @@ -85,12 +85,12 @@ func AddResourceProviderOfferCliFlags(cmd *cobra.Command, offerOptions *resource func AddResourceProviderPowCliFlags(cmd *cobra.Command, options *resourceprovider.ResourceProviderPowOptions) { cmd.PersistentFlags().BoolVar( - &options.EnablePow, "enable-pow", options.EnablePow, - `Start pow mining (ENABLE_POW)`, + &options.DisablePow, "disable-pow", options.DisablePow, + `Disable pow mining (DISABLE_POW)`, ) cmd.PersistentFlags().IntVar( &options.NumWorkers, "num-worker", options.NumWorkers, - `Start pow mining (NUM_WORKER)`, + `Pow worker number (NUM_WORKER)`, ) cmd.PersistentFlags().IntVar( diff --git a/pkg/resourceprovider/resourceprovider.go b/pkg/resourceprovider/resourceprovider.go index 4250ff7f..65e5201e 100644 --- a/pkg/resourceprovider/resourceprovider.go +++ b/pkg/resourceprovider/resourceprovider.go @@ -53,7 +53,7 @@ type ResourceProviderOfferOptions struct { // this configures the pow we will keep track of type ResourceProviderPowOptions struct { - EnablePow bool + DisablePow bool NumWorkers int CudaGridSize int @@ -91,7 +91,7 @@ func NewResourceProvider( } func (resourceProvider *ResourceProvider) Start(ctx context.Context, cm *system.CleanupManager) chan error { - if resourceProvider.options.Pow.EnablePow { + if !resourceProvider.options.Pow.DisablePow { go resourceProvider.StartMineLoop(ctx) } return resourceProvider.controller.Start(ctx, cm)