コード例 #1
0
ファイル: ccminer.cs プロジェクト: cduncan41/NiceHashMiner
        protected override string BenchmarkCreateCommandLine(int index, int time)
        {
            string CommandLine = "";

            if (SupportedAlgorithms[index].NiceHashName.Equals("ethereum"))
            {
                CommandLine = " --benchmark-warmup 10 --benchmark-trial 20" +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                              " --cuda --cuda-devices ";

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

                CommandLine += " --benchmark ";
                if (Ethereum.GetCurrentBlock(MinerDeviceName))
                {
                    CommandLine += Ethereum.CurrentBlockNum;
                }

                // Check if dag-dir exist to avoid ethminer from crashing
                if (!Ethereum.CreateDAGDirectory(MinerDeviceName))
                {
                    return("");
                }
            }
            else
            {
                CommandLine = " --algo=" + SupportedAlgorithms[index].MinerName +
                              " --benchmark" +
                              " --time-limit " + time.ToString() +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --devices ";

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

                CommandLine = CommandLine.Remove(CommandLine.Length - 1);

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

            return(CommandLine);
        }
コード例 #2
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();
        }
コード例 #3
0
ファイル: sgminer.cs プロジェクト: cduncan41/NiceHashMiner
        protected override string BenchmarkCreateCommandLine(int index, int time)
        {
            Algorithm Algo = GetMinerAlgorithm(SupportedAlgorithms[index].NiceHashID);

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

            string CommandLine;

            if (Algo.NiceHashName.Equals("ethereum"))
            {
                CommandLine = " --opencl --opencl-platform " + GPUPlatformNumber +
                              " " + ExtraLaunchParameters +
                              " " + Algo.ExtraLaunchParameters +
                              " --benchmark-warmup 10 --benchmark-trial 20" +
                              " --dag-dir " + Config.ConfigData.DAGDirectory + "\\" + MinerDeviceName +
                              " --opencl-devices ";

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

                CommandLine += " --benchmark ";
                if (Ethereum.GetCurrentBlock(MinerDeviceName))
                {
                    CommandLine += Ethereum.CurrentBlockNum;
                }

                // Check if dag-dir exist to avoid ethminer from crashing
                if (!Ethereum.CreateDAGDirectory(MinerDeviceName))
                {
                    return("");
                }
            }
            else
            {
                Path = "cmd";
                string DirName = GetMinerDirectory(Algo.NiceHashName);

                string url = "stratum+tcp://" + Form1.NiceHashData[SupportedAlgorithms[index].NiceHashID].name + "." +
                             Form1.MiningLocation[Config.ConfigData.Location] + ".nicehash.com:" +
                             Form1.NiceHashData[SupportedAlgorithms[index].NiceHashID].port;

                string username = Config.ConfigData.BitcoinAddress.Trim();
                if (Config.ConfigData.WorkerName.Length > 0)
                {
                    username += "." + Config.ConfigData.WorkerName.Trim();
                }

                CommandLine = " /C \"cd /d " + DirName + " && sgminer.exe " +
                              " --gpu-platform " + GPUPlatformNumber +
                              " -k " + SupportedAlgorithms[index].MinerName +
                              " --url=" + url +
                              " --userpass="******":" + GetPassword(Algo) +
                              " --sched-stop " + DateTime.Now.AddMinutes(time).ToString("HH:mm") +
                              " -T --log 10 --log-file dump.txt" +
                              " --api-listen" +
                              " --api-port=" + APIPort.ToString() +
                              " --api-allow W:127.0.0.1" +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --device ";

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

                CommandLine = CommandLine.Remove(CommandLine.Length - 1);
                if (Config.ConfigData.DisableAMDTempControl == false)
                {
                    CommandLine += TemperatureParam;
                }
                CommandLine += " && del dump.txt\"";
            }

            return(CommandLine);
        }
コード例 #4
0
ファイル: ccminer.cs プロジェクト: theLosers106/NiceHashMiner
        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();
        }