Skip to content
Permalink
Browse files

Release: V. 3.5.0

Release: V. 3.5.0
  • Loading branch information...
cryptoprofitswitcher committed Jun 12, 2018
2 parents 34b1c1f + 6de767f commit 6704b11590045abd209b3120529da0fc25511a45
Showing with 751 additions and 216 deletions.
  1. BIN CastXmr/cast_xmr-vega.exe
  2. +1 −1 Coins/Aeon.json
  3. +1 −1 Coins/Bittube.json
  4. +1 −1 Coins/Electroneum.json
  5. +1 −1 Coins/Graft.json
  6. +2 −2 Coins/Haven.json
  7. +1 −1 Coins/Loki.json
  8. +79 −0 Coins/Masari.json
  9. +1 −1 Coins/Monero.json
  10. +1 −1 Coins/MoneroOcean.json
  11. +1 −1 Coins/Stellite.json
  12. +4 −1 CryptonightProfitSwitcher.csproj
  13. +2 −1 Enums/Algorithm.cs
  14. +9 −0 Enums/ProfitSwitchingStrategy.cs
  15. +24 −0 Factories/MinerFactory.cs
  16. +24 −0 Factories/PoolProfitProviderFactory.cs
  17. +21 −0 Factories/ProfitSwitchingStrategyFactory.cs
  18. +9 −2 Helpers.cs
  19. +3 −0 Mineables/Mineable.cs
  20. +7 −0 Miners/CastXmrMiner.cs
  21. +1 −0 Miners/IMiner.cs
  22. +3 −0 Miners/SrbMiner.cs
  23. +6 −0 Miners/XmrStakMiner.cs
  24. +16 −0 Models/MineableReward.cs
  25. +53 −0 Models/Profit.cs
  26. +6 −1 { → Models}/Settings.cs
  27. +1 −1 NicehashAlgorithms/CryptonightHeavy.json
  28. +1 −1 NicehashAlgorithms/CryptonightV7.json
  29. +0 −37 Profit.cs
  30. +1 −0 ProfitPoviders/IPoolProfitProvider.cs
  31. +9 −3 ProfitPoviders/MineCryptonightApi.cs
  32. +15 −17 ProfitPoviders/MinerRocksApi.cs
  33. +2 −2 ProfitPoviders/MoneroOceanApi.cs
  34. +9 −2 ProfitPoviders/NicehashApi.cs
  35. +15 −0 ProfitSwitchingStrategies/IProfitSwitchingStrategy.cs
  36. +60 −0 ProfitSwitchingStrategies/MaximizeCoinsStrategy.cs
  37. +95 −0 ProfitSwitchingStrategies/MaximizeFiatStrategy.cs
  38. +75 −0 ProfitSwitchingStrategies/WeightedCoinsPriceStrategy.cs
  39. +144 −131 Program.cs
  40. +16 −0 Properties/PublishProfiles/Linux64.pubxml
  41. +1 −1 Properties/PublishProfiles/{FolderProfile.pubxml → Win64.pubxml}
  42. +13 −2 README.md
  43. +5 −1 SRBMiner/ReadMe.txt
  44. BIN SRBMiner/SRBMiner-CN.exe
  45. +11 −2 Settings.json
  46. BIN XmrStak/xmr-stak.exe
  47. BIN XmrStak/xmrstak_opencl_backend.dll
  48. BIN screenshot.png
  49. +1 −1 version.txt
