Skip to content

Commit

Permalink
0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
angelbbs committed Dec 27, 2024
1 parent c5c826d commit 5281555
Show file tree
Hide file tree
Showing 31 changed files with 458 additions and 276 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
* **[Download latest release](https://github.com/angelbbs/ZergPoolMinerLegacy/releases)**


"Miner Legacy Fork Fix" is an free open source easy to use CPU & GPU cryptocurrency miner program with classic GUI for Windows.
"Miner Legacy Fork Fix" is an free open source easy to use CPU & GPU cryptocurrency miner program with classic GUI for Windows.
- Easy installer.
- Support AMD, INTEL, NVIDIA GPUs and CPU.
- Support wallets with guaranteed payouts coins.
- Included most profitable miners programs.
- Dual algorithms.
- Fast benchmark - 1-2 min per algo.
- Auto-switch between most profitable algorithms taking into account the consumption of devices and the cost of electricity.
- Tariff zones for electricity.
Expand Down
4 changes: 3 additions & 1 deletion ZergPoolMiner/Configs/Data/GeneralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class GeneralConfig
{
public Version ConfigFileVersion;
public double ForkFixVersion;
public DateTime updated_at;
public DateTime InstallDateTime;
public bool ShowSplash = true;
public bool DecreasePowerCost = false;
public bool ShowTotalPower = false;
Expand All @@ -19,7 +21,7 @@ public class GeneralConfig
public bool NoForceTRexClose;
public bool UseNegativeProfit = false;
public bool ShowHiddenAlgos = false;
public double DaggerOrderMaxPay = 0;
public double ProfitabilityCorrection = 0.8;
public int KawpowLiteMaxEpoch3GB = 220;
public int KawpowLiteMaxEpoch4GB = 354;
public int KawpowLiteMaxEpoch5GB = 488;
Expand Down
7 changes: 7 additions & 0 deletions ZergPoolMiner/Devices/Algorithms/DefaultAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ public static class DefaultAlgorithms
*/
new Algorithm(MinerBaseType.miniZ, AlgorithmType.Ethashb3, "Ethashb3")
{
},
new Algorithm(MinerBaseType.miniZ, AlgorithmType.Meraki, "Meraki")
{
}
}
},
Expand Down Expand Up @@ -691,6 +694,7 @@ public static class DefaultAlgorithms
new Algorithm(MinerBaseType.CryptoDredge, AlgorithmType.NeoScrypt, "NeoScrypt"),
//после переключения монет реджекты
//new Algorithm(MinerBaseType.CryptoDredge, AlgorithmType.Cryptonight_GPU, "Cryptonight_GPU"),
new Algorithm(MinerBaseType.CryptoDredge, AlgorithmType.Allium, "Allium"),
new Algorithm(MinerBaseType.CryptoDredge, AlgorithmType.SHA256csm, "SHA256csm"),
//new Algorithm(MinerBaseType.CryptoDredge, AlgorithmType.FiroPow, "FiroPow")
}
Expand Down Expand Up @@ -731,6 +735,9 @@ public static class DefaultAlgorithms
},
new Algorithm(MinerBaseType.miniZ, AlgorithmType.Ethashb3, "Ethashb3")
{
},
new Algorithm(MinerBaseType.miniZ, AlgorithmType.Meraki, "Meraki")
{
}
}
},
Expand Down
8 changes: 8 additions & 0 deletions ZergPoolMiner/Devices/Algorithms/GroupAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ private static Dictionary<MinerBaseType, List<Algorithm>> CreateForDevice(Comput
});
}

if (device.GpuRam < (ulong)(1024 * 1024 * 1024 * 8.2))
{
algoSettings = FilterMinerAlgos(algoSettings, new List<AlgorithmType>
{
AlgorithmType.FiroPow
});
}

