GetCurrentBlock() 공개 정적인 메소드

public static GetCurrentBlock ( string worker ) : void
worker string
리턴 void
예제 #1
0
        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
        protected override string BenchmarkCreateCommandLine(int index, int time)
        {
            string CommandLine = "";

            if (SupportedAlgorithms[index].NiceHashName.Equals("daggerhashimoto"))
            {
                CommandLine = " --benchmark-warmup 40 --benchmark-trial 20" +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --cuda --cuda-devices ";

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

                CommandLine += " --dag-load-mode single " + dagdev.ToString();

                Ethereum.GetCurrentBlock(MinerDeviceName);
                CommandLine += " --benchmark " + Ethereum.CurrentBlockNum;
            }
            else
            {
                CommandLine = " --algo=" + SupportedAlgorithms[index].MinerName +
                              " --benchmark" +
                              " --time-limit " + time.ToString() +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --devices ";

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

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

                if (SupportedAlgorithms[index].NiceHashName.Equals("decred"))
                {
                    Path = "bin\\ccminer_decred.exe";
                }
                else if (SupportedAlgorithms[index].NiceHashName.Equals("lyra2re") || SupportedAlgorithms[index].NiceHashName.Equals("lyra2rev2"))
                {
                    Path = "bin\\ccminer_nanashi.exe";
                }
                else 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";
                }
                else
                {
                    Path = "bin\\ccminer_tpruvot.exe";
                }
            }

            return(CommandLine);
        }
예제 #3
0
        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
        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("daggerhashimoto"))
            {
                CommandLine = " --opencl --opencl-platform " + GPUPlatformNumber +
                              " " + ExtraLaunchParameters +
                              " " + Algo.ExtraLaunchParameters +
                              " --benchmark-warmup 40 --benchmark-trial 20" +
                              " --opencl-devices ";

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

                CommandLine += " --dag-load-mode single " + dagdev.ToString();

                Ethereum.GetCurrentBlock(MinerDeviceName);
                CommandLine += " --benchmark " + Ethereum.CurrentBlockNum;
            }
            else
            {
                Path = "cmd";
                string DirName = GetMinerDirectory(Algo.NiceHashName);

                string url = "stratum+tcp://" + Globals.NiceHashData[SupportedAlgorithms[index].NiceHashID].name + "." +
                             Globals.MiningLocation[Config.ConfigData.ServiceLocation] + ".nicehash.com:" +
                             Globals.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" +
                              " " + ExtraLaunchParameters +
                              " " + SupportedAlgorithms[index].ExtraLaunchParameters +
                              " --device ";

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

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

            return(CommandLine);
        }