BIN +118 KB (100%) CastXmr/cast_xmr-vega.exe
Binary file not shown.
@@ -5,7 +5,7 @@
"DisplayName": "Aeon",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "AEON",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightLite",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -5,7 +5,7 @@
"DisplayName": "Bittube",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "TUBE",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightBittube",
// Used Miner, can be XmrStak, CastXmr or SRBMiner
"Miner": "XmrStak",
@@ -5,7 +5,7 @@
"DisplayName": "Electroneum",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "ETN",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightV7",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -5,7 +5,7 @@
"DisplayName": "Graft",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "GRFT",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightV7",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -5,8 +5,8 @@
"DisplayName": "Haven Protocol",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "XHV",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
"Algorithm": "CryptonightHeavy",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightHaven",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
// Path to script that runs before the miner starts, can be null.
@@ -5,7 +5,7 @@
"DisplayName": "Loki",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "LOKI",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightHeavy",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -0,0 +1,79 @@
{
/* GENERAL CONFIGURATION - ALWAYS NEEDED */

// Displayed name, can be anything.
"DisplayName": "Masari",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "MSR",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightMasari",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
// Path to script that runs before the miner starts, can be null.
// For example:: Path to batch file that sets specific OverdriveN settings for this coin
"PrepareScript": null,
// Enables or disables this coin, can be true or false (default: true)
"Enabled": true,

/* OVERRIDE SETTINGS - NOT NEEDED */

// Override the expected hashrate, can be a number or null.
"OverrideExpectedHashrate": null,
// Override the profit timeframe, can be Live, Day or null.
"OverrideProfitTimeframe": null,
// Override the profit providers, can be a comma seperated ordered string (example: MineCryptonightApi, MinerRocksApi) or null.
"OverridePoolProfitProviders": null,
// On the determination of the most profitable coin, the actual estimated profit will be multiplied by this, can be a decimal or null.
"PreferFactor": 1.0,

/* AUTO POOL CONFIGURATION - NEEDED FOR CASTXMR OR IF POOL CONFIG FILE IS NOT DIRECTLY SET */

"PoolAddress": "pool.masaricoin.com:7777",
"PoolWalletAddress": "5t5mEm254JNJ9HqRjY9vCiTE8aZALHX3v8TqhyQ3TTF9VHKZQXkRYjPDweT9kK4rJw7dDLtZXGjav2z9y24vXCdRc6BSJwUmapXC7NmVAM+90000",
"PoolPassword": "x",
"PoolUseTls": false,
"PoolTlsFingerprint": "",
"PoolWeight": 1,
"PoolRigId": "",

/* XMR-STAK CONFIGURATION - NEEDED IF MINER IS XMRSTAK OR FOR CPU MINING*/

// Path to Xmr-Stak executable
"XmrStakPath": "XmrStak/xmr-stak.exe",
// Path to Xmr-Stak config file
"ConfigPath": "XmrStak/config.txt",
// Port of the Xmr-Stak Json API, should match the port in the config file of Xmr-Stak.
"XmrStakApiPort": 4000,
// Path to Xmr-Stak cpu config file, can be null.
"CpuPath": "XmrStak/cpu_v7.txt",
// Path to Xmr-Stak amd gpu config file, can be null.
"AmdPath": "XmrStak/amd_v7.txt",
// Path to Xmr-Stak nvidea gpu config file, can be null.
"NvidiaPath": null,
// Set the path to Xmr-Stak pool config file directly (can be null, if you use AUTO POOL CONFIGURATION)
"PoolsPath": null,

/* CASTXMR CONFIGURATION - NEEDED IF MINER IS CASTXMR */

// Path to CastXmr executable
"CastXmrPath": "CastXmr/cast_xmr-vega.exe",
// Extra arguments for setting the GPUs or tuning
"CastXmrExtraArguments": "-G 0,1",
// Set if you want to also start Xmr-Stak for CPU Mining
"CastXmrUseXmrStakCPUMining": true,

/* SRBMINER CONFIGURATION - NEEDED IF MINER IS SRBMINER*/

// Path to SRBMiner executable
"SRBMinerPath": "SRBMiner/SRBMiner-CN.exe",
// Path to SRBMiner config file
"SRBMinerConfigPath": "SRBMiner/config_v7.txt",
// Port of the SRBMiner REST API, should match the port in the config file of SRBMiner.
"SRBMinerApiPort": 21555,
// Set the path to SRBMiner pool config file directly (can be null, if you use AUTO POOL CONFIGURATION)
"SRBMinerPoolsPath": null,
// Set if you want to also start Xmr-Stak for CPU Mining
"SRBMinerUseXmrStakCPUMining": true


}
@@ -5,7 +5,7 @@
"DisplayName": "Monero",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "XMR",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightV7",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -5,7 +5,7 @@
"DisplayName": "MoneroOcean",
// Ticker symbol, needed to get profit data (SPECIAL: MoneroOcean)
"TickerSymbol": "MoneroOcean",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightV7",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -5,7 +5,7 @@
"DisplayName": "Stellite",
// Ticker symbol on minecryptonight.net, needed to get profit data
"TickerSymbol": "XTL",
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite or CryptonightHaven
// Mining algorithm of coin, can be CryptonightV7, CryptonightHeavy, CryptonightLite, CryptonightBittube, CryptonightStellite, CryptonightHaven or CryptonightMasari
"Algorithm": "CryptonightStellite",
// Used Miner, can be XmrStak, CastXmr or SRBMiner (Recommended: XmrStak)
"Miner": "XmrStak",
@@ -6,7 +6,7 @@
<TrimUnusedDependencies>true</TrimUnusedDependencies>
<LinkDuringPublish>true</LinkDuringPublish>
<ShowLinkerSizeComparison>true</ShowLinkerSizeComparison>
<Version>3.0.0</Version>
<Version>3.5.0</Version>
</PropertyGroup>