//lite algo?
if (device.GpuRam < (ulong)(1024 * 1024 * 1024 * 7.5))
{
Expand Down
1 change: 1 addition & 0 deletions ZergPoolMiner/Forms/Form_Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions ZergPoolMiner/Forms/Form_Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public partial class Form_Main : Form, Form_Loading.IAfterInitializationCaller,
public static bool _demoMode;

public static string _PayoutTreshold = ",pl=0";
public static string wallet = "";
public static string worker = "";
public static string payoutCurrency = "";
private readonly Random R;

private Form_Loading _loadingScreen;
Expand Down Expand Up @@ -3403,14 +3406,20 @@ public StartMiningReturnType StartMining(bool showWarnings)
InitFlowPanelStart();
ClearRatesAll();
bool isMining;
payoutCurrency = ConfigManager.GeneralConfig.PayoutCurrency;
_PayoutTreshold = ",pl=" + ConfigManager.GeneralConfig.PayoutCurrencyTreshold.ToString();
worker = Miner.GetFullWorkerName();
wallet = ConfigManager.GeneralConfig.Wallet;
if (_demoMode)
{
worker = "demo";
payoutCurrency = "LTC";
_PayoutTreshold = ",pl=0";
wallet = Globals.DemoUser;
}
var password = " c=" + payoutCurrency + _PayoutTreshold + ",ID=" + worker;

isMining = MinersManager.StartInitialize(this, textBoxWorkerName.Text.Trim(),
ConfigManager.GeneralConfig.Wallet, ConfigManager.GeneralConfig.PayoutCurrency);
isMining = MinersManager.StartInitialize(this, wallet, password);

if (!_demoMode) ConfigManager.GeneralConfigFileCommit();
_minerStatsCheck.Start();
Expand Down Expand Up @@ -3983,6 +3992,21 @@ private void Form_Main_Activated(object sender, EventArgs e)
{
this.Width = ConfigManager.GeneralConfig.FormWidth;
}

private void linkLabelNewVersion_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
{
settings = new Form_Settings();
try
{
// SetChildFormCenter(settings);
settings.tabControlGeneral.SelectedTab = settings.tabPageAbout;
settings.ShowDialog();
}
catch (Exception er)
{
Helpers.ConsolePrint("settings", er.ToString());
}
}
}

static class TimeSpanExtensions
Expand Down
1 change: 1 addition & 0 deletions ZergPoolMiner/Forms/Form_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public Form_Settings()

button_ZIL_additional_mining.Visible = false;
button_Lite_Algo.Visible = false;
groupBoxConnection.Visible = false;
IsChange = false;
IsChangeSaved = false;

Expand Down
12 changes: 4 additions & 8 deletions ZergPoolMiner/Miners/ClaymoreNeoscryptMiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ public ClaymoreNeoscryptMiner()
}


public override void Start(string btcAdress, string worker)
public override void Start(string wallet, string password)
{
string psw = "c=" + ConfigManager.GeneralConfig.PayoutCurrency + Form_Main._PayoutTreshold + ",ID=" +
Stats.Stats.GetFullWorkerName();
if (ConfigManager.GeneralConfig.StaleProxy) psw = "stale";
string username = ConfigManager.GeneralConfig.Wallet;
LastCommandLine = " " + GetDevicesCommandString() + " -mport -" + ApiPort +
GetServer("neoscrypt") +
" -wal " + username + " -psw " + psw + " -dbg -1 -ftime 10 -retrydelay 5";
LastCommandLine = " " + GetDevicesCommandString() + " -mport -" + ApiPort + " -pool " +
GetServer("neoscrypt").Replace("stratum+ssl://", "stratum+tcp://").Replace("14233", "4233") +
" -wal " + wallet + " -psw " + password + " -dbg -1 -ftime 10 -retrydelay 5";

ProcessHandle = _Start();
}
Expand Down
15 changes: 9 additions & 6 deletions ZergPoolMiner/Miners/CryptoDredge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override int GetMaxCooldownTimeInMilliseconds()
return 60 * 1000 * 8;
}

public override void Start(string btcAdress, string worker)
public override void Start(string wallet, string password)
{
if (!IsInit)
{
Expand All @@ -40,16 +40,15 @@ public override void Start(string btcAdress, string worker)
var apiBind = " --api-bind 127.0.0.1:" + ApiPort + " ";
IsApiReadException = false;

string wallet = "--user " + ConfigManager.GeneralConfig.Wallet;
string password = " -p c=" + ConfigManager.GeneralConfig.PayoutCurrency + Form_Main._PayoutTreshold + ",ID=" +
Stats.Stats.GetFullWorkerName() + " ";
string _wallet = "--user " + wallet;
string _password = " -p " + password + " ";
var _algo = MiningSetup.CurrentAlgorithmType.ToString().ToLower();
_algo = _algo.Replace("cryptonight_gpu", "cngpu");

LastCommandLine = " --algo " + _algo +
" " + apiBind +
" -o " + GetServer(MiningSetup.CurrentAlgorithmType.ToString().ToLower()) + " " +
wallet + " " + password +
" -o stratum+ssl://" + GetServer(MiningSetup.CurrentAlgorithmType.ToString().ToLower()) + " " +
_wallet + " " + _password +
" -d " + GetDevicesCommandString() + " " +
ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.NVIDIA) + " ";

Expand Down Expand Up @@ -161,6 +160,10 @@ protected override void BenchmarkThreadRoutine(object commandLine)
delay_before_calc_hashrate = 10;
MinerStartDelay = 20;
}
if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.Allium))
{
_benchmarkTimeWait = _benchmarkTimeWait + 120;
}
Helpers.ConsolePrint("BENCHMARK", "Benchmark starts");
Helpers.ConsolePrint(MinerTag(), "Benchmark should end in: " + _benchmarkTimeWait + " seconds");
BenchmarkHandle = BenchmarkStartProcess((string)commandLine);
Expand Down
17 changes: 8 additions & 9 deletions ZergPoolMiner/Miners/GMiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public GMiner(AlgorithmType secondaryAlgorithmType) : base("GMiner")
IsMultiType = true;
}

