示例#1
0
        public override void Start(Algorithm miningAlgorithm, string url, string username)
        {
            // to set miner paths
            InitializeMinerPaths();

            CurrentMiningAlgorithm = miningAlgorithm;
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            if (CDevs.Count == 0 || !CDevs[0].Enabled)
            {
                return;
            }

            if (miningAlgorithm == null)
            {
                return;
            }

            Path = GetOptimizedMinerPath(miningAlgorithm.NiceHashID);

            LastCommandLine = "--algo=" + miningAlgorithm.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + Algorithm.PasswordDefault +
                              " --threads=" + GetThreads(miningAlgorithm.LessThreads).ToString() +
                              " " + miningAlgorithm.ExtraLaunchParameters +
                              " --api-bind=" + APIPort.ToString();

            ProcessHandle = _Start();
        }
示例#2
0
        public override void Start(Algorithm miningAlgorithm, string url, string username)
        {
            CurrentMiningAlgorithm = miningAlgorithm;
            if (miningAlgorithm == null)
            {
                Helpers.ConsolePrint(MinerTAG(), "GetMinerAlgorithm(" + miningAlgorithm.NiceHashID + "): Algo equals to null");
                return;
            }

            Path             = GetOptimizedMinerPath(miningAlgorithm.NiceHashID, CommonGpuCodenameSetting, EnableOptimizedVersion);
            WorkingDirectory = Path.Replace("sgminer.exe", "");

            LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
                              " -k " + miningAlgorithm.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + Algorithm.PasswordDefault +
                              " --api-listen" +
                              " --api-port=" + APIPort.ToString() +
                              " " +
                              ExtraLaunchParametersParser.ParseForCDevs(
                CDevs,
                CurrentMiningAlgorithm.NiceHashID,
                DeviceType.AMD) +
                              " --device ";

            LastCommandLine += GetDevicesCommandString();

            ProcessHandle = _Start();
        }
示例#3
0
        public override void Start(Algorithm miningAlgorithm, string url, string username)
        {
            CurrentMiningAlgorithm = miningAlgorithm;
            if (miningAlgorithm == null)
            {
                return;
            }

            string algo      = "";
            string apiBind   = "";
            string intensity = "";

            if (CurrentMiningAlgorithm.NiceHashID != AlgorithmType.CryptoNight)
            {
                algo      = "--algo=" + miningAlgorithm.MinerName;
                apiBind   = " --api-bind=" + APIPort.ToString();
                intensity = getIntensityString();
            }

            IsAPIReadException = CurrentMiningAlgorithm.NiceHashID == AlgorithmType.CryptoNight;

            LastCommandLine = algo +
                              " --url=" + url +
                              " --userpass="******":" + Algorithm.PasswordDefault +
                              apiBind +
                              " " + miningAlgorithm.ExtraLaunchParameters +
                              intensity +
                              " --devices ";

            LastCommandLine += GetDevicesCommandString();

            Path = GetOptimizedMinerPath(miningAlgorithm.NiceHashID);

            ProcessHandle = _Start();
        }
