diff --git a/code/go/0chain.net/blobber/config.go b/code/go/0chain.net/blobber/config.go index f530db0af..55a80b794 100644 --- a/code/go/0chain.net/blobber/config.go +++ b/code/go/0chain.net/blobber/config.go @@ -117,7 +117,6 @@ func reloadConfig() error { config.Configuration.Capacity = viper.GetInt64("capacity") - config.Configuration.MinLockDemand = viper.GetFloat64("min_lock_demand") config.Configuration.NumDelegates = viper.GetInt("num_delegates") config.Configuration.ReadPrice = viper.GetFloat64("read_price") config.Configuration.ServiceCharge = viper.GetFloat64("service_charge") diff --git a/code/go/0chain.net/blobbercore/config/config.go b/code/go/0chain.net/blobbercore/config/config.go index 29d22ced1..f1ac23ecc 100644 --- a/code/go/0chain.net/blobbercore/config/config.go +++ b/code/go/0chain.net/blobbercore/config/config.go @@ -90,10 +90,9 @@ type Config struct { HealthCheckWorkerFreq time.Duration - ReadPrice float64 - WritePrice float64 - PriceInUSD bool - MinLockDemand float64 + ReadPrice float64 + WritePrice float64 + PriceInUSD bool // WriteMarkerLockTimeout lock is released automatically if it is timeout WriteMarkerLockTimeout time.Duration diff --git a/code/go/0chain.net/blobbercore/config/settings.go b/code/go/0chain.net/blobbercore/config/settings.go index 662519856..f12f26cca 100644 --- a/code/go/0chain.net/blobbercore/config/settings.go +++ b/code/go/0chain.net/blobbercore/config/settings.go @@ -19,7 +19,6 @@ const TableNameSettings = "settings" type Settings struct { ID string `gorm:"column:id;size:10;primaryKey"` Capacity int64 `gorm:"column:capacity;not null;default:0"` - MinLockDemand float64 `gorm:"column:min_lock_demand;not null;default:0"` NumDelegates int `gorm:"column:num_delegates;not null;default:100"` ReadPrice float64 `gorm:"column:read_price;not null;default:0"` WritePrice float64 `gorm:"column:write_price;not null;default:0"` @@ -40,7 +39,6 @@ func (s *Settings) CopyTo(c *Config) error { c.Capacity = s.Capacity - c.MinLockDemand = s.MinLockDemand c.NumDelegates = s.NumDelegates c.ReadPrice = s.ReadPrice c.ServiceCharge = s.ServiceCharge @@ -56,7 +54,6 @@ func (s *Settings) CopyFrom(c *Config) error { } s.Capacity = c.Capacity - s.MinLockDemand = c.MinLockDemand s.NumDelegates = c.NumDelegates s.ReadPrice = c.ReadPrice s.ServiceCharge = c.ServiceCharge @@ -118,8 +115,7 @@ func ReloadFromChain(ctx context.Context, db *gorm.DB) (*zcncore.Blobber, error) } Configuration.Capacity = int64(b.Capacity) - Configuration.MinLockDemand = b.Terms.MinLockDemand - Configuration.NumDelegates = b.StakePoolSettings.NumDelegates + Configuration.NumDelegates = *b.StakePoolSettings.NumDelegates if token, err := b.Terms.ReadPrice.ToToken(); err != nil { return nil, err @@ -133,6 +129,6 @@ func ReloadFromChain(ctx context.Context, db *gorm.DB) (*zcncore.Blobber, error) Configuration.WritePrice = token } - Configuration.ServiceCharge = b.StakePoolSettings.ServiceCharge + Configuration.ServiceCharge = *b.StakePoolSettings.ServiceCharge return b, Update(ctx, db) } diff --git a/code/go/0chain.net/blobbercore/handler/object_operation_handler_bench_test.go b/code/go/0chain.net/blobbercore/handler/object_operation_handler_bench_test.go index 17f448cfa..dfef4f0f1 100644 --- a/code/go/0chain.net/blobbercore/handler/object_operation_handler_bench_test.go +++ b/code/go/0chain.net/blobbercore/handler/object_operation_handler_bench_test.go @@ -67,7 +67,7 @@ func BenchmarkUploadFileWithDisk(b *testing.B) { hasher := sdk.CreateHasher(int64(bm.ChunkSize)) isFinal := false - body, formData, _ := formBuilder.Build(fileMeta, hasher, strconv.FormatInt(time.Now().UnixNano(), 10), int64(bm.ChunkSize), 0, 0, isFinal, "", [][]byte{chunkBytes}, nil) + body, formData, _ := formBuilder.Build(fileMeta, hasher, strconv.FormatInt(time.Now().UnixNano(), 10), int64(bm.ChunkSize), 0, 0, isFinal, "", "", [][]byte{chunkBytes}, nil, 0) req, err := blobber.NewRequest(http.MethodPost, "http://127.0.0.1:5051/v1/file/upload/benchmark_upload", body) @@ -160,7 +160,7 @@ func BenchmarkUploadFileWithNoDisk(b *testing.B) { hasher := sdk.CreateHasher(int64(bm.ChunkSize)) isFinal := false - body, formData, _ := formBuilder.Build(fileMeta, hasher, strconv.FormatInt(time.Now().UnixNano(), 10), int64(bm.ChunkSize), 0, 0, isFinal, "", [][]byte{chunkBytes}, nil) + body, formData, _ := formBuilder.Build(fileMeta, hasher, strconv.FormatInt(time.Now().UnixNano(), 10), int64(bm.ChunkSize), 0, 0, isFinal, "", "", [][]byte{chunkBytes}, nil, 0) req, err := blobber.NewRequest(http.MethodPost, "http://127.0.0.1:5051/v1/file/upload/benchmark_upload", body) diff --git a/code/go/0chain.net/blobbercore/handler/protocol.go b/code/go/0chain.net/blobbercore/handler/protocol.go index cbfe2444d..ffdcb3932 100644 --- a/code/go/0chain.net/blobbercore/handler/protocol.go +++ b/code/go/0chain.net/blobbercore/handler/protocol.go @@ -64,7 +64,6 @@ func getStorageNode() (*transaction.StorageNode, error) { } sn.Terms.ReadPrice = zcncore.ConvertToValue(readPrice) sn.Terms.WritePrice = zcncore.ConvertToValue(writePrice) - sn.Terms.MinLockDemand = config.Configuration.MinLockDemand sn.StakePoolSettings.DelegateWallet = config.Configuration.DelegateWallet sn.StakePoolSettings.NumDelegates = config.Configuration.NumDelegates diff --git a/code/go/0chain.net/blobbercore/stats/blobberstats.go b/code/go/0chain.net/blobbercore/stats/blobberstats.go index de98c2aaa..633937f0c 100644 --- a/code/go/0chain.net/blobbercore/stats/blobberstats.go +++ b/code/go/0chain.net/blobbercore/stats/blobberstats.go @@ -72,10 +72,9 @@ type BlobberStats struct { AllocationListPagination *Pagination `json:"allocation_list_pagination,omitempty"` // configurations - Capacity int64 `json:"capacity"` - ReadPrice float64 `json:"read_price"` - WritePrice float64 `json:"write_price"` - MinLockDemand float64 `json:"min_lock_demand"` + Capacity int64 `json:"capacity"` + ReadPrice float64 `json:"read_price"` + WritePrice float64 `json:"write_price"` AllocationStats []*AllocationStats `json:"-"` @@ -106,7 +105,6 @@ func (bs *BlobberStats) loadBasicStats(ctx context.Context) { bs.Capacity = config.Configuration.Capacity bs.ReadPrice = config.Configuration.ReadPrice bs.WritePrice = config.Configuration.WritePrice - bs.MinLockDemand = config.Configuration.MinLockDemand // du := filestore.GetFileStore().GetTotalFilesSize() diff --git a/code/go/0chain.net/blobbercore/stats/handler.go b/code/go/0chain.net/blobbercore/stats/handler.go index e43aef333..14e3e5748 100644 --- a/code/go/0chain.net/blobbercore/stats/handler.go +++ b/code/go/0chain.net/blobbercore/stats/handler.go @@ -135,7 +135,6 @@ const tpl = `