<ItemGroup>
@@ -31,6 +31,9 @@
<None Update="Coins\Electroneum.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Coins\Masari.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Coins\MoneroOcean.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -7,6 +7,7 @@ public enum Algorithm
CryptonightLite,
CryptonightBittube,
CryptonightStellite,
CryptonightHaven
CryptonightHaven,
CryptonightMasari
}
}
@@ -0,0 +1,9 @@
namespace CryptonightProfitSwitcher.Enums
{
public enum ProfitSwitchingStrategy
{
MaximizeFiat,
MaximizeCoins,
WeightedCoinsPrice
}
}
@@ -0,0 +1,24 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.Miners;
using System;

namespace CryptonightProfitSwitcher.Factories
{
public static class MinerFactory
{
public static IMiner GetMiner(Miner miner)
{
switch (miner)
{
case Miner.XmrStak:
return new XmrStakMiner(false);
case Miner.CastXmr:
return new CastXmrMiner();
case Miner.SRBMiner:
return new SrbMiner();
default:
throw new NotImplementedException("Couldn't start miner, unknown miner: " + miner);
}
}
}
}
@@ -0,0 +1,24 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.ProfitPoviders;
using System;

namespace CryptonightProfitSwitcher.Factories
{
public static class PoolProfitProviderFactory
{
public static IPoolProfitProvider GetPoolProfitProvider(ProfitProvider profitProvider)
{
switch (profitProvider)
{
case ProfitProvider.MineCryptonightApi:
return new MineCryptonightApi();
case ProfitProvider.MinerRocksApi:
return new MinerRocksApi();
case ProfitProvider.MoneroOceanApi:
return new MoneroOceanApi();
default:
throw new NotImplementedException("Doesn't support ProfitProvider: " + profitProvider);
}
}
}
}
@@ -0,0 +1,21 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.ProfitSwitchingStrategies;

namespace CryptonightProfitSwitcher.Factories
{
public static class ProfitSwitchingStrategyFactory
{
public static IProfitSwitchingStrategy GetProfitSwitchingStrategy(ProfitSwitchingStrategy strategy)
{
switch (strategy)
{
case ProfitSwitchingStrategy.MaximizeCoins:
return new MaximizeCoinsStrategy();
case ProfitSwitchingStrategy.WeightedCoinsPrice:
return new WeightedCoinsPriceStrategy();
default:
return new MaximizeFiatStrategy();
}
}
}
}
@@ -1,5 +1,7 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.Factories;
using CryptonightProfitSwitcher.Mineables;
using CryptonightProfitSwitcher.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -20,6 +22,7 @@ internal static string ToCurrency(this double val, string currencySymbol)
var rounded = Math.Round(val, 2, MidpointRounding.AwayFromZero);
return rounded.ToString() + currencySymbol;
}

internal static T GetProperty<T>(ExpandoObject expando, string propertyName)
{
var expandoDict = expando as IDictionary<string, object>;
@@ -38,6 +41,7 @@ internal static string GetApplicationVersion()
var ver = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
return ver;
}

