示例#1
0
 protected override void prepareConfigFile(string pool, string wallet)
 {
     try {
         var config     = new XmrStakAMDConfig(pool, wallet, ApiPort);
         var gpuConfigs = new List <XmrStakGPUSettings>();
         foreach (var pair in MiningSetup.MiningPairs)
         {
             var intensities = ExtraLaunchParametersParser.GetIntensityStak(pair);
             if (intensities.Count <= 0)
             {
                 intensities.Add(1000);
             }
             gpuConfigs.AddRange(intensities.Select(intensity =>
                                                    new XmrStakGPUSettings(pair.Device.ID, intensity)));
         }
         config.Initialize_gpu_threads_conf(gpuConfigs);
         var serializer = new JsonSerializer();
         serializer.TypeNameHandling = TypeNameHandling.All;
         var confJson = JObject.FromObject(config);
         var writeStr = confJson.ToString();
         var start    = writeStr.IndexOf("{");
         int end      = writeStr.LastIndexOf("}");
         writeStr = writeStr.Substring(start + 1, end - 1);
         System.IO.File.WriteAllText(WorkingDirectory + GetConfigFileName(), writeStr);
     } catch { }
 }
示例#2
0
        public override void Start(string url, string btcAdress, string worker)
        {
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTag(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            var username = GetUsername(btcAdress, worker);

            IsApiReadException = MiningSetup.MinerPath == MinerPaths.Data.CcminerCryptonight;

            var algo    = "";
            var apiBind = "";

            if (!IsApiReadException)
            {
                algo    = "--algo=" + MiningSetup.MinerName;
                apiBind = " --api-bind=" + ApiPort;
            }

            LastCommandLine = $"{algo} --url={url} --userpass={username}:x {apiBind} " +
                              $"--devices {GetDevicesCommandString()} " +
                              $"{ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.NVIDIA)} ";

            ProcessHandle = _Start();
        }
示例#3
0
        private string GetStartBenchmarkCommand(string url, string btcAdress, string worker)
        {
            var username  = GetUsername(Globals.GetBitcoinUser(), worker);
            var username2 = GetUsername(btcAdress, worker);
            var platform  = "";

            foreach (var pair in MiningSetup.MiningPairs)
            {
                if (pair.Device.DeviceType == DeviceType.NVIDIA)
                {
                    platform = " -nvidia ";
                }
                else
                {
                    platform = " -amd ";
                }
            }

            if (File.Exists("bin_3rdparty\\phoenix\\epools.txt"))
            {
                File.Delete("bin_3rdparty\\phoenix\\epools.txt");
            }

            Thread.Sleep(200);

            return(" -gpus " + GetDevicesCommandString() + platform + "-retrydelay 10"
                   + $" -pool {url} -wal {username2} -cdmport  127.0.0.1:{ApiPort} -pass x " +
                   ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.AMD));
        }
示例#4
0
        // new decoupled benchmarking routines

        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            var url = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation],
                                             ConectionType);

            // demo for benchmark
            var username = Globals.GetBitcoinUser();

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

            // cd to the cgminer for the process bins
            var commandLine = " /C \"cd /d " + WorkingDirectory + " && sgminer.exe " +
                              " --gpu-platform " + _gpuPlatformNumber +
                              " -k " + algorithm.MinerName +
                              " --url=stratum+tcp://x16r.eu.mine.zpool.ca:3636" + " --userpass=1JqFnUR3nDFCbNUmWiQ4jX6HRugGzX55L2 -p c=BTC " +
                              " --url=" + url + "/#xnsub" +
                              " --userpass="******" -p x " +
                              " --sched-stop " + DateTime.Now.AddSeconds(time).ToString("HH:mm") +
                              " -T --log 10 --log-file " + GetLogFileName() + " --gpu-threads 2" +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " --device ";

            commandLine += GetDevicesCommandString();

            commandLine += " && del " + GetLogFileName() + "\"";

            return(commandLine);
        }