public override void Start(string btcAdress, string worker)
public override void Start(string wallet, string password)
{
string url = "";

LastCommandLine = GetStartCommand(url, btcAdress, worker);
LastCommandLine = GetStartCommand(url, wallet, password);
const string vcp = "msvcp120.dll";
var vcpPath = WorkingDirectory + vcp;
if (!File.Exists(vcpPath))
Expand Down Expand Up @@ -75,7 +75,7 @@ protected override void _Stop(MinerStopType willswitch)
Stop_cpu_ccminer_sgminer_nheqminer(willswitch);
KillGminer();
}
private string GetStartCommand(string url, string btcAddress, string worker)
private string GetStartCommand(string url, string wallet, string password)
{
string ZilMining = "";
DeviceType devtype = DeviceType.NVIDIA;
Expand All @@ -101,20 +101,19 @@ private string GetStartCommand(string url, string btcAddress, string worker)
ConfigManager.GeneralConfig.ZIL_mining_state == 2)
{
ZilMining = " --zilserver " + ConfigManager.GeneralConfig.ZIL_mining_pool + ":" +
ConfigManager.GeneralConfig.ZIL_mining_port + " --ziluser " + ConfigManager.GeneralConfig.ZIL_mining_wallet + "." + worker + " ";
ConfigManager.GeneralConfig.ZIL_mining_port + " --ziluser " + ConfigManager.GeneralConfig.ZIL_mining_wallet + "." + wallet + " ";
}

string wallet = "--user " + ConfigManager.GeneralConfig.Wallet;
string password = " -p c=" + ConfigManager.GeneralConfig.PayoutCurrency + Form_Main._PayoutTreshold + ",ID=" +
Stats.Stats.GetFullWorkerName() + " ";
string _wallet = "--user " + wallet;

var _algo = MiningSetup.CurrentAlgorithmType.ToString().ToLower();
_algo = _algo.Replace("equihash125", "equihash125_4");
_algo = _algo.Replace("equihash144", "equihash144_5 --pers auto");

return " --algo " + _algo +
" " + $"--api {ApiPort} " + " " +
" -s " + GetServer(MiningSetup.CurrentAlgorithmType.ToString().ToLower()) + " " +
wallet + " " + password +
" --ssl -s " + GetServer(MiningSetup.CurrentAlgorithmType.ToString().ToLower()) + " " +
"-u " + wallet + " -p " + password + " " +
GetDevicesCommandString().Trim();
}

Expand Down
4 changes: 2 additions & 2 deletions ZergPoolMiner/Miners/Grouping/GroupMiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void End()
PowerRate = 0;
}

public void Start(string btcAdress, string worker)
public void Start(string wallet, string password)
{
if (Miner.IsRunning)
{
Expand All @@ -128,7 +128,7 @@ public void Start(string btcAdress, string worker)
// Wait before new start
System.Threading.Thread.Sleep(100);
//var locationUrl = Globals.GetLocationUrl(AlgorithmType, miningLocation, Miner.ConectionType);
Miner.Start(btcAdress, worker);
Miner.Start(wallet, password);
Thread.Sleep(Math.Max(ConfigManager.GeneralConfig.MinerRestartDelayMS, 500));
}
}
Expand Down
34 changes: 31 additions & 3 deletions ZergPoolMiner/Miners/Miner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Timers;
using System.Windows.Forms;
using Timer = System.Timers.Timer;
using ZergPoolMinerLegacy.UUID;

namespace ZergPoolMiner
{
Expand Down Expand Up @@ -446,7 +447,7 @@ public void KillAllUsedMinerProcesses()
_allPidData.RemoveAll(x => toRemovePidData.Contains(x));
}

public abstract void Start(string btcAdress, string worker);
public abstract void Start(string wallet, string password);

protected abstract void _Stop(MinerStopType willswitch);

