Example #1
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                Helpers.ConsolePrint(MinerDeviceName, "GetMinerAlgorithm(" + nhalgo + "): Algo equals to null");
                return;
            }

            Path             = "sgminer.exe";
            WorkingDirectory = GetMinerDirectory(Algo.NiceHashName);

            LastCommandLine = "--gpu-platform " + GPUPlatformNumber +
                              " -k " + Algo.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + GetPassword(Algo) +
                              " --api-listen" +
                              " --api-port=" + APIPort.ToString() +
                              " " + ExtraLaunchParameters +
                              " " + Algo.ExtraLaunchParameters +
                              " --device ";

            foreach (ComputeDevice G in CDevs)
            {
                if (G.Enabled)
                {
                    LastCommandLine += G.ID.ToString() + ",";
                }
            }

            if (LastCommandLine.EndsWith(","))
            {
                LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
            }
            else
            {
                LastCommandLine = "";
                return; // no GPUs to start mining on
            }

            if (Config.ConfigData.HideMiningWindows)
            {
                Path            = "cmd";
                LastCommandLine = " /C \"cd /d " + WorkingDirectory +
                                  " && sgminer.exe " + LastCommandLine + "\"";
            }

            ProcessHandle = _Start();
        }
Example #2
0
        // DONE
        protected override bool UpdateBindPortCommand(int oldPort, int newPort)
        {
            const string MASK          = "-a {0}";
            var          oldApiBindStr = String.Format(MASK, oldPort);
            var          newApiBindStr = String.Format(MASK, newPort);

            if (LastCommandLine != null && LastCommandLine.Contains(oldApiBindStr))
            {
                LastCommandLine = LastCommandLine.Replace(oldApiBindStr, newApiBindStr);
                return(true);
            }
            return(false);
        }
Example #3
0
        protected bool UpdateBindPortCommand_ccminer_cpuminer(int oldPort, int newPort)
        {
            // --api-bind=
            const string MASK          = "--api-bind={0}";
            var          oldApiBindStr = String.Format(MASK, oldPort);
            var          newApiBindStr = String.Format(MASK, newPort);

            if (LastCommandLine != null && LastCommandLine.Contains(oldApiBindStr))
            {
                LastCommandLine = LastCommandLine.Replace(oldApiBindStr, newApiBindStr);
                return(true);
            }
            return(false);
        }
Example #4
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                return;
            }

            LastCommandLine = "--algo=" + Algo.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + GetPassword(Algo) +
                              " --api-bind=" + APIPort.ToString() +
                              " " + ExtraLaunchParameters +
                              " " + Algo.ExtraLaunchParameters +
                              " --devices ";

            foreach (ComputeDevice G in CDevs)
            {
                if (G.Enabled)
                {
                    LastCommandLine += G.ID.ToString() + ",";
                }
            }

            if (LastCommandLine.EndsWith(","))
            {
                LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
            }
            else
            {
                LastCommandLine = "";
                return; // no GPUs to start mining on
            }

            if (this is ccminer_sp && Algo.NiceHashName.Equals("neoscrypt"))
            {
                Path = "bin\\ccminer_neoscrypt.exe";
            }
            else if (this is ccminer_sp)
            {
                Path = "bin\\ccminer_sp.exe";
            }

            ProcessHandle = _Start();
        }