示例#5
0
        public override void Start(Algorithm miningAlgorithm, string url, string username)
        {
            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();
        }
示例#6
0
        protected override string GetDevicesCommandString()
        {
            int amdDeviceCount = ComputeDeviceManager.Query.amdGpus.Count;

            Helpers.ConsolePrint("ClaymoreDualIndexing", String.Format("Found {0} AMD devices", amdDeviceCount));
            string        extraParams         = ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.AMD);
            string        deviceStringCommand = " -di ";
            List <string> ids = new List <string>();

            foreach (var mPair in MiningSetup.MiningPairs)
            {
                var id = mPair.Device.ID;
                if (this is ClaymoreDual && mPair.Device.DeviceType == DeviceType.AMD)
                {
                    id = mPair.Device.IDByBus;
                    if (id < 0)
                    {
                        // should never happen
                        Helpers.ConsolePrint("ClaymroeDualIndexing", "ID by Bus too low: " + id.ToString());
                    }
                }
                if (mPair.Device.DeviceType == DeviceType.NVIDIA)
                {
                    Helpers.ConsolePrint("ClaymoreDualIndexing", "NVIDIA device increasing index by " + amdDeviceCount.ToString());
                    id += amdDeviceCount;
                }
                ids.Add(id.ToString());
            }
            deviceStringCommand += StringHelper.Join("", ids);

            return(deviceStringCommand + extraParams);
        }
示例#7
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();
        }
        // new decoupled benchmarking routines

        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string url      = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);
            string alg      = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port     = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);
            var    username = GetUsername(Globals.DemoUser, ConfigManager.GeneralConfig.WorkerName.Trim());
            var    apiBind  = " --api-bind 127.0.0.1:" + ApiPort;
            var    algo     = "--algo " + MiningSetup.MinerName;

            var commandLine = algo +
                              " -o " + url + " -u " + username + " -p x " +
                              " --url=stratum+tcp://" + alg + ".hk.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                              " -o " + alg + ".jp.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                              " -o " + alg + ".in.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                              " -o " + alg + ".br.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                              " -o " + alg + ".usa.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                              " -o " + alg + ".eu.nicehash.com:" + port + " -u " + username + " -p x " +
                              " -o " + url + " -u " + username + " -p x --log " + GetLogFileName() +
                              apiBind +
                              " -d " + GetDevicesCommandString() + " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.NVIDIA) + " ";

            TotalCount = 2;

            Total = 0.0d;

            return(commandLine);
        }
示例#9
0
        private void prepareConfigFile(string pool, string wallet)
        {
            if (this.MiningSetup.MiningPairs.Count > 0)
            {
                try {
                    bool IsHyperThreadingEnabled = this.MiningSetup.MiningPairs[0].CurrentExtraLaunchParameters.Contains("enable_ht=true");
                    int  numTr = ExtraLaunchParametersParser.GetThreadsNumber(this.MiningSetup.MiningPairs[0]);
                    if (IsHyperThreadingEnabled)
                    {
                        numTr /= 2;
                    }
                    var config = new XmrStackCPUMinerConfig(numTr, pool, wallet, this.APIPort);

                    //config.Inti_cpu_threads_conf(false, false, true, ComputeDeviceManager.Avaliable.IsHyperThreadingEnabled);
                    config.Inti_cpu_threads_conf(false, false, false, IsHyperThreadingEnabled);
                    var    confJson = JObject.FromObject(config);
                    string writeStr = confJson.ToString();
                    int    start    = writeStr.IndexOf("{");
                    int    end      = writeStr.LastIndexOf("}");
                    writeStr = writeStr.Substring(start + 1, end - 1);
                    System.IO.File.WriteAllText(WorkingDirectory + GetConfigFileName(), writeStr);
                } catch {
                }
            }
        }
