Skip to content

Commit

Permalink
Disable GPU mining on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
seniorquico committed Oct 5, 2020
1 parent 2c271bf commit 815b9c6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
import semver from 'semver'
import { Accounts } from '../accounts'
import { STANDARD_ERRORS } from '../errors'
import { PluginDefinition } from '../plugin-definitions'
import { hasGpu } from '../requirements'
import { downloads } from '../xmrig'

export const createXMRigKawPowPluginDefinitions = (accounts: Accounts): PluginDefinition[] =>
downloads
// XMRig support for KawPow added in v6.0.0.
.filter(({ version }) => {
const sv = semver.coerce(version)
return sv !== null && semver.gte(sv, '6.0.0')
})
.reduce((definitions, download) => {
const connection = (location: string) =>
`-o stratum+tcp://kawpow.${location}.nicehash.com:3385 -a kawpow -u ${accounts.nicehash.address}.${accounts.nicehash.rigId} -k --nicehash`

if (download.macOSUrl !== undefined) {
definitions.push({
name: 'XMRig',
version: download.version,
algorithm: 'KawPow',
downloadUrl: download.macOSUrl,
exe: 'xmrig',
args: `--no-cpu --cuda --opencl --donate-level=1 ${connection('usa')} ${connection('eu')}`,
runningCheck: '(?:accepted|[1-9][0-9]*\\.\\d* H\\/s)',
initialTimeout: 600000,
initialRetries: 3,
watchdogTimeout: 900000,
errors: [...STANDARD_ERRORS],
requirements: [hasGpu('*', 3072)],
})
}

return definitions
}, [] as PluginDefinition[])
export const createXMRigKawPowPluginDefinitions = (_accounts: Accounts): PluginDefinition[] => []
// TODO: Enable GPU mining on macOS
//// downloads
//// // XMRig support for KawPow added in v6.0.0.
//// .filter(({ version }) => {
//// const sv = semver.coerce(version)
//// return sv !== null && semver.gte(sv, '6.0.0')
//// })
//// .reduce((definitions, download) => {
//// const connection = (location: string) =>
//// `-o stratum+tcp://kawpow.${location}.nicehash.com:3385 -a kawpow -u ${accounts.nicehash.address}.${accounts.nicehash.rigId} -k --nicehash`
////
//// if (download.macOSUrl !== undefined) {
//// definitions.push({
//// name: 'XMRig',
//// version: download.version,
//// algorithm: 'KawPow',
//// downloadUrl: download.macOSUrl,
//// exe: 'xmrig',
//// args: `--no-cpu --cuda --opencl --donate-level=1 ${connection('usa')} ${connection('eu')}`,
//// runningCheck: '(?:accepted|[1-9][0-9]*\\.\\d* H\\/s)',
//// initialTimeout: 600000,
//// initialRetries: 3,
//// watchdogTimeout: 900000,
//// errors: [...STANDARD_ERRORS],
//// requirements: [hasGpu('*', 3072)],
//// })
//// }
////
//// return definitions
//// }, [] as PluginDefinition[])
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Accounts } from '../accounts'
import { STANDARD_ERRORS } from '../errors'
import { PluginDefinition } from '../plugin-definitions'
import { hasCpu, hasGpu, not } from '../requirements'
import { hasCpu } from '../requirements'
import { downloads } from '../xmrig'

export const createXMRigRandomXPluginDefinitions = (accounts: Accounts): PluginDefinition[] =>
Expand All @@ -10,20 +10,21 @@ export const createXMRigRandomXPluginDefinitions = (accounts: Accounts): PluginD
`-o stratum+tcp://randomxmonero.${location}.nicehash.com:3380 --coin=monero -u ${accounts.nicehash.address}.${accounts.nicehash.rigId} -k --nicehash`

if (download.macOSUrl !== undefined) {
definitions.push({
name: 'XMRig',
version: download.version,
algorithm: 'RandomX',
downloadUrl: download.macOSUrl,
exe: 'xmrig',
args: `--no-cpu --cuda --opencl --donate-level=1 ${connection('usa')} ${connection('eu')}`,
runningCheck: '(?:accepted|[1-9][0-9]*\\.\\d* H\\/s)',
initialTimeout: 600000,
initialRetries: 3,
watchdogTimeout: 900000,
errors: [...STANDARD_ERRORS],
requirements: [not(hasGpu('*', 4096)), hasGpu('*', 2048)],
})
// TODO: Enable GPU mining on macOS
//// definitions.push({
//// name: 'XMRig',
//// version: download.version,
//// algorithm: 'RandomX',
//// downloadUrl: download.macOSUrl,
//// exe: 'xmrig',
//// args: `--no-cpu --cuda --opencl --donate-level=1 ${connection('usa')} ${connection('eu')}`,
//// runningCheck: '(?:accepted|[1-9][0-9]*\\.\\d* H\\/s)',
//// initialTimeout: 600000,
//// initialRetries: 3,
//// watchdogTimeout: 900000,
//// errors: [...STANDARD_ERRORS],
//// requirements: [not(hasGpu('*', 4096)), hasGpu('*', 2048)],
//// })

definitions.push({
name: 'XMRig-CPU',
Expand Down

0 comments on commit 815b9c6

Please sign in to comment.