Example #5
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                return;
            }

            if (Algo.NiceHashName.Equals("ethereum"))
            {
                StartingUpDelay = true;

                // Create DAG file ahead of time
                if (!Ethereum.CreateDAGFile(MinerDeviceName))
                {
                    return;
                }

                // Starts up ether-proxy
                if (!Ethereum.StartProxy(true, url, username))
                {
                    return;
                }

                LastCommandLine = " --cuda -F http://127.0.0.1:" + Config.ConfigData.APIBindPortEthereumProxy + "/miner/10/" + MinerDeviceName + " " +
                                  " --erase-dags old" +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                                  " --cuda-devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled)
                    {
                        LastCommandLine += EtherDevices[i] + " ";
                    }
                }
            }
            else
            {
                LastCommandLine = "--algo=" + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-bind=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --devices ";

                foreach (ComputeDevice G in CDevs)
                {
                    if (G.Enabled)
                    {
                        LastCommandLine += G.ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (this is ccminer_sp && Algo.NiceHashName.Equals("neoscrypt"))
                {
                    Path = "bin\\ccminer_neoscrypt.exe";
                }
                else if (this is ccminer_sp)
                {
                    Path = "bin\\ccminer_sp.exe";
                }
            }

            ProcessHandle = _Start();
        }
Example #6
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                Helpers.ConsolePrint(MinerDeviceName, "GetMinerAlgorithm(" + nhalgo + "): Algo equals to null");
                return;
            }

            if (Algo.NiceHashName.Equals("ethereum"))
            {
                StartingUpDelay = true;

                // Check if dag-dir exist to avoid ethminer from crashing
                if (!Directory.Exists(Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName))
                {
                    Directory.CreateDirectory(Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName);
                }

                // Create DAG file ahead of time
                if (!Ethereum.CreateDAGFile(MinerDeviceName))
                {
                    return;
                }

                // Starts up ether-proxy
                if (!Ethereum.StartProxy(true, url, username))
                {
                    return;
                }

                WorkingDirectory = "";
                LastCommandLine  = " --opencl --opencl-platform " + GPUPlatformNumber +
                                   " --erase-dags old" +
                                   " " + ExtraLaunchParameters +
                                   " " + Algo.ExtraLaunchParameters +
                                   " -F http://127.0.0.1:" + Config.ConfigData.APIBindPortEthereumProxy + "/miner/10/" + MinerDeviceName +
                                   " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                                   " --opencl-devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled)
                    {
                        LastCommandLine += i + " ";
                    }
                }
            }
            else
            {
                StartingUpDelay = true;

                Path             = "sgminer.exe";
                WorkingDirectory = GetMinerDirectory(Algo.NiceHashName);

                LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
                                  " -k " + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-listen" +
                                  " --api-port=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --device ";

                foreach (ComputeDevice G in CDevs)
                {
                    if (G.Enabled)
                    {
                        LastCommandLine += G.ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (Config.ConfigData.DisableAMDTempControl == false)
                {
                    LastCommandLine += TemperatureParam;
                }

                if (Config.ConfigData.HideMiningWindows)
                {
                    LastCommandLine = " /C \"cd /d " + WorkingDirectory +
                                      " && " + Path + LastCommandLine + "\"";
                    Path = "cmd";
                }
            }

            ProcessHandle = _Start();
        }
Example #7
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                Helpers.ConsolePrint(MinerDeviceName, "GetMinerAlgorithm(" + nhalgo + "): Algo equals to null");
                return;
            }

            if (Algo.NiceHashName.Equals("daggerhashimoto"))
            {
                // Check if dag-dir exist to avoid ethminer from crashing
                if (!Ethereum.CreateDAGDirectory(MinerDeviceName))
                {
                    return;
                }

                WorkingDirectory = "";
                LastCommandLine  = " --opencl --opencl-platform " + GPUPlatformNumber +
                                   " --erase-dags old" +
                                   " " + ExtraLaunchParameters +
                                   " " + Algo.ExtraLaunchParameters +
                                   " -S " + url.Substring(14) +
                                   " -O " + username + ":" + GetPassword(Algo) +
                                   " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                                   " --report-port " + APIPort.ToString() +
                                   " --opencl-devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += i + " ";
                    }
                }
            }
            else
            {
                StartingUpDelay = true;

                Path             = "sgminer.exe";
                WorkingDirectory = GetMinerDirectory(Algo.NiceHashName);

                LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
                                  " -k " + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-listen" +
                                  " --api-port=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --device ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += CDevs[i].ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (Config.ConfigData.DisableAMDTempControl == false)
                {
                    LastCommandLine += TemperatureParam;
                }

                if (Config.ConfigData.HideMiningWindows)
                {
                    LastCommandLine = " /C \"cd /d " + WorkingDirectory +
                                      " && " + Path + LastCommandLine + "\"";
                    Path = "cmd";
                }
            }

            ProcessHandle = _Start();
        }
Example #8
0
        public override void Start(int nhalgo, string url, string username)
        {
            //if (ProcessHandle != null) return; // ignore, already running

            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null || EnabledDevicePerAlgoCount(GetAlgoIndex(Algo.NiceHashName)) < 1)
            {
                return;
            }

            if (Algo.NiceHashName.Equals("daggerhashimoto"))
            {
                LastCommandLine = " --cuda" +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " -S " + url.Substring(14) +
                                  " -O " + username + ":" + GetPassword(Algo) +
                                  " --api-port " + Config.ConfigData.ethminerAPIPortNvidia.ToString() +
                                  " --cuda-devices ";

                int dagdev = -1;
                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += i.ToString() + " ";
                        if (i == DaggerHashimotoGenerateDevice)
                        {
                            dagdev = DaggerHashimotoGenerateDevice;
                        }
                        else if (dagdev == -1)
                        {
                            dagdev = i;
                        }
                    }
                }

                LastCommandLine += " --dag-load-mode singlekeep " + dagdev.ToString();
            }
            else
            {
                LastCommandLine = "--algo=" + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-bind=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += CDevs[i].ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (Algo.NiceHashName.Equals("decred"))
                {
                    Path = "bin\\ccminer_decred.exe";
                }
                else if (Algo.NiceHashName.Equals("lyra2re") || Algo.NiceHashName.Equals("lyra2rev2"))
                {
                    Path = "bin\\ccminer_nanashi.exe";
                }
                else if (this is ccminer_sp && Algo.NiceHashName.Equals("neoscrypt"))
                {
                    Path = "bin\\ccminer_neoscrypt.exe";
                }
                else if (this is ccminer_sp)
                {
                    Path = "bin\\ccminer_sp.exe";
                }
                else
                {
                    Path = "bin\\ccminer_tpruvot.exe";
                }
            }

            ProcessHandle = _Start();
        }