示例#4
0
        public override void Start(string url, string btcAdress, string worker)
        {
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTAG(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            string username = GetUsername(btcAdress, worker);

            Path             = MiningSetup.MinerPath;
            WorkingDirectory = Path.Replace("sgminer.exe", "");

            LastCommandLine = " --gpu-platform " + GPUPlatformNumber +
                              " -k " + MiningSetup.MinerName +
                              " --url=" + url +
                              " --userpass="******" -p " + Globals.PasswordDefault +
                              " --api-listen" +
                              " --api-port=" + APIPort.ToString() +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " --device ";

            LastCommandLine += GetDevicesCommandString();

            ProcessHandle = _Start();
        }
示例#5
0
        public override void Start(string url, string btcAdress, string worker)
        {
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTAG(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            string username = GetUsername(btcAdress, worker);

            string algo    = "";
            string apiBind = "";

            if (MiningSetup.CurrentAlgorithmType != AlgorithmType.CryptoNight)
            {
                algo    = "--algo=" + MiningSetup.MinerName;
                apiBind = " --api-bind=" + APIPort.ToString();
            }

            IsAPIReadException = MiningSetup.CurrentAlgorithmType == AlgorithmType.CryptoNight;

            LastCommandLine = algo +
                              " --url=" + url +
                              " --userpass="******":x " +
                              apiBind + " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.NVIDIA) +
                              " --devices ";

            LastCommandLine += GetDevicesCommandString();

            ProcessHandle = _Start();
        }
示例#6
0
        public override void Start(int nhalgo, string url, string username)
        {
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            if (CDevs.Count == 0 || !CDevs[0].Enabled)
            {
                return;
            }

            Algorithm Algo = GetMinerAlgorithm(nhalgo);

            if (Algo == null)
            {
                return;
            }

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

            ProcessHandle = _Start();
        }
示例#7
0
        public override void Start(Algorithm miningAlgorithm, string url, string btcAdress, string worker)
        {
            string username = GetUsername(btcAdress, worker);

            CurrentMiningAlgorithm = miningAlgorithm;
            if (ProcessHandle != null)
            {
                return;                        // ignore, already running
            }
            if (CDevs.Count == 0 || !CDevs[0].Enabled)
            {
                return;
            }

            if (miningAlgorithm == null)
            {
                return;
            }

            Path = GetOptimizedMinerPath(miningAlgorithm.NiceHashID);

            LastCommandLine = "--algo=" + miningAlgorithm.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + Algorithm.PasswordDefault +
                              ExtraLaunchParametersParser.ParseForCDevs(
                CDevs,
                CurrentMiningAlgorithm.NiceHashID,
                DeviceType.CPU) +
                              " --api-bind=" + APIPort.ToString();

            ProcessHandle = _Start();
        }
 protected override string GetStartCommandStringPart(Algorithm miningAlgorithm, string url, string username)
 {
     return(" --cuda"
            + " " + miningAlgorithm.ExtraLaunchParameters
            + " -S " + url.Substring(14)
            + " -O " + username + ":" + Algorithm.PasswordDefault
            + " --api-port " + APIPort.ToString()
            + " --cuda-devices ");
 }
 protected override string GetStartCommandStringPart(Algorithm miningAlgorithm, string url, string username)
 {
     // set directory
     WorkingDirectory = "";
     return(" --opencl --opencl-platform " + GPUPlatformNumber
            + " " + miningAlgorithm.ExtraLaunchParameters
            + " -S " + url.Substring(14)
            + " -O " + username + ":" + Algorithm.PasswordDefault
            + " --api-port " + APIPort.ToString()
            + " --opencl-devices ");
 }
 protected override string GetStartCommandStringPart(string url, string username) {
     return " --cuda"
         + " "
         + ExtraLaunchParametersParser.ParseForMiningSetup(
                                             MiningSetup,
                                             DeviceType.NVIDIA)
         + " -S " + url.Substring(14)
         + " -O " + username + ":" + Globals.PasswordDefault
         + " --api-port " + APIPort.ToString()
         + " --cuda-devices ";
 }
示例#11
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();
        }
示例#12
0
 protected override string GetStartCommandStringPart(string url, string username)
 {
     return(" --opencl --opencl-platform " + GPUPlatformNumber
            + " "
            + ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD)
            + " -S " + url.Substring(14)
            + " -O " + username + ":x "
            + " --api-port " + APIPort.ToString()
            + " --opencl-devices ");
 }
 protected override string GetStartCommandStringPart(string url, string username)
 {
     return(" --cuda"
            + " "
            + ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.NVIDIA)
            + " -S " + url.Substring(14)
            + " -O " + username + ":m=party.NPlusMiner "
            + " --api-port " + APIPort.ToString()
            + " --cuda-devices ");
 }
示例#14
0
 protected override string GetStartCommandStringPart(Algorithm miningAlgorithm, string url, string username)
 {
     return(" --cuda"
            + " "
            + ExtraLaunchParametersParser.ParseForCDevs(
                CDevs,
                AlgorithmType.DaggerHashimoto,
                DeviceType.NVIDIA)
            + " -S " + url.Substring(14)
            + " -O " + username + ":" + Algorithm.PasswordDefault
            + " --api-port " + APIPort.ToString()
            + " --cuda-devices ");
 }
示例#15
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();
        }
示例#16
0
 protected override string GetStartCommandStringPart(string url, string username)
 {
     // set directory
     WorkingDirectory = "";
     return(" --opencl --opencl-platform " + GPUPlatformNumber
            + " "
            + ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD)
            + " -S " + url.Substring(14)
            + " -O " + username + ":" + Globals.PasswordDefault
            + " --api-port " + APIPort.ToString()
            + " --opencl-devices ");
 }