Expand Down Expand Up @@ -670,6 +671,11 @@ protected virtual Process BenchmarkStartProcess(string commandLine)
{
benchmarkHandle.StartInfo.FileName = benchmarkHandle.StartInfo.FileName.Replace("CryptoDredge.exe", "CryptoDredge.0.25.1.exe");
}
if (benchmarkHandle.StartInfo.FileName.ToLower().Contains("cryptodredge") &&
(commandLine.ToLower().Contains("allium")))
{
benchmarkHandle.StartInfo.FileName = benchmarkHandle.StartInfo.FileName.Replace("CryptoDredge.exe", "CryptoDredge.0.23.0.exe");
}
if (benchmarkHandle.StartInfo.FileName.ToLower().Contains("t-rex") && (commandLine.ToLower().Contains("x16r") ||
commandLine.ToLower().Contains("x16rv2") ||
commandLine.ToLower().Contains("x21s") ||
Expand Down Expand Up @@ -1202,10 +1208,11 @@ public string GetServer(string algo)
string ret = "";
try
{
algo = algo.Replace("-", "_");
var _a = Stats.Stats.MiningAlgorithmsList.FirstOrDefault(item => item.name.ToLower() == algo.ToLower());
string serverUrl = Form_Main.regionList[ConfigManager.GeneralConfig.ServiceLocation].RegionLocation +
"mine.zergpool.com";
ret = Links.CheckDNS(algo + serverUrl).Replace("stratum+tcp://", "") + ":" + _a.port.ToString();
ret = Links.CheckDNS(algo + serverUrl).Replace("stratum+tcp://", "") + ":" + _a.tls_port.ToString();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -1368,6 +1375,11 @@ protected virtual MinerProcess _Start()
{
Path = MiningSetup.MinerPath.Replace("CryptoDredge.exe", "CryptoDredge.0.25.1.exe");
}
if (MiningSetup.MinerPath.ToLower().Contains("cryptodredge") &&
(LastCommandLine.ToLower().Contains("allium")))
{
Path = MiningSetup.MinerPath.Replace("CryptoDredge.exe", "CryptoDredge.0.23.0.exe");
}
if (MiningSetup.MinerPath.ToLower().Contains("t-rex") && (LastCommandLine.ToLower().Contains("x16r") ||
LastCommandLine.ToLower().Contains("x16rv2") ||
LastCommandLine.ToLower().Contains("x21s") ||
Expand Down Expand Up @@ -1451,7 +1463,7 @@ protected virtual MinerProcess _Start()

int algo = (int)MiningSetup.CurrentAlgorithmType;
int algo2 = (int)MiningSetup.CurrentSecondaryAlgorithmType;
string w = Stats.Stats.GetFullWorkerName();
string w = GetFullWorkerName();

NativeOverclock.OverclockStart(P.Id, algo, algo2, Path,
strPlatform, w, false);
Expand All @@ -1471,6 +1483,22 @@ protected virtual MinerProcess _Start()
}
}

public static string GetFullWorkerName()
{
string mac = WindowsMacUtils.GetMACAddress();
string w = "";

if (string.IsNullOrEmpty(ConfigManager.GeneralConfig.WorkerName.Trim()))
{
w = "demo";
}
else
{
w = ConfigManager.GeneralConfig.WorkerName.Trim();
}
return w + mac;
}

protected void StartCoolDownTimerChecker()
{
if (ConfigManager.GeneralConfig.CoolDownCheckEnabled)
Expand Down
4 changes: 4 additions & 0 deletions ZergPoolMiner/Miners/MinerVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,10 @@ public static string GetMinerFakeVersion(string miner, string algo)
{
miner = miner + " 0.25.1";
}
else if (miner.ToLower().Contains("cryptodredge") && (algo.ToLower().Contains("allium")))
{
miner = miner + " 0.23.0";
}
else
{
miner = miner + MinerVersion.GetMinerVersion(miner);
Expand Down
4 changes: 2 additions & 2 deletions ZergPoolMiner/Miners/MinersManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public static double GetTotalPower()
}

public static bool StartInitialize(IMainFormRatesComunication mainFormRatesComunication,
string worker, string btcAdress, string payoutCurrency)
string wallet, string password)
{
_curMiningSession = new MiningSession(ComputeDeviceManager.Available.Devices,
mainFormRatesComunication, worker, btcAdress, payoutCurrency);
mainFormRatesComunication, wallet, password);
return _curMiningSession.IsMiningEnabled;
}

Expand Down
Loading

0 comments on commit 5281555

Please sign in to comment.