示例#10
0
        // new decoupled benchmarking routines

        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string url      = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);
            string alg      = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port     = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);
            var    username = GetUsername(Globals.DemoUser, ConfigManager.GeneralConfig.WorkerName.Trim());

            var timeLimit   = (_benchmarkException) ? "" : " --time-limit 300";
            var commandLine = " --algo=" + algorithm.MinerName +
                              " --url=" + url + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".hk.nicehash.com:" + port + " " + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".jp.nicehash.com:" + port + " " + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".in.nicehash.com:" + port + " " + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".br.nicehash.com:" + port + " " + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".usa.nicehash.com:" + port + " " + " --userpass="******":x" +
                              " --url=stratum+tcp://" + alg + ".eu.nicehash.com:" + port + " --userpass="******":x" +
                              " --url=" + url + " --userpass="******":x" +
                              timeLimit + " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.NVIDIA) +
                              " --devices ";

            commandLine += GetDevicesCommandString();

            TotalCount = 3;

            Total = 0.0d;

            return(commandLine);
        }
示例#11
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();
        }
示例#12
0
        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string username = Globals.DemoUser;
            string url      = Globals.GetLocationUrl(AlgorithmType.Lyra2z, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], NhmConectionType.STRATUM_TCP);

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

            foreach (ProcessorFeature feature in System.Enum.GetValues(typeof(ProcessorFeature)))
            {
                Helpers.ConsolePrint("CPU features", feature.ToString() + "\t: " + IsProcessorFeaturePresent(feature));
            }

            LastCommandLine = "--algo=" + algorithm.MinerName +
                              " --url=stratum+tcp://lyra2z.eu.mine.zpool.ca:4553 -u 1JqFnUR3nDFCbNUmWiQ4jX6HRugGzX55L2 -p c=BTC" +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.CPU) +
                              " --time-limit 300";

            /*
             * return "--algo=" + algorithm.MinerName +
             *     " --benchmark" +
             *     ExtraLaunchParametersParser.ParseForMiningSetup(
             *         MiningSetup,
             *         DeviceType.CPU) +
             *     " --time-limit " + time;
             */
            return(LastCommandLine);
        }
示例#13
0
        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string configfilename = GetLogFileName();
            string url            = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);
            string alg            = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port           = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);
            var    username       = GetUsername(Globals.DemoUser, ConfigManager.GeneralConfig.WorkerName.Trim());

            var commandLine = " -a " + algorithm.MinerName.ToLower() +
                              " -o " + url + " -u " + username + " -p x " +

                              /*
                               * " -o stratum+tcp://" + alg + ".hk.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                               * " -o stratum+tcp://" + alg + ".jp.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                               * " -o stratum+tcp://" + alg + ".in.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                               * " -o stratum+tcp://" + alg + ".br.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                               * " -o stratum+tcp://" + alg + ".usa.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                               * " -o stratum+tcp://" + alg + ".eu.nicehash.com:" + port + " -u " + username + " -p x " +
                               */
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.NVIDIA) + " -l " + GetLogFileName() +
                              " -d ";

            commandLine += GetDevicesCommandString();

            return(commandLine);
        }
示例#14
0
        // TODO fix extra paramteter parsing
        protected override string GetDevicesCommandString()
        {
            string deviceStringCommand = " ";

            if (CPUs.Count > 0)
            {
                deviceStringCommand += "-p " + CPUs.Count;
                if (CPUs[0].MostProfitableAlgorithm.LessThreads > 0 || !string.IsNullOrEmpty(CPUs[0].MostProfitableAlgorithm.ExtraLaunchParameters))
                {
                    deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForCDevs(CPUs, AlgorithmType.Equihash, DeviceType.CPU, Path);
                }
            }
            else
            {
                // disable CPU
                deviceStringCommand += " -t 0 ";
            }

            if (NVIDIAs.Count > 0)
            {
                deviceStringCommand += " -cd ";
                foreach (var nvidia in NVIDIAs)
                {
                    deviceStringCommand += nvidia.ID + " ";
                }
                deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForCDevs(NVIDIAs, AlgorithmType.Equihash, DeviceType.NVIDIA, Path);
            }

            return(deviceStringCommand);
        }
