From 70aa29ddc9e138dbf6443f4c9dde68091335814e Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:41:55 +0100 Subject: [PATCH 1/8] golem price is INotify... --- Golem/Golem.cs | 23 +++++-------- Golem/PaymentService.cs | 4 --- GolemLib/GolemPrice.cs | 71 +++++++++++++++++++++++++++++++++++++++++ GolemLib/types.cs | 14 +------- 4 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 GolemLib/GolemPrice.cs diff --git a/Golem/Golem.cs b/Golem/Golem.cs index 19091b31..2fb988f3 100644 --- a/Golem/Golem.cs +++ b/Golem/Golem.cs @@ -19,6 +19,8 @@ namespace Golem { + + public class Golem : IGolem, IAsyncDisposable { private YagnaService Yagna { get; set; } @@ -32,20 +34,8 @@ public class Golem : IGolem, IAsyncDisposable private readonly HttpClient _httpClient; - private GolemPrice price; - public GolemPrice Price - { - get - { - return price; - } - set - { - price = value; - OnPropertyChanged(); - } - } - + public GolemPrice Price { get; set; } = new GolemPrice(); + public uint NetworkSpeed { get; set; } private GolemStatus status; @@ -77,7 +67,10 @@ public string WalletAddress return walletAddress ?? ""; } - set => ProviderConfig.WalletAddress = value; + set + { + ProviderConfig.WalletAddress = value; + } } public event PropertyChangedEventHandler? PropertyChanged; diff --git a/Golem/PaymentService.cs b/Golem/PaymentService.cs index de42bb4a..0892b115 100644 --- a/Golem/PaymentService.cs +++ b/Golem/PaymentService.cs @@ -23,11 +23,7 @@ public class PaymentService //: Interfaces.IPaymentService private readonly ProviderConfigService _providerConfig; private Golem _golem; private ILogger _logger; - - public DateTime? LastSuccessfullRefresh { get; private set; } = null; - public event PropertyChangedEventHandler? PropertyChanged; - private bool _shouldCheckForInternalWallet = true; public PaymentService(Network network, YagnaService yagna, Golem golem, ProviderConfigService providerConfig, ILogger logger) { diff --git a/GolemLib/GolemPrice.cs b/GolemLib/GolemPrice.cs new file mode 100644 index 00000000..f34f8054 --- /dev/null +++ b/GolemLib/GolemPrice.cs @@ -0,0 +1,71 @@ +namespace GolemLib.Types; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +/// +/// Represents price settings in Golem pricing model. +/// TODO: We will find out later which of these options make the most sense. +/// +public class GolemPrice: INotifyPropertyChanged +{ + + private decimal startPrice; + private decimal gpuPerHour; + private decimal envPerHour; + private decimal numRequests; + + public decimal GpuPerHour + { + get + { + return gpuPerHour; + } set + { + gpuPerHour = value; + OnPropertyChanged(); + } + } + + public decimal EnvPerHour + { + get + { + return envPerHour; + } set + { + envPerHour = value; + OnPropertyChanged(); + } + } + + public decimal NumRequests + { + get + { + return numRequests; + } set + { + numRequests = value; + OnPropertyChanged(); + } + } + + public decimal StartPrice + { + get + { + return startPrice; + } + set + { + startPrice = value; + OnPropertyChanged(); + } + } + + public event PropertyChangedEventHandler? PropertyChanged; + protected void OnPropertyChanged([CallerMemberName] string? name = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +} diff --git a/GolemLib/types.cs b/GolemLib/types.cs index 82edc9e5..3c852d16 100644 --- a/GolemLib/types.cs +++ b/GolemLib/types.cs @@ -2,19 +2,7 @@ namespace GolemLib.Types; using System; using System.Collections.Generic; - - -/// -/// Represents price settings in Golem pricing model. -/// TODO: We will find out later which of these options make the most sense. -/// -public class GolemPrice -{ - public decimal GpuPerHour { get; set; } - public decimal EnvPerHour { get; set; } - public decimal NumRequests { get; set; } - public decimal StartPrice { get; set; } -} +using System.Dynamic; /// /// Resources usage reported by ExeUnit. From a516af202b572ecf85547a2bcb812ad9c08ba25b Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:43:26 +0100 Subject: [PATCH 2/8] merge conflicts --- Golem/Yagna/YagnaService.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Golem/Yagna/YagnaService.cs b/Golem/Yagna/YagnaService.cs index 5902f23c..b32a1fb2 100644 --- a/Golem/Yagna/YagnaService.cs +++ b/Golem/Yagna/YagnaService.cs @@ -70,10 +70,6 @@ private EnvironmentBuilder Env } } - // public YagnaService(string golemPath) - // { - // _yaExePath = Path.Combine(golemPath, "yagna.exe"); - public YagnaService(string golemPath, string? dataDir, ILoggerFactory? loggerFactory = null) { loggerFactory = loggerFactory == null ? NullLoggerFactory.Instance : loggerFactory; From 42f119878dc71267138ae700af2fd5be0110aed1 Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:02:16 +0100 Subject: [PATCH 3/8] price updates --- Golem.Tests/GolemTests.cs | 35 ++++++++++++++++- Golem.Tests/Tools/PropertyChangedHandler.cs | 14 +++---- Golem/Golem.cs | 35 ++++++++++++++++- Golem/ProviderConfigService.cs | 42 ++++++++++++++++++++- Golem/Yagna/PresetConfigService.cs | 20 ++++++++-- 5 files changed, 131 insertions(+), 15 deletions(-) diff --git a/Golem.Tests/GolemTests.cs b/Golem.Tests/GolemTests.cs index 6b1a1d3b..8c3c1911 100644 --- a/Golem.Tests/GolemTests.cs +++ b/Golem.Tests/GolemTests.cs @@ -27,7 +27,7 @@ public async Task StartStop_VerifyStatusAsync() status = v; }; - golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); + golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); await golem.Start(); @@ -62,7 +62,7 @@ public async Task Start_ChangeWallet_VerifyStatusAsync() status = v; }; - golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); + golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); await golem.Start(); @@ -72,5 +72,36 @@ public async Task Start_ChangeWallet_VerifyStatusAsync() Assert.Equal(GolemStatus.Off, status); } + + [Fact] + public async Task Start_ChangePrices_VerifyPriceAsync() + { + string golemPath = await PackageBuilder.BuildTestDirectory("Start_ChangePrices_VerifyPriceAsync"); + Console.WriteLine("Path: " + golemPath); + + var golem = new Golem(PackageBuilder.BinariesDir(golemPath), PackageBuilder.DataDir(golemPath), loggerFactory); + + decimal price = 0; + + Action updatePrice = (v) => price = v; + + golem.Price.PropertyChanged += new PropertyChangedHandler(nameof(GolemPrice.StartPrice), updatePrice).Subscribe(); + golem.Price.PropertyChanged += new PropertyChangedHandler(nameof(GolemPrice.GpuPerHour), updatePrice).Subscribe(); + golem.Price.PropertyChanged += new PropertyChangedHandler(nameof(GolemPrice.EnvPerHour), updatePrice).Subscribe(); + golem.Price.PropertyChanged += new PropertyChangedHandler(nameof(GolemPrice.NumRequests), updatePrice).Subscribe(); + + + golem.Price.StartPrice = 0.005m; + Assert.Equal(0.005m, price); + + golem.Price.GpuPerHour = 0.006m; + Assert.Equal(0.006m, price); + + golem.Price.EnvPerHour = 0.007m; + Assert.Equal(0.007m, price); + + golem.Price.NumRequests = 0.008m; + Assert.Equal(0.008m, price); + } } } diff --git a/Golem.Tests/Tools/PropertyChangedHandler.cs b/Golem.Tests/Tools/PropertyChangedHandler.cs index e50424da..070c1fe3 100644 --- a/Golem.Tests/Tools/PropertyChangedHandler.cs +++ b/Golem.Tests/Tools/PropertyChangedHandler.cs @@ -3,12 +3,12 @@ namespace Golem.IntegrationTests.Tools { - public class PropertyChangedHandler + public class PropertyChangedHandler { - private Action Handler { get; set; } + private Action Handler { get; set; } private string PropertyName { get; set; } - public PropertyChangedHandler(string propertyName, Action handler) + public PropertyChangedHandler(string propertyName, Action handler) { Handler = handler; PropertyName = propertyName; @@ -33,12 +33,12 @@ private void HandlerImpl(object? sender, PropertyChangedEventArgs e) if (value is null) return; - Handler((T)value); - - if (sender is not Golem golem || e.PropertyName != PropertyName) + if (sender is not T || e.PropertyName != PropertyName) return; - Console.WriteLine($"Property has changed: {e.PropertyName} to {golem.Status}"); + Handler((V)value); + + Console.WriteLine($"Property has changed: {e.PropertyName} to {value}"); } } } diff --git a/Golem/Golem.cs b/Golem/Golem.cs index 2fb988f3..6332ed87 100644 --- a/Golem/Golem.cs +++ b/Golem/Golem.cs @@ -34,7 +34,29 @@ public class Golem : IGolem, IAsyncDisposable private readonly HttpClient _httpClient; - public GolemPrice Price { get; set; } = new GolemPrice(); + private readonly GolemPrice _golemPrice; + + public GolemPrice Price + { + get + { + // var price = ProviderConfig.GolemPrice; + // _golemPrice.StartPrice = price.StartPrice; + // _golemPrice.GpuPerHour = price.GpuPerHour; + // _golemPrice.EnvPerHour = price.EnvPerHour; + // _golemPrice.NumRequests = price.NumRequests; + return _golemPrice; + } + set + { + _golemPrice.StartPrice = value.StartPrice; + _golemPrice.GpuPerHour = value.GpuPerHour; + _golemPrice.EnvPerHour = value.EnvPerHour; + _golemPrice.NumRequests = value.NumRequests; + + OnPropertyChanged(); + } + } public uint NetworkSpeed { get; set; } @@ -156,11 +178,22 @@ public Golem(string golemPath, string? dataDir, ILoggerFactory? loggerFactory = Yagna = new YagnaService(golemPath, yagna_datadir, loggerFactory); Provider = new Provider(golemPath, prov_datadir, loggerFactory); ProviderConfig = new ProviderConfigService(Provider, YagnaOptionsFactory.DefaultNetwork); + _golemPrice = ProviderConfig.GolemPrice; _httpClient = new HttpClient { BaseAddress = new Uri(YagnaOptionsFactory.DefaultYagnaApiUrl) }; + + this.Price.PropertyChanged += GolemPrice_PropertyChangedHandler; + } + + private void GolemPrice_PropertyChangedHandler(object? sender, PropertyChangedEventArgs e) + { + if (sender is GolemPrice price) + { + ProviderConfig.GolemPrice = price; + } } private async Task StartupYagnaAsync(YagnaStartupOptions yagnaOptions) diff --git a/Golem/ProviderConfigService.cs b/Golem/ProviderConfigService.cs index 7bcf1d1c..dff79dcb 100644 --- a/Golem/ProviderConfigService.cs +++ b/Golem/ProviderConfigService.cs @@ -8,7 +8,8 @@ namespace Golem { using global::Golem.Yagna.Types; using global::Golem.Yagna; - + using GolemLib.Types; + namespace GolemUI.Src { public class ProviderConfigService @@ -34,6 +35,45 @@ public string WalletAddress } } + public GolemPrice GolemPrice + { + get + { + var preset = _provider.PresetConfig.GetPreset(_provider.PresetConfig.DefaultPresetName); + + if(preset == null) + return new GolemPrice(); + + if(!preset.UsageCoeffs.TryGetValue("ai-runtime.requests", out var numRequests)) + numRequests = 0; + if(!preset.UsageCoeffs.TryGetValue("golem.usage.duration_sec", out var duration)) + duration = 0; + if(!preset.UsageCoeffs.TryGetValue("golem.usage.gpu-sec", out var gpuSec)) + gpuSec = 0; + + var initPrice = preset.InitialPrice ?? 0m; + + return new GolemPrice + { + EnvPerHour = duration, + StartPrice = initPrice, + GpuPerHour = gpuSec, + NumRequests = numRequests + }; + } + + set + { + _provider.PresetConfig.UpdatePrices(_provider.PresetConfig.DefaultPresetName, new Dictionary + { + { "num-requests", value.NumRequests }, + { "golem.usage.duration_sec", value.EnvPerHour }, + { "gpu-sec", value.GpuPerHour }, + { "Initial", value.StartPrice } + }); + } + } + private void UpdateWalletAddress(string? walletAddress = null) { var config = _provider.Config; diff --git a/Golem/Yagna/PresetConfigService.cs b/Golem/Yagna/PresetConfigService.cs index 8e48fb2c..d3491fae 100644 --- a/Golem/Yagna/PresetConfigService.cs +++ b/Golem/Yagna/PresetConfigService.cs @@ -2,6 +2,8 @@ using System.Text; using System.Text.Json.Serialization; +using GolemLib.Types; + namespace Golem.Yagna { public class Preset @@ -24,13 +26,16 @@ public Preset(string name, string exeunitName, Dictionary usage [JsonPropertyName("pricing-model")] public string? PricingModel { get; set; } + [JsonPropertyName("initial-price")] + public decimal? InitialPrice { get; set; } + [JsonPropertyName("usage-coeffs")] public Dictionary UsageCoeffs { get; set; } } public class PresetConfigService { - private Provider _parent; + private readonly Provider _parent; public string DefaultPresetName => "ai-dummy"; internal PresetConfigService(Provider parent) @@ -46,11 +51,12 @@ public IList ActivePresetsNames } } - public string AllPresets + public List AllPresets { get { - return _parent.ExecToText("preset list"); + var presets = _parent.Exec>("preset --json list") ?? new List(); + return presets; } } @@ -63,6 +69,12 @@ public void DeactivatePreset(string presetName) _parent.ExecToText($"preset deactivate {presetName}"); } + public Preset? GetPreset(string name) + { + var preset = AllPresets.Where(p => p.Name == name).SingleOrDefault(); + return preset; + } + public void AddPreset(Preset preset, out string args, out string info) { StringBuilder cmd = new StringBuilder("preset create --no-interactive", 60); @@ -101,7 +113,7 @@ public void UpdatePrices(string presetName, IDictionary prices) { var pargs = String.Join(" ", from e in prices select $"--price {e.Key}={e.Value.ToString(CultureInfo.InvariantCulture)}"); - string args = $"preset update --no-interactive {presetName} {pargs}"; + string args = $"preset update --no-interactive --name {presetName} {pargs}"; var _result = _parent.ExecToText(args); } } From 3d2d1e7dd801cbd3ae7a3876ed4e138f7666e778 Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:29:08 +0100 Subject: [PATCH 4/8] fix tests --- Golem.Tests/GolemTests.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Golem.Tests/GolemTests.cs b/Golem.Tests/GolemTests.cs index 8c3c1911..1ec44ba7 100644 --- a/Golem.Tests/GolemTests.cs +++ b/Golem.Tests/GolemTests.cs @@ -27,7 +27,7 @@ public async Task StartStop_VerifyStatusAsync() status = v; }; - golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); + golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); await golem.Start(); @@ -62,7 +62,7 @@ public async Task Start_ChangeWallet_VerifyStatusAsync() status = v; }; - golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); + golem.PropertyChanged += new PropertyChangedHandler(nameof(IGolem.Status), updateStatus).Subscribe(); await golem.Start(); @@ -91,6 +91,7 @@ public async Task Start_ChangePrices_VerifyPriceAsync() golem.Price.PropertyChanged += new PropertyChangedHandler(nameof(GolemPrice.NumRequests), updatePrice).Subscribe(); + //Assert property changes golem.Price.StartPrice = 0.005m; Assert.Equal(0.005m, price); @@ -102,6 +103,12 @@ public async Task Start_ChangePrices_VerifyPriceAsync() golem.Price.NumRequests = 0.008m; Assert.Equal(0.008m, price); + + //Assert property returns correct value + Assert.Equal(0.005m, golem.Price.StartPrice); + Assert.Equal(0.006m, golem.Price.GpuPerHour); + Assert.Equal(0.007m, golem.Price.EnvPerHour); + Assert.Equal(0.008m, golem.Price.NumRequests); } } } From dd5d2d73043080b65c9f7f4feda0bb627f186056 Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:33:28 +0100 Subject: [PATCH 5/8] NetworkSpeed property changed event --- Golem/Golem.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Golem/Golem.cs b/Golem/Golem.cs index 6332ed87..b0103b5a 100644 --- a/Golem/Golem.cs +++ b/Golem/Golem.cs @@ -57,8 +57,18 @@ public GolemPrice Price OnPropertyChanged(); } } + + private uint _networkSpeed; - public uint NetworkSpeed { get; set; } + public uint NetworkSpeed + { + get =>_networkSpeed; + set + { + _networkSpeed = value; + OnPropertyChanged(); + } + } private GolemStatus status; From 5b997f15f9c4576815e836e194f989e43333c1fd Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:35:44 +0100 Subject: [PATCH 6/8] remove not used PaymentService --- Golem/PaymentService.cs | 168 ---------------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 Golem/PaymentService.cs diff --git a/Golem/PaymentService.cs b/Golem/PaymentService.cs deleted file mode 100644 index 0892b115..00000000 --- a/Golem/PaymentService.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using Golem.Yagna.Types; -using Golem.Yagna; -using Microsoft.Extensions.Logging; -using GolemLib.Types; -using Golem.GolemUI.Src; - -namespace Golem -{ - public class PaymentService //: Interfaces.IPaymentService - { - private Network _network; - private string? _walletAddress; - private string? _buildInAdress; - private YagnaService _yagna; - private readonly ProviderConfigService _providerConfig; - private Golem _golem; - private ILogger _logger; - public event PropertyChangedEventHandler? PropertyChanged; - - public PaymentService(Network network, YagnaService yagna, Golem golem, ProviderConfigService providerConfig, ILogger logger) - { - _logger = logger; - _network = network; - _yagna = yagna; - _golem = golem; - _providerConfig = providerConfig; - - _walletAddress = _providerConfig.WalletAddress; - - //_timer = new DispatcherTimer(); - //_timer.Interval = TimeSpan.FromSeconds(20); - //_timer.Tick += (object? s, EventArgs a) => this.UpdateState(); - //_timer.Start(); - //if (processController.IsServerRunning) - //{ - // UpdateState(); - //} - //else - //{ - // _processController.PropertyChanged += this.OnProcessControllerStateChange; - //} - } - - - //public string? LastError { get; private set; } - - //public string? Address => _walletAddress ?? _buildInAdress; - - //public string InternalAddress => _buildInAdress ?? ""; - - //private void OnProcessControllerStateChange(object? sender, PropertyChangedEventArgs ev) - //{ - // if (ev.PropertyName == "IsServerRunning" && this._golem.IsServerRunning) - // { - // UpdateState(); - // } - //} - - //private void OnProviderConfigChange(object? sender, PropertyChangedEventArgs ev) - //{ - // _walletAddress = _providerConfig.Config?.Account ?? _buildInAdress; - // UpdateState(); - // OnPropertyChanged("Address"); - //} - - - - //public async Task Refresh() - //{ - // try - // { - // if (!_golem.IsServerRunning) - // { - // return; - // } - // if (_buildInAdress == null) - // { - // _buildInAdress = _yagna.Id?.Address; - // if (_walletAddress == null) - // { - // OnPropertyChanged("Address"); - // } - // OnPropertyChanged("InternalAddress"); - // } - // var walletAddress = _walletAddress ?? _buildInAdress; - - // if (walletAddress == null) - // { - // throw new Exception("Wallet address is null"); - // } - - // var state = await GetWalletState(walletAddress); - - - // if (walletAddress != _buildInAdress) - // { - // if (_shouldCheckForInternalWallet && _buildInAdress != null) - // { - // var internalWalletstate = await GetWalletState(_buildInAdress); - // if (internalWalletstate == null || internalWalletstate?.Balance == 0) _shouldCheckForInternalWallet = false; - - // if (internalWalletstate != InternalWalletState) - // { - // InternalWalletState = internalWalletstate; - // OnPropertyChanged("InternalWalletState"); - // } - // } - // } - // var oldState = State; - // LastError = null; - // if (state != oldState) - // { - // State = state; - // OnPropertyChanged("State"); - // } - // LastSuccessfullRefresh = DateTime.Now; - // } - // catch (HttpRequestException ex) - // { - // string errorMsg = $"HttpRequestException when updating payment status: {ex.Message}"; - // _logger.LogError(errorMsg); - // LastError = "No connection to payment service"; - // State = null; - // OnPropertyChanged("State"); - // } - // catch (Exception ex) - // { - // string errorMsg = $"Exception when updating payment status: {ex.Message}"; - // _logger.LogError(errorMsg); - // LastError = "Unknown problem with payment service"; - // State = null; - // OnPropertyChanged("State"); - // } - //} - - protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - //public async Task TransferOutTo(string address) - //{ - // if (_buildInAdress == null) - // { - // return false; - // } - // var balance = await _gsbPayment.GetStatus(_buildInAdress, PaymentDriver.ERC20.Id, _network.Id); - // var result = await _gsbPayment.TransferTo(PaymentDriver.ERC20.Id, _buildInAdress, _network.Id, address, amount: balance.Amount); - // return true; - //} - - //private async void UpdateState() - //{ - // await Refresh(); - //} - } -} From 078010d0f5dc28a55d37e2032c368d62f0fc9673 Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:17:13 +0100 Subject: [PATCH 7/8] unify fields --- Golem/ProviderConfigService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Golem/ProviderConfigService.cs b/Golem/ProviderConfigService.cs index dff79dcb..89cc6be0 100644 --- a/Golem/ProviderConfigService.cs +++ b/Golem/ProviderConfigService.cs @@ -66,9 +66,9 @@ public GolemPrice GolemPrice { _provider.PresetConfig.UpdatePrices(_provider.PresetConfig.DefaultPresetName, new Dictionary { - { "num-requests", value.NumRequests }, + { "ai-runtime.requests", value.NumRequests }, { "golem.usage.duration_sec", value.EnvPerHour }, - { "gpu-sec", value.GpuPerHour }, + { "golem.usage.gpu-sec", value.GpuPerHour }, { "Initial", value.StartPrice } }); } From ae03b2b324048ffef330dee4b565dafacd918171 Mon Sep 17 00:00:00 2001 From: Staszek Krotki <16387248+staszek-krotki@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:23:09 +0100 Subject: [PATCH 8/8] non nullable app-key --- Golem/Yagna/YagnaService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Golem/Yagna/YagnaService.cs b/Golem/Yagna/YagnaService.cs index b32a1fb2..8e422384 100644 --- a/Golem/Yagna/YagnaService.cs +++ b/Golem/Yagna/YagnaService.cs @@ -11,7 +11,7 @@ namespace Golem.Yagna { public class YagnaStartupOptions { - public string? AppKey { get; set; } + public string AppKey { get; set; } = ""; public string? PrivateKey { get; set; }