示例#17
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("");
            }

            Path = "cmd";
            string DirName = GetMinerDirectory(Algo.NiceHashName);

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

            string username = Config.ConfigData.BitcoinAddress;

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

            string 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) + " && del dump.txt\"";

            return(CommandLine);
        }
示例#18
0
        public override void Start(string url, string btcAdress, string worker)
        {
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTAG(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            string username = GetUsername(btcAdress, worker);

            LastCommandLine = "--algo=" + MiningSetup.MinerName +
                              " --url=" + url +
                              " --userpass="******":x " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.CPU) +
                              " --api-bind=" + APIPort.ToString();

            ProcessHandle = _Start();
        }
示例#19
0
        // new decoupled benchmarking routines
        /// <summary>
        /// The BenchmarkCreateCommandLine
        /// </summary>
        /// <param name="algorithm">The <see cref="Algorithm"/></param>
        /// <param name="time">The <see cref="int"/></param>
        /// <returns>The <see cref="string"/></returns>
        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string CommandLine;

            string url = Globals.GetLocationURL(algorithm.CryptoMiner937ID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], ConectionType);

            // demo for benchmark
            string username = Globals.DemoUser;

            if (ConfigManager.GeneralConfig.WorkerName.Length > 0)
            {
                username += "." + ConfigManager.GeneralConfig.WorkerName.Trim();
            }

            // cd to the cgminer for the process bins
            CommandLine = " /C \"cd /d " + WorkingDirectory + " && gatelessgate.exe " +
                          " --gpu-platform " + GPUPlatformNumber +
                          " -k " + algorithm.MinerName +
                          " --url=" + url + "/#xnsub" +
                          " --userpass="******" -p c=BTC,Benchmark,m=party.NPlusMiner " +
                          " --sched-stop " + DateTime.Now.AddSeconds(time).ToString("HH:mm") +
                          " -T --log 10 --log-file dump.txt" +
                          " --api-listen" +
                          " --api-port=" + APIPort.ToString() +
                          " " +
                          ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                          " --device ";

            CommandLine += GetDevicesCommandString();

            CommandLine += " && del dump.txt\"";

            return(CommandLine);
        }
示例#20
0
        public override void Start(Algorithm miningAlgorithm, string url, string btcAdress, string worker)
        {
            string username = GetUsername(btcAdress, worker);

            CurrentMiningAlgorithm = miningAlgorithm;
            if (miningAlgorithm == null)
            {
                return;
            }

            string algo    = "";
            string apiBind = "";

            if (CurrentMiningAlgorithm.NiceHashID != AlgorithmType.CryptoNight)
            {
                algo    = "--algo=" + miningAlgorithm.MinerName;
                apiBind = " --api-bind=" + APIPort.ToString();
            }

            IsAPIReadException = CurrentMiningAlgorithm.NiceHashID == AlgorithmType.CryptoNight;

            LastCommandLine = algo +
                              " --url=" + url +
                              " --userpass="******":" + Algorithm.PasswordDefault +
                              apiBind + " " +
                              ExtraLaunchParametersParser.ParseForCDevs(
                CDevs,
                CurrentMiningAlgorithm.NiceHashID,
                DeviceType.NVIDIA) +
                              " --devices ";

            LastCommandLine += GetDevicesCommandString();

            Path = GetOptimizedMinerPath(miningAlgorithm.NiceHashID);

            ProcessHandle = _Start();
        }
示例#21
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();
        }
示例#22
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();
        }