示例#15
0
        protected override string GetDevicesCommandString()
        {
            string deviceStringCommand = " ";

            if (CPU_Setup.IsInit)
            {
                deviceStringCommand += "-p " + CPU_Setup.MiningPairs.Count;
                deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForMiningSetup(CPU_Setup, DeviceType.CPU);
            }
            else
            {
                // disable CPU
                deviceStringCommand += " -t 0 ";
            }

            if (NVIDIA_Setup.IsInit)
            {
                deviceStringCommand += " -cd ";
                foreach (var nvidia_pair in NVIDIA_Setup.MiningPairs)
                {
                    for (int i = 0; i < ExtraLaunchParametersParser.GetEqmCudaThreadCount(nvidia_pair); ++i)
                    {
                        deviceStringCommand += nvidia_pair.Device.ID + " ";
                    }
                }
                // no extra launch params
                deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForMiningSetup(NVIDIA_Setup, DeviceType.NVIDIA);
            }

            return(deviceStringCommand);
        }
示例#16
0
        // new decoupled benchmarking routines
        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            var CommandLine = "";

            string url  = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);
            string port = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);
            // demo for benchmark
            string username = Globals.GetBitcoinUser();

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

            CommandLine = "--coin BEAM " +
                          " --pool beam-eu.sparkpool.com;beam-asia.sparkpool.com;beam.eu.nicehash.com;beam.hk.nicehash.com" +
                          " --port 2222;12222;3370;3370" +
                          " --user 2c20485d95e81037ec2d0312b000b922f444c650496d600d64b256bdafa362bafc9." + worker + ";2c20485d95e81037ec2d0312b000b922f444c650496d600d64b256bdafa362bafc9." + worker + ";" + username + ";" + username +
                          " --pass x;x;x;x --tls 1;1;0;0 " +
                          ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                          " --devices ";

            CommandLine += GetDevicesCommandString(); //amd карты перечисляются первыми

            return(CommandLine);
        }
示例#17
0
        // new decoupled benchmarking routines

        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            var url = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation],
                                             ConectionType);

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

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

            // cd to the cgminer for the process bins
            var commandLine = " /C \"cd /d " + WorkingDirectory + " && sgminer.exe " +
                              " --gpu-platform " + _gpuPlatformNumber +
                              " -k " + algorithm.MinerName +
                              " --url=" + url +
                              " --userpass="******" -p x " +
                              " --sched-stop " + DateTime.Now.AddSeconds(time).ToString("HH:mm") +
                              " -T --log 10 --log-file dump.txt" +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " --device ";

            commandLine += GetDevicesCommandString();

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

            return(commandLine);
        }
示例#18
0
        // new decoupled benchmarking routines
        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            var CommandLine = "";

            string url  = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);
            string port = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);
            // demo for benchmark
            string username = Globals.GetBitcoinUser();

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

            CommandLine = "--coin AUTO144_5 --overwritePersonal BgoldPoW" +
                          " --pool europe.equihash-hub.miningpoolhub.com --port 20595 --user angelbbs.lol --pass x" +
                          ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                          " --devices ";

            CommandLine += GetDevicesCommandString(); //amd карты перечисляются первыми

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

            LastCommandLine = " --gpu-platform " + _gpuPlatformNumber +
                              " -k " + MiningSetup.MinerName +
                              " --url=" + url +
                              " --userpass="******" -p x " +
                              " --api-listen" +
                              " --api-port=" + ApiPort +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " --device ";

            LastCommandLine += GetDevicesCommandString();

            ProcessHandle = _Start();
        }