Example #9
0
        public override void Start(int nhalgo, string url, string username)
        {
            //if (ProcessHandle != null) return; // ignore, already running

            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                Helpers.ConsolePrint(MinerDeviceName, "GetMinerAlgorithm(" + nhalgo + "): Algo equals to null");
                return;
            }

            if (Algo.NiceHashName.Equals("daggerhashimoto"))
            {
                WorkingDirectory = "";
                LastCommandLine  = " --opencl --opencl-platform " + GPUPlatformNumber +
                                   " " + ExtraLaunchParameters +
                                   " " + Algo.ExtraLaunchParameters +
                                   " -S " + url.Substring(14) +
                                   " -O " + username + ":" + GetPassword(Algo) +
                                   " --api-port " + Config.ConfigData.ethminerAPIPortAMD.ToString() +
                                   " --opencl-devices ";

                int dagdev = -1;
                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += i.ToString() + " ";
                        if (i == DaggerHashimotoGenerateDevice)
                        {
                            dagdev = DaggerHashimotoGenerateDevice;
                        }
                        else if (dagdev == -1)
                        {
                            dagdev = i;
                        }
                    }
                }

                LastCommandLine += " --dag-load-mode singlekeep " + dagdev.ToString();
            }
            else
            {
                StartingUpDelay = true;

                WorkingDirectory = GetMinerDirectory(Algo.NiceHashName);
                Path             = WorkingDirectory + "sgminer.exe";

                LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
                                  " -k " + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-listen" +
                                  " --api-port=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --device ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += CDevs[i].ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (Config.ConfigData.DisableAMDTempControl == false)
                {
                    LastCommandLine += TemperatureParam;
                }
            }

            ProcessHandle = _Start();
        }
Example #10
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                return;
            }

            if (Algo.NiceHashName.Equals("daggerhashimoto"))
            {
                // Check if dag-dir exist to avoid ethminer from crashing
                if (!Ethereum.CreateDAGDirectory(MinerDeviceName))
                {
                    return;
                }

                LastCommandLine = " --cuda" +
                                  " --erase-dags old" +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " -S " + url.Substring(14) +
                                  " -O " + username + ":" + GetPassword(Algo) +
                                  " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                                  " --report-port " + APIPort.ToString() +
                                  " --cuda-devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (EtherDevices[i] != -1 && CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += i + " ";
                    }
                }
            }
            else
            {
                LastCommandLine = "--algo=" + Algo.MinerName +
                                  " --url=" + url +
                                  " --userpass="******":" + GetPassword(Algo) +
                                  " --api-bind=" + APIPort.ToString() +
                                  " " + ExtraLaunchParameters +
                                  " " + Algo.ExtraLaunchParameters +
                                  " --devices ";

                for (int i = 0; i < CDevs.Count; i++)
                {
                    if (CDevs[i].Enabled && !Algo.DisabledDevice[i])
                    {
                        LastCommandLine += CDevs[i].ID.ToString() + ",";
                    }
                }

                if (LastCommandLine.EndsWith(","))
                {
                    LastCommandLine = LastCommandLine.Remove(LastCommandLine.Length - 1);
                }
                else
                {
                    LastCommandLine = "";
                    return; // no GPUs to start mining on
                }

                if (Algo.NiceHashName.Equals("decred"))
                {
                    Path = "bin\\ccminer_decred.exe";
                }
                else if (this is ccminer_sp && Algo.NiceHashName.Equals("neoscrypt"))
                {
                    Path = "bin\\ccminer_neoscrypt.exe";
                }
                else if (this is ccminer_sp && Algo.NiceHashName.Equals("lyra2rev2"))
                {
                    Path = "bin\\ccminer_sp_lyra2v2.exe";
                }
                else if (this is ccminer_sp)
                {
                    Path = "bin\\ccminer_sp.exe";
                }
                else
                {
                    Path = "bin\\ccminer_tpruvot.exe";
                }
            }

            ProcessHandle = _Start();
        }