Exemple #1
0
        private string CreateCommandLine(string username)
        {
            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range

            var algo = AlgorithmName(_algorithmType);

            var urlWithPort = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.NONE);
            var split       = urlWithPort.Split(':');
            var url         = split[0];
            var port        = split[1];

            var algorithmParam = $"--algo {algo}";

            if (_algorithmType == AlgorithmType.ZHash)
            {
                algorithmParam += " --pers auto";
            }

            var ret = $"{algorithmParam} --cuda_devices {_devices} --user {username} --server {url} --port {port} --pass x --api 127.0.0.1:{_apiPort} {_extraLaunchParameters}";

            if (!ret.Contains("--fee"))
            {
                ret   += " --fee 0";
                DevFee = 0.0d;
            }

            return(ret);
        }
Exemple #2
0
        private string CreateCommandLine(string username)
        {
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange();
            var url = StratumServiceHelpers.GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.STRATUM_TCP);
            var cmd = $"-a {AlgoName} -url {url} -u {username} -d {_devices} --api-bind 127.0.0.1:{_apiPort} {_extraLaunchParameters}";

            return(cmd);
        }
        private string CreateCommandLine(string username)
        {
            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range
            var url = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.NONE);
            var cmd = $"-a {AlgoName} -o {url} -u {username} --platform={_openClAmdPlatformNum} -d {_devices} --api_listen=127.0.0.1:{_apiPort} {_extraLaunchParameters}";

            return(cmd);
        }
        private string CreateCommandLine(string username)
        {
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange();
            var url = StratumServiceHelpers.GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.STRATUM_TCP);

            var devs = string.Join(",", _miningPairs.Select(p => _cudaIDMap[p.device.ID]));

            return($"-a {AlgoName} -o {url} -u {username} --api 127.0.0.1:{_apiPort} -d {devs} -RUN {_extraLaunchParameters}");
        }
Exemple #5
0
        protected override string MiningCreateCommandLine()
        {
            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range
            // instant non blocking
            var url  = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.STRATUM_TCP);
            var algo = AlgorithmName(_algorithmType);

            var commandLine = $"--algo={algo} --url={url} --user={_username} --api-bind={_apiPort} {_extraLaunchParameters}";

            return(commandLine);
        }
        protected override string MiningCreateCommandLine()
        {
            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range
            // instant non blocking
            var urlWithPort = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.STRATUM_TCP);
            var split       = urlWithPort.Split(':');
            var url         = split[1].Substring(2, split[1].Length - 2);
            var port        = split[2];

            var algo        = AlgorithmName(_algorithmType);
            var commandLine = $"-uri {algo}://{_username}@{url}:{port} -api 127.0.0.1:{_apiPort} {_devices} -watchdog=false {_extraLaunchParameters}";

            return(commandLine);
        }
        protected override string MiningCreateCommandLine()
        {
            // TODO _miningPairs must not be null or count 0
            //if (_miningPairs == null)
            //throw new NotImplementedException();

            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range
            // instant non blocking
            var url  = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.STRATUM_TCP);
            var algo = AlgorithmName(_algorithmType);

            var commandLine = $"--algo={algo} --url={url} --user={_username} --api-bind={_apiPort} --devices {_devices} {_extraLaunchParameters}";

            return(commandLine);
        }
        private string CreateCommandLine(string username)
        {
            // API port function might be blocking
            _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range

            var algo = AlgorithmName(_algorithmType);

            var urlWithPort = GetLocationUrl(_algorithmType, _miningLocation, NhmConectionType.NONE);
            var split       = urlWithPort.Split(':');
            var url         = split[0];
            var port        = split[1];

            var cmd = $"-a {algo} -s {url} -n {port} -u {username} -d {_devices} -w 0 --api {_apiPort} {_extraLaunchParameters}";

            if (_algorithmType == AlgorithmType.ZHash)
            {
                cmd += " --pers auto";
            }

            return(cmd);
        }
Exemple #9
0
        protected void ChangeToNextAvaliablePort()
        {
            // change to new port
            var oldApiPort = APIPort;
            var newApiPort = MinersApiPortsManager.GetAvaliablePort();

            // check if update last command port
            if (UpdateBindPortCommand(oldApiPort, newApiPort))
            {
                Helpers.ConsolePrint(MinerTAG(), String.Format("Changing miner port from {0} to {1}",
                                                               oldApiPort.ToString(),
                                                               newApiPort.ToString()));
                // free old set new
                MinersApiPortsManager.RemovePort(oldApiPort);
                APIPort = newApiPort;
            }
            else     // release new
            {
                MinersApiPortsManager.RemovePort(newApiPort);
            }
        }
Exemple #10
0
 private void SetAPIPort()
 {
     if (IsInit)
     {
         var minerBase     = MiningSetup.MiningPairs[0].Algorithm.MinerBaseType;
         var algoType      = MiningSetup.MiningPairs[0].Algorithm.NiceHashID;
         var path          = MiningSetup.MinerPath;
         var reservedPorts = MinersSettingsManager.GetPortsListFor(minerBase, path, algoType);
         APIPort = -1; // not set
         foreach (var reservedPort in reservedPorts)
         {
             if (MinersApiPortsManager.IsPortAvaliable(reservedPort))
             {
                 APIPort = reservedPort;
                 break;
             }
         }
         if (APIPort == -1)
         {
             APIPort = MinersApiPortsManager.GetAvaliablePort();
         }
     }
 }
Exemple #11
0
        public Miner(string minerDeviceName)
        {
            MiningSetup = new MiningSetup(null);
            IsInit      = false;
            MINER_ID    = MINER_ID_COUNT++;

            MinerDeviceName = minerDeviceName;

            //WorkingDirectory = @"bin\dlls";
            WorkingDirectory = "";

            IsRunning       = false;
            PreviousTotalMH = 0.0;

            LastCommandLine = "";

            APIPort                         = MinersApiPortsManager.GetAvaliablePort();
            IsAPIReadException              = false;
            IsNHLocked                      = false;
            IsKillAllUsedMinerProcs         = false;
            _MAX_CooldownTimeInMilliseconds = GET_MAX_CooldownTimeInMilliseconds();
            //
            Helpers.ConsolePrint(MinerTAG(), "NEW MINER CREATED");
        }
 protected override string MiningCreateCommandLine()
 {
     // API port function might be blocking
     _apiPort = MinersApiPortsManager.GetAvaliablePortInRange(); // use the default range
     return(CreateCommandLine(_username) + $" --api-listen --api-port={_apiPort}");
 }