示例#20
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();
        }
        public override void Start(string url, string btcAdress, string worker)
        {
            if (!IsInit)
            {
                Helpers.ConsolePrint(MinerTag(), "MiningSetup is not initialized exiting Start()");
                return;
            }
            var username = GetUsername(btcAdress, worker);

            IsApiReadException = MiningSetup.MinerPath == MinerPaths.Data.CryptoDredge;

            var    algo    = "";
            var    apiBind = "";
            string alg     = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port    = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);

            algo    = "--algo " + MiningSetup.MinerName;
            apiBind = " --api-bind 127.0.0.1:" + ApiPort;

            IsApiReadException = false;
            LastCommandLine    = algo +
                                 " -o " + url + " -u " + username + " -p x " +
                                 " --url=stratum+tcp://" + alg + ".hk.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                                 " -o " + alg + ".jp.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                                 " -o " + alg + ".in.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                                 " -o " + alg + ".br.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                                 " -o " + alg + ".usa.nicehash.com:" + port + " " + " -u " + username + " -p x " +
                                 " -o " + alg + ".eu.nicehash.com:" + port + " -u " + username + " -p x " +
                                 " -o " + url + " -u " + username + " -p x --log " + GetLogFileName() +
                                 apiBind +
                                 " -d " + GetDevicesCommandString() + " " +
                                 ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.NVIDIA) + " ";
            ProcessHandle = _Start();
        }
示例#22
0
        private string GetStartCommand(string url, string btcAdress, string worker)
        {
            var extras = ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.AMD);
            var algo   = "";
            var port   = "";

            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.Skunk))
            {
                algo = "skunkhash";
                port = "3362";
            }
            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.X16R))
            {
                algo = "x16r";
                port = "3366";
            }
            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.Lyra2REv3))
            {
                algo = "lyra2v3";
                port = "3373";
            }
            return($" -a {algo} -o {url} -u {btcAdress}.{worker}:x {extras} --api-port {ApiPort} "
                   + $" -o stratum+tcp://{algo}.usa.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                   + $" -o stratum+tcp://{algo}.hk.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                   + $" -o stratum+tcp://{algo}.jp.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                   + $" -o stratum+tcp://{algo}.in.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                   + " --opencl-devices=" + GetDevicesCommandString().TrimStart());
        }
示例#23
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);

            //IsApiReadException = MiningSetup.MinerPath == MinerPaths.Data.lolMiner;
            IsApiReadException = false;

            //add failover
            string alg  = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);

            //var algo = "";
            url = url.Replace("stratum+tcp://", "");
            var apiBind = " --apiport " + ApiPort;

            LastCommandLine = "--coin AUTO144_5 --overwritePersonal BgoldPoW --pool " + url +
                              " --port " + port +
                              " --user " + username +
                              " -p x " + apiBind +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " --devices ";

            LastCommandLine += GetDevicesCommandString();//amd карты перечисляются первыми
            ProcessHandle    = _Start();
        }
示例#24
0
        private string GetStartBenchmarkCommand(string url, string btcAdress, string worker)
        {
            var extras = ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.AMD);
            var algo   = "";
            var port   = "";

            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.Skunk))
            {
                algo = "skunkhash";
                port = "3362";
                return($" -a {algo} -o stratum+tcp://skunk.eu.mine.zpool.ca:8433 -u 1JqFnUR3nDFCbNUmWiQ4jX6HRugGzX55L2 -p c=BTC {extras} --api-port {ApiPort} "
                       + $" -o stratum+tcp://{algo}.eu.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                       + " --multiple-instance --opencl-devices=" + GetDevicesCommandString().TrimStart());
            }
            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.X16R))
            {
                algo = "x16r";
                port = "3366";
                return($" -a {algo} -o stratum+tcp://x16r.eu.mine.zpool.ca:3636 -u 1JqFnUR3nDFCbNUmWiQ4jX6HRugGzX55L2 -p c=BTC {extras} --api-port {ApiPort} "
                       + $" -o stratum+tcp://{algo}.eu.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                       + " --multiple-instance --opencl-devices=" + GetDevicesCommandString().TrimStart());
            }
            if (MiningSetup.CurrentAlgorithmType.Equals(AlgorithmType.Lyra2REv3))
            {
                algo = "lyra2rev3";
                port = "3366";
                return($" -a lyra2v3 -o stratum+tcp://lyra2v3.eu.mine.zpool.ca:4550 -u 1JqFnUR3nDFCbNUmWiQ4jX6HRugGzX55L2 -p c=BTC {extras} --api-port {ApiPort} "
                       + $" -o stratum+tcp://{algo}.eu.nicehash.com:{port} -u {btcAdress}.{worker}:x "
                       + " --multiple-instance --opencl-devices=" + GetDevicesCommandString().TrimStart());
            }
            return("oops... strange algo");
        }
