public Config() // set defaults { isLogFile = false; minerJsonAPI = Defaults.JsonAPIPath; minerCcminerAPI = Defaults.CcminerAPIPath; web3api = Defaults.InfuraAPI_mainnet; contractAddress = Defaults.Contract0xBTC_mainnet; abiFile = Defaults.AbiFile0xBTC; overrideMaxTarget = new HexBigInteger(BigInteger.Zero); customDifficulty = 0u; submitStale = Defaults.SubmitStale; maxScanRetry = Defaults.MaxScanRetry; pauseOnFailedScans = Defaults.PauseOnFailedScan; networkUpdateInterval = Defaults.NetworkUpdateInterval; hashrateUpdateInterval = Defaults.HashrateUpdateInterval; kingAddress = string.Empty; minerAddress = string.Empty; primaryPool = string.Empty; secondaryPool = string.Empty; privateKey = string.Empty; gasToMine = Defaults.GasToMine; gasLimit = Defaults.GasLimit; cpuMode = false; cpuDevices = new Miner.Device[] { }; allowIntel = true; intelDevices = new Miner.Device[] { }; allowAMD = true; amdDevices = new Miner.Device[] { }; allowCUDA = true; cudaDevices = new Miner.Device[] { }; }
private void PrepareCpuDeviceList() { var cpuDeviceCount = Miner.CPU.GetLogicalProcessorCount(); cpuDevices = (Miner.Device[])Array.CreateInstance(typeof(Miner.Device), cpuDeviceCount); for (int i = 0; i < cpuDevices.Length; i++) { cpuDevices[i] = new Miner.Device { Type = "CPU", DeviceID = i }; } }
private void CheckCPUConfig(string[] args) { if ((cpuDevices == null || !cpuDevices.Any()) && args.All(a => !a.StartsWith("cpuID"))) { Program.Print("CPU [INFO] IDs not specified, default assign all logical CPUs except first."); var cpuCount = Miner.CPU.GetLogicalProcessorCount(); if (cpuCount <= 0) { cpuCount = 1; } cpuDevices = (Miner.Device[])Array.CreateInstance(typeof(Miner.Device), cpuCount); for (int i = 0; i < cpuCount; i++) { cpuDevices[i] = new Miner.Device { Type = "CPU", DeviceID = i, AllowDevice = (i > 0 || cpuCount.Equals(1)) }; } } }