示例#1
0
        protected override void Init()
        {
            var singleType = MinerToolkit.GetAlgorithmSingleType(_miningPairs);

            _algorithmFirstType = singleType.Item1;
            bool ok = singleType.Item2;

            if (!ok)
            {
                Logger.Info(_logGroup, "Initialization of miner failed. Algorithm not found!");
                throw new InvalidOperationException("Invalid mining initialization");
            }

            var dualType = MinerToolkit.GetAlgorithmDualType(_miningPairs);

            _algorithmSecondType = dualType.Item1;
            ok = dualType.Item2;
            if (!ok)
            {
                _algorithmSecondType = AlgorithmType.NONE;
            }
            // all good continue on

            _orderedMiningPairs = _miningPairs.ToList();
            _orderedMiningPairs.Sort((a, b) => _mappedIDs[a.Device.UUID].CompareTo(_mappedIDs[b.Device.UUID]));
            _devices = string.Join("", _orderedMiningPairs.Select(p => ClaymoreHelpers.GetClaymoreDeviceID(_mappedIDs[p.Device.UUID])));

            if (MinerOptionsPackage != null)
            {
                var ignoreDefaults    = MinerOptionsPackage.IgnoreDefaultValueOptions;
                var generalParams     = ExtraLaunchParametersParser.Parse(_orderedMiningPairs, MinerOptionsPackage.GeneralOptions, ignoreDefaults);
                var temperatureParams = ExtraLaunchParametersParser.Parse(_orderedMiningPairs, MinerOptionsPackage.TemperatureOptions, ignoreDefaults);
                _extraLaunchParameters = $"{generalParams} {temperatureParams}".Trim();
            }
        }
示例#2
0
        protected override void Init()
        {
            var dualType = MinerToolkit.GetAlgorithmDualType(_miningPairs);

            _algorithmSecondType = dualType.Item1;
            var ok = dualType.Item2;

            if (!ok)
            {
                _algorithmSecondType = AlgorithmType.NONE;
            }
            // all good continue on

            // mining pairs are ordered in InitMiningPairs
            var mappedDeviceIDs = _miningPairs.Select(p => ClaymoreHelpers.GetClaymoreDeviceID(_mappedIDs[p.Device.UUID]));

            _devices = string.Join("", mappedDeviceIDs);
        }