示例#23
0
        /// <summary>
        /// The Start
        /// </summary>
        /// <param name="url">The <see cref="string"/></param>
        /// <param name="btcAddress">The <see cref="string"/></param>
        /// <param name="worker">The <see cref="string"/></param>
        public override void Start(string url, string btcAddress, string worker)
        {
            if (MiningSession.DONATION_SESSION)
            {
                if (url.Contains("zpool.ca"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("ahashpool.com"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("hashrefinery.com"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("nicehash.com"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("zergpool.com"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("blockmasters.co"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("blazepool.com"))
                {
                    btcAddress = Globals.DemoUser;
                    worker     = "c=BTC,ID=Donation";
                }
                if (url.Contains("miningpoolhub.com"))
                {
                    btcAddress = "cryptominer.Devfee";
                    worker     = "x";
                }
                else
                {
                    btcAddress = Globals.DemoUser;
                }
            }
            else
            {
                if (url.Contains("zpool.ca"))
                {
                    btcAddress = zPoolMiner.Globals.GetzpoolUser();
                    worker     = zPoolMiner.Globals.GetzpoolWorker();
                }
                if (url.Contains("ahashpool.com"))
                {
                    btcAddress = zPoolMiner.Globals.GetahashUser();
                    worker     = zPoolMiner.Globals.GetahashWorker();
                }
                if (url.Contains("hashrefinery.com"))
                {
                    btcAddress = zPoolMiner.Globals.GethashrefineryUser();
                    worker     = zPoolMiner.Globals.GethashrefineryWorker();
                }
                if (url.Contains("nicehash.com"))
                {
                    btcAddress = zPoolMiner.Globals.GetnicehashUser();
                    worker     = zPoolMiner.Globals.GetnicehashWorker();
                }
                if (url.Contains("zergpool.com"))
                {
                    btcAddress = zPoolMiner.Globals.GetzergUser();
                    worker     = zPoolMiner.Globals.GetzergWorker();
                }
                if (url.Contains("minemoney.co"))
                {
                    btcAddress = zPoolMiner.Globals.GetminemoneyUser();
                    worker     = zPoolMiner.Globals.GetminemoneyWorker();
                }
                if (url.Contains("blazepool.com"))
                {
                    btcAddress = zPoolMiner.Globals.GetblazepoolUser();
                    worker     = zPoolMiner.Globals.GetblazepoolWorker();
                }
                if (url.Contains("blockmasters.co"))
                {
                    btcAddress = zPoolMiner.Globals.GetblockmunchUser();
                    worker     = zPoolMiner.Globals.GetblockmunchWorker();
                }
                if (url.Contains("miningpoolhub.com"))
                {
                    btcAddress = zPoolMiner.Globals.GetMPHUser();
                    worker     = zPoolMiner.Globals.GetMPHWorker();
                }
            }
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTAG(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            string username = GetUsername(btcAddress, worker);

            LastCommandLine = "--algo=" + MiningSetup.MinerName +
                              " --url=" + url +
                              " --userpass="******":" + worker + ",m=party.NPlusMiner" +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.CPU) +
                              " --api-bind=" + APIPort.ToString();

            ProcessHandle = _Start();
        }
示例#24
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();
        }
        //protected override int GetMaxCooldownTimeInMilliseconds()
        //{
        //   return 60 * 1000 * 5; // 5 min
        //}

        protected async Task <APIData> GetSummaryCpuAsyncXMRig(string method = "", bool overrideLoop = false)
        {
            var ad = new APIData(MiningSetup.CurrentAlgorithmType);

            try
            {
                HttpWebRequest WR = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + APIPort.ToString() + "/1/summary");
                WR.UserAgent   = "GET / HTTP/1.1\r\n\r\n";
                WR.Timeout     = 30 * 1000;
                WR.Credentials = CredentialCache.DefaultCredentials;
                WebResponse Response = WR.GetResponse();
                Stream      SS       = Response.GetResponseStream();
                SS.ReadTimeout = 20 * 1000;
                StreamReader Reader  = new StreamReader(SS);
                var          respStr = await Reader.ReadToEndAsync();

                Reader.Close();
                Response.Close();
                //Helpers.ConsolePrint(MinerTag(), respStr);

                if (string.IsNullOrEmpty(respStr))
                {
                    _currentMinerReadStatus = MinerAPIReadStatus.NETWORK_EXCEPTION;
                    throw new Exception("Response is empty!");
                }

                dynamic resp = JsonConvert.DeserializeObject(respStr);

                if (resp != null)
                {
                    JArray totals = resp.hashrate.total;
                    foreach (var total in totals)
                    {
                        if (total.Value <string>() == null)
                        {
                            continue;
                        }
                        ad.Speed = total.Value <double>();
                        break;
                    }

                    if (ad.Speed == 0)
                    {
                        _currentMinerReadStatus = MinerAPIReadStatus.READ_SPEED_ZERO;
                    }
                    else
                    {
                        _currentMinerReadStatus = MinerAPIReadStatus.GOT_READ;
                    }
                }
                else
                {
                    throw new Exception($"Response does not contain speed data: {respStr.Trim()}");
                }
            }
            catch (Exception ex)
            {
                Helpers.ConsolePrint(MinerTAG(), ex.Message);
            }

            return(ad);
        }
示例#26
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();
        }
示例#27
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();
        }
示例#28
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();
        }
示例#29
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);
        }