示例#25
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();
        }
        // new decoupled benchmarking routines
        #region Decoupled benchmarking routines

        protected override string BenchmarkCreateCommandLine(Algorithm algorithm, int time)
        {
            string CommandLine;

            string url = Globals.GetLocationUrl(algorithm.NiceHashID, Globals.MiningLocation[ConfigManager.GeneralConfig.ServiceLocation], this.ConectionType);

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

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

            CommandLine = " -a lyra2z " +
                          " --url " + url +
                          " --user " + username +
                          " -p x " +
                          ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                          " -d ";

            CommandLine += GetDevicesCommandString();

            return(CommandLine);
        }
示例#27
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);

            IsApiReadException = true; //** in miner
            //add failover
            string alg  = url.Substring(url.IndexOf("://") + 3, url.IndexOf(".") - url.IndexOf("://") - 3);
            string port = url.Substring(url.IndexOf(".com:") + 5, url.Length - url.IndexOf(".com:") - 5);

            LastCommandLine = " --asm --algorithm lyra2z -o " + url +
                              " -u " + username +
                              " -p x " +
                              " " +
                              ExtraLaunchParametersParser.ParseForMiningSetup(
                MiningSetup,
                DeviceType.AMD) +
                              " -d ";

            LastCommandLine += GetDevicesCommandString();
            ProcessHandle    = _Start();
        }
        protected override string GetDevicesCommandString()
        {
            var deviceStringCommand = " ";

            if (CpuSetup.IsInit)
            {
                deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForMiningSetup(CpuSetup, DeviceType.CPU);
            }
            else
            {
                // disable CPU
                deviceStringCommand += " -t 0 ";
            }

            if (NvidiaSetup.IsInit)
            {
                deviceStringCommand += " -cd ";
                deviceStringCommand  = NvidiaSetup.MiningPairs.Aggregate(deviceStringCommand,
                                                                         (current, nvidiaPair) => current + (nvidiaPair.Device.ID + " "));
                deviceStringCommand +=
                    " " + ExtraLaunchParametersParser.ParseForMiningSetup(NvidiaSetup, DeviceType.NVIDIA);
            }

            if (AmdSetup.IsInit)
            {
                deviceStringCommand += " -op " + AmdOclPlatform.ToString();
                deviceStringCommand += " -od ";
                deviceStringCommand  = AmdSetup.MiningPairs.Aggregate(deviceStringCommand,
                                                                      (current, amdPair) => current + (amdPair.Device.ID + " "));
                deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForMiningSetup(AmdSetup, DeviceType.AMD);
            }

            return(deviceStringCommand);
        }
 protected override string GetBenchmarkCommandStringPart(Algorithm algorithm) {
     return " --benchmark-warmup 40 --benchmark-trial 20"
         + " "
         + ExtraLaunchParametersParser.ParseForMiningSetup(
                                             MiningSetup,
                                             DeviceType.NVIDIA)
         + " --cuda --cuda-devices ";
 }
示例#30
0
        protected override string GetDevicesCommandString()
        {
            var deviceStringCommand = MiningSetup.MiningPairs.Aggregate(" --cuda_devices ", (current, nvidiaPair) => current + (nvidiaPair.Device.ID + " "));

            deviceStringCommand += " " + ExtraLaunchParametersParser.ParseForMiningSetup(MiningSetup, DeviceType.NVIDIA);

            return(deviceStringCommand);
        }