internal static string ResolveToFullPath(string path, string appRootPath)
{
string resolvedPath = Path.Combine(appRootPath, path);
@@ -56,7 +60,8 @@ internal static Profit GetPoolProfitForCoin(Coin coin, Dictionary<ProfitProvider
{
Profit profit = new Profit();
List<ProfitProvider> orderedProfitProviders = GetPoolProfitProviders(settings, coin);
while (profit.Reward == 0 && orderedProfitProviders.Count > 0)
var profitSwitchingStrategy = ProfitSwitchingStrategyFactory.GetProfitSwitchingStrategy(settings.ProfitSwitchingStrategy);
while (profitSwitchingStrategy.GetReward(profit,coin,settings.ProfitTimeframe) == 0 && orderedProfitProviders.Count > 0)
{
ProfitProvider profitProvider = orderedProfitProviders[0];
var poolProfits = poolProfitsDictionary.GetValueOrDefault(profitProvider, null);
@@ -68,6 +73,7 @@ internal static Profit GetPoolProfitForCoin(Coin coin, Dictionary<ProfitProvider
}
return profit;
}

internal static List<ProfitProvider> GetPoolProfitProviders(Settings settings, Coin coin)
{
var result = new List<ProfitProvider>();
@@ -112,7 +118,9 @@ internal static List<ProfitProvider> GetPoolProfitProviders(Settings settings, C
}
return result;
}

static ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();

internal static string GetJsonFromUrl(string url, Settings settings, DirectoryInfo appRootFolder)
{
var cacheFolder = appRootFolder.CreateSubdirectory("Cache");
@@ -163,7 +171,6 @@ internal static string GetJsonFromUrl(string url, Settings settings, DirectoryIn
_lock.EnterWriteLock();
File.WriteAllText(urlMapPath, serialized);
_lock.ExitWriteLock();

}
catch (Exception ex)
{
@@ -1,4 +1,5 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.Models;
using System;

namespace CryptonightProfitSwitcher.Mineables
@@ -41,6 +42,7 @@ public bool IsEnabled()
{
return Enabled ?? true;
}

public int GetExpectedHashrate(Settings settings)
{
if (OverrideExpectedHashrate.HasValue)
@@ -51,6 +53,7 @@ public int GetExpectedHashrate(Settings settings)
{
case Algorithm.CryptonightV7:
case Algorithm.CryptonightStellite:
case Algorithm.CryptonightMasari:
return settings.CryptonightV7Hashrate;
case Algorithm.CryptonightHeavy:
case Algorithm.CryptonightHaven:
@@ -1,5 +1,6 @@
using CryptonightProfitSwitcher.Enums;
using CryptonightProfitSwitcher.Mineables;
using CryptonightProfitSwitcher.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -15,6 +16,7 @@ public class CastXmrMiner : IMiner
Process _process = null;
Mineable _mineable = null;
IMiner _cpuMiner = null;

public double GetCurrentHashrate(Settings settings, DirectoryInfo appRootFolder)
{
double gpuHashrate = 0;
@@ -88,6 +90,9 @@ public void StartMiner(Mineable mineable, Settings settings, string appRoot, Dir
case Algorithm.CryptonightStellite:
args += $"{space}--algo=6";
break;
case Algorithm.CryptonightHaven:
args += $"{space}--algo=7";
break;
default:
throw new NotImplementedException("Couldn't start CastXmr, unknown algo: {mineable.Algorithm}\n" +
"You can set --algo yourself in the extra arguments.");
@@ -108,6 +113,8 @@ public void StartMiner(Mineable mineable, Settings settings, string appRoot, Dir
_process.StartInfo.CreateNoWindow = false;
_process.StartInfo.RedirectStandardOutput = false;
_process.StartInfo.WorkingDirectory = minerFolderPath;
_process.StartInfo.WindowStyle = settings.StartMinerMinimized ? ProcessWindowStyle.Minimized : ProcessWindowStyle.Normal;

Thread.Sleep(TimeSpan.FromSeconds(settings.MinerStartDelay));
_process.Start();

@@ -1,4 +1,5 @@
using CryptonightProfitSwitcher.Mineables;
using CryptonightProfitSwitcher.Models;
using System.IO;

namespace CryptonightProfitSwitcher.Miners

0 comments on commit 6704b11

Please sign in to comment.
You can’t perform that action at this time.