Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
MaynardMiner committed Jul 25, 2019
2 parents 82b849b + a7cc30a commit fa144fe
Show file tree
Hide file tree
Showing 20 changed files with 290 additions and 102 deletions.
29 changes: 29 additions & 0 deletions build/api/miners/nanominer.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function Global:Get-StatsNanominer {
$Request = Global:Get-HTTP -Server $global:Server -Port $global:Port -Message "/stat" -Timeout 5
if ($Request) {
try { $Data = $Request.Content | ConvertFrom-Json -ErrorAction Stop }
Catch { Write-Host "Failed To parse API" -ForegroundColor Red; Break }
if ($Data) {
$Data = $Data.Statistics
switch ($global:MinerAlgo) {
"ethash" { $Data.Devices | % { $global:RAW += [Double]$_.hashrates.hashrate * 1000000 } }
default { $Data.Devices | % { $global:RAW += [Double]$_.hashrates.hashrate } }
}
Global:Write-MinerData2;
try {
for ($global:i = 0; $global:i -lt $Devices.Count; $global:i++) {
$Hash = $($Data.Devices[$global:i]).hashrates.hashrate
switch ($global:MinerAlgo) {
"ethash" { $global:GPUHashrates.$(Global:Get-GPUs) = $Hash * 1000 }
default { $global:GPUHashrates.$(Global:Get-GPUs) = $Hash / 1000 }
}
}
}
catch { Write-Host "Failed To parse Threads" -ForegroundColor Red };
$Data.Devices | % { $global:MinerACC += [Double]$_.hashrates.gpuAccepted; $global:ALLACC += [Double]$_.hashrates.gpuAccepted }
$Data.Devices | % { $global:MinerREJ += [Double]$_.hashrates.gpuDenied; $global:ALLREJ += [Double]$_.hashrates.gpuDenied }
$Data.devices.speed | ForEach-Object { $global:GPUKHS += [Double]$_.hashrates.hashrate / 1000 }
}
}
else { Global:Set-APIFailure }
}
117 changes: 64 additions & 53 deletions build/powershell/control/config.psm1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Global:set-minerconfig($ConfigMiner,$Logs) {
function Global:set-minerconfig($ConfigMiner, $Logs) {

$ConfigPathDir = Split-Path $ConfigMiner.Path
if ($ConfigMiner.Devices -ne "none") {$MinerDevices = Global:Get-DeviceString -TypeDevices $ConfigMiner.Devices}
if ($ConfigMiner.Devices -ne "none") { $MinerDevices = Global:Get-DeviceString -TypeDevices $ConfigMiner.Devices }
else {
$(vars).GCount = Get-Content ".\build\txt\devicelist.txt" | ConvertFrom-Json
if($ConfigMiner.Type -like "*NVIDIA*"){$TypeS = "NVIDIA"}
if($ConfigMiner.Type -like "*AMD*"){$TypeS = "AMD"}
if ($ConfigMiner.Type -like "*NVIDIA*") { $TypeS = "NVIDIA" }
if ($ConfigMiner.Type -like "*AMD*") { $TypeS = "AMD" }
$MinerDevices = Global:Get-DeviceString -TypeCount $($(vars).GCount.$TypeS.PSObject.Properties.Value.Count)
}
$ConfigFile = @()
Expand Down Expand Up @@ -61,58 +61,69 @@ function Global:set-minerconfig($ConfigMiner,$Logs) {
}
}
}
"cuckatoo31"
{
$NDevices = Get-Content ".\build\txt\gpucount.txt"
$NDevices = $NDevices | Select-String "VGA", "3D"
$NDevices = $NDevices | Where {$_ -like "*NVIDIA*" -and $_ -notlike "*nForce*"}
$MinerDevices | % {
$Current = $NDevices | Select -skip $($_) -First 1
if($Current -Like "*GTX*")
{
$ConfigFile += "[[mining.miner_plugin_config]]"
$ConfigFile += "plugin_name = `"cuckatoo_mean_cuda_gtx_31`""
$ConfigFile += "[mining.miner_plugin_config.parameters]"
$ConfigFile += "device = $($_)"
$ConfigFile += "expand = 3"
$ConfigFile += "cpuload = 1"
$ConfigFile += "ntrims = 176"
$ConfigFile += "genablocks = 4096"
$ConfigFile += "genatpb = 128"
$ConfigFile += "genbtpb = 128"
$ConfigFile += "trimtpb = 512"
$ConfigFile += "tailtpb = 1024"
$ConfigFile += "recoverblocks = 1024"
$ConfigFile += "recovertpb = 1024"
$ConfigFile += ""
}
if($Current -Like "*RTX*")
{
$ConfigFile += "[[mining.miner_plugin_config]]"
$ConfigFile += "plugin_name = `"cuckatoo_mean_cuda_rtx_31`""
$ConfigFile += "[mining.miner_plugin_config.parameters]"
$ConfigFile += "device = $($_)"
$ConfigFile += "expand = 3"
$ConfigFile += "cpuload = 1"
$ConfigFile += "ntrims = 176"
$ConfigFile += "genablocks = 4096"
$ConfigFile += "genatpb = 128"
$ConfigFile += "genbtpb = 128"
$ConfigFile += "trimtpb = 512"
$ConfigFile += "tailtpb = 1024"
$ConfigFile += "recoverblocks = 1024"
$ConfigFile += "recovertpb = 1024"
$ConfigFile += ""
}
"cuckatoo31" {
$NDevices = Get-Content ".\build\txt\gpucount.txt"
$NDevices = $NDevices | Select-String "VGA", "3D"
$NDevices = $NDevices | Where { $_ -like "*NVIDIA*" -and $_ -notlike "*nForce*" }
$MinerDevices | % {
$Current = $NDevices | Select -skip $($_) -First 1
if ($Current -Like "*GTX*") {
$ConfigFile += "[[mining.miner_plugin_config]]"
$ConfigFile += "plugin_name = `"cuckatoo_mean_cuda_gtx_31`""
$ConfigFile += "[mining.miner_plugin_config.parameters]"
$ConfigFile += "device = $($_)"
$ConfigFile += "expand = 3"
$ConfigFile += "cpuload = 1"
$ConfigFile += "ntrims = 176"
$ConfigFile += "genablocks = 4096"
$ConfigFile += "genatpb = 128"
$ConfigFile += "genbtpb = 128"
$ConfigFile += "trimtpb = 512"
$ConfigFile += "tailtpb = 1024"
$ConfigFile += "recoverblocks = 1024"
$ConfigFile += "recovertpb = 1024"
$ConfigFile += ""
}
if ($Current -Like "*RTX*") {
$ConfigFile += "[[mining.miner_plugin_config]]"
$ConfigFile += "plugin_name = `"cuckatoo_mean_cuda_rtx_31`""
$ConfigFile += "[mining.miner_plugin_config.parameters]"
$ConfigFile += "device = $($_)"
$ConfigFile += "expand = 3"
$ConfigFile += "cpuload = 1"
$ConfigFile += "ntrims = 176"
$ConfigFile += "genablocks = 4096"
$ConfigFile += "genatpb = 128"
$ConfigFile += "genbtpb = 128"
$ConfigFile += "trimtpb = 512"
$ConfigFile += "tailtpb = 1024"
$ConfigFile += "recoverblocks = 1024"
$ConfigFile += "recovertpb = 1024"
$ConfigFile += ""
}
}
}
}
}
}

"nanominer" {
$ConfigPath = "config.ini"
$ConfigAlgo = $ConfigMiner.Host.Algorithm -replace "cryptonight-r","cryptonightr"
$ConfigAlgo = $ConfigMiner.Host.Algorithm -replace "cuckaroo29d","cuckarood29"
$ConfigFile += "watchdog=false"
$ConfigFile += "logPath=$Logs"
$ConfigFile += "webPort=$($ConfigMiner.Host.Port)"
$ConfigFile += ""
$ConfigFile += "`[$ConfigAlgo`]"
$ConfigFile += "wallet=$($ConfigMiner.Host.Wallet)"
$ConfigFile += "pool1=$($ConfigMiner.Host.Pool)"
$ConfigFile += "rigPassword=$($ConfigMiner.Host.Password)"
$ConfigFile += "devices=$($ConfigMiner.Host.Devices)"
}
}
$Config = Join-Path $ConfigPathDir $ConfigPath
Write-Log "Settng Config File To $Config" -ForegroundColor Yellow
$ConfigFile | Set-Content $Config
Start-Sleep -S .5
}

function Global:set-nicehash {
Expand Down Expand Up @@ -147,10 +158,10 @@ function Global:set-nicehash {
if ($NHCommands) {
$Workers += $NHCommands | ConvertFrom-Json
}
$Workers += @{time = 0; commands = @(@{id = 1; method = "subscribe"; params = [array]"$($NHPool):$($NHPort)", "$($NHUser)"})}
$Workers += @{time = 2; commands = @(@{id = 1; method = "algorithm.add"; params = @($NHAlgo)})}
$NHMDevices | foreach {$Workers += @{time = 3; commands = @(@{id = 1; method = "worker.add"; params = [array]"$NHAlgo", "$($_)"; })}}
$NHMDevices | Foreach {$Workers += @{time = 10; loop = 10; commands = @(@{id = 1; method = "worker.print.speed"; params = @("$($_)")})}}
$Workers += @{time = 0; commands = @(@{id = 1; method = "subscribe"; params = [array]"$($NHPool):$($NHPort)", "$($NHUser)" }) }
$Workers += @{time = 2; commands = @(@{id = 1; method = "algorithm.add"; params = @($NHAlgo) }) }
$NHMDevices | foreach { $Workers += @{time = 3; commands = @(@{id = 1; method = "worker.add"; params = [array]"$NHAlgo", "$($_)"; }) } }
$NHMDevices | Foreach { $Workers += @{time = 10; loop = 10; commands = @(@{id = 1; method = "worker.print.speed"; params = @("$($_)") }) } }

$Workers | ConvertTo-Json -Depth 4 | Set-Content $CommandFile

Expand Down
6 changes: 4 additions & 2 deletions build/powershell/control/launchcode.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Global:Start-LaunchCode($MinerCurrent, $AIP) {
"lolminer" { $MinerArguments = "--devices $($MinerCurrent.Devices) $($MinerCurrent.Arguments)" }
"xmrstak" { $MinerArguments = "--cuda-devices $($MinerCurrent.Devices) $($MinerCurrent.Arguments)" }
"progminer" { $MinerArguments = "--cuda-devices $($MinerCurrent.Devices) $($MinerCurrent.Arguments)" }
"grin-miner" { set-minerconfig $NewMiner $Logs }
"grin-miner" { global:set-minerconfig $NewMiner $Logs }
"zjazz" {
$GetDevices = $($MinerCurrent.Devices) -split ","
$GetDevices | ForEach-Object { $LaunchDevices += "-d $($_) " }
Expand All @@ -103,7 +103,7 @@ function Global:Start-LaunchCode($MinerCurrent, $AIP) {
$NiceDevices = Global:Get-DeviceString -TypeCount $NHDevices.NVIDIA.Count
set-nicehash $($MinerCurrent.NPool) 3200 $($MinerCurrent.NUser) $($MinerCurrent.Algo) $($MinerCurrent.CommandFile) "$NiceDevices"
}
"grin-miner" { set-minerconfig $NewMiner $Logs }
"grin-miner" { global:set-minerconfig $NewMiner $Logs }
"gminer" { $MinerArguments = "-d $($MinerCurrent.ArgDevices) $($MinerCurrent.Arguments)" }
"lolminer" { $MinerArguments = "--devices NVIDIA $($MinerCurrent.Arguments)" }
default { $MinerArguments = "$($MinerCurrent.Arguments)" }
Expand Down Expand Up @@ -140,6 +140,7 @@ function Global:Start-LaunchCode($MinerCurrent, $AIP) {
$NewLines | Set-Content ".\lyclMiner.conf"
Set-Location $($(vars).dir)
}
"nanominer" {global:set-minerconfig $MinerCurrent $Logs}
default { $MinerArguments = "$($MinerCurrent.Arguments)" }
}
}
Expand All @@ -165,6 +166,7 @@ function Global:Start-LaunchCode($MinerCurrent, $AIP) {
"grin-miner" { Global:set-minerconfig $MinerCurrent $Logs }
"gminer" { $MinerArguments = "-d $($MinerCurrent.ArgDevices) $($MinerCurrent.Arguments)" }
"lolminer" { $MinerArguments = "--devices AMD $($MinerCurrent.Arguments)" }
"nanominer" {global:set-minerconfig $MinerCurrent $Logs }
default { $MinerArguments = "$($MinerCurrent.Arguments)" }
}
}
Expand Down
8 changes: 8 additions & 0 deletions build/powershell/scripts/background.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,14 @@ While ($True) {
}
catch { Global:Get-OhNo }
}
'nanominer' {
try {
Global:Add-Module "$($(vars).miners)\nanominer.psm1";
Global:Get-StatsNanominer
Remove-Module -name "nanominer"
}
catch { Global:Get-OhNo }
}
}

##Check To See if High Rejections
Expand Down
5 changes: 0 additions & 5 deletions build/powershell/startup/remoteagent.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ function Global:start-update {
$Data.$_.naming | Add-Member "cuckatoo31" "cuckatoo31" -ErrorAction SilentlyContinue
$Data.$_.fee | Add-Member "cuckatoo31" 2 -ErrorAction SilentlyContinue

$Data.$_.commands | Add-Member "cuckaroo29d" "" -ErrorAction SilentlyContinue
$Data.$_.difficulty | Add-Member "cuckaroo29d" "" -ErrorAction SilentlyContinue
$Data.$_.naming | Add-Member "cuckaroo29d" "cuckaroo29d" -ErrorAction SilentlyContinue
$Data.$_.fee | Add-Member "cuckaroo29d" 2 -ErrorAction SilentlyContinue

$Data.$_.commands | Add-Member "equihash_96/5" "" -ErrorAction SilentlyContinue
$Data.$_.difficulty | Add-Member "equihash_96/5" "" -ErrorAction SilentlyContinue
$Data.$_.naming | Add-Member "equihash_96/5" "equihash_96/5" -ErrorAction SilentlyContinue
Expand Down
28 changes: 28 additions & 0 deletions config/miners/nanominer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"AMD1": {
"name": "AMD1",
"delay": "1",
"prestart": [],
"commands": {
"cuckaroo29": "",
"cuckaroo29d": "",
"cryptonight-r": ""
},
"difficulty": {
"cuckaroo29": "",
"cuckaroo29d": "",
"cryptonight-r": ""
},
"naming": {
"cuckaroo29": "cuckaroo29",
"cuckaroo29d": "cuckaroo29d",
"cryptonight-r": "cryptonight-r"
},
"fee": {
"cuckaroo29": 2,
"cuckaroo29d": 2,
"cryptonight-r": 1
}
},
"name": "nanominer"
}
36 changes: 12 additions & 24 deletions config/miners/nv-lolminer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"difficulty": {
"equihash_96/5": "",
Expand All @@ -22,8 +21,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"naming": {
"equihash_96/5": "equihash_144/5",
Expand All @@ -32,8 +30,7 @@
"equihash_150/5": "equihash_150/5",
"equihash_125/4": "equihash_125/4",
"cuckatoo31": "cuckatoo31",
"cuckaroo29": "cuckaroo29",
"cuckaroo29d": "cuckaroo29d"
"cuckaroo29": "cuckaroo29"
},
"fee": {
"equihash_96/5": 1,
Expand All @@ -42,8 +39,7 @@
"equihash_150/5": 1,
"equihash_125/4": 1,
"cuckatoo31": 1,
"cuckatoo29": 1,
"cuckaroo29d": 1
"cuckatoo29": 1
}
},
"NVIDIA2": {
Expand All @@ -58,8 +54,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"difficulty": {
"equihash_96/5": "",
Expand All @@ -68,8 +63,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"naming": {
"equihash_96/5": "equihash_144/5",
Expand All @@ -78,8 +72,7 @@
"equihash_150/5": "equihash_150/5",
"equihash_125/4": "equihash_125/4",
"cuckatoo31": "cuckatoo31",
"cuckaroo29": "cuckaroo29",
"cuckaroo29d": "cuckaroo29d"
"cuckaroo29": "cuckaroo29"
},
"fee": {
"equihash_96/5": 1,
Expand All @@ -88,8 +81,7 @@
"equihash_150/5": 1,
"equihash_125/4": 1,
"cuckatoo31": 1,
"cuckatoo29": 1,
"cuckaroo29d": 1
"cuckatoo29": 1
}
},
"NVIDIA3": {
Expand All @@ -104,8 +96,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"difficulty": {
"equihash_96/5": "",
Expand All @@ -114,8 +105,7 @@
"equihash_150/5": "",
"equihash_125/4": "",
"cuckatoo31": "",
"cuckaroo29": "",
"cuckaroo29d": ""
"cuckaroo29": ""
},
"naming": {
"equihash_96/5": "equihash_144/5",
Expand All @@ -124,8 +114,7 @@
"equihash_150/5": "equihash_150/5",
"equihash_125/4": "equihash_125/4",
"cuckatoo31": "cuckatoo31",
"cuckaroo29": "cuckaroo29",
"cuckaroo29d": "cuckaroo29d"
"cuckaroo29": "cuckaroo29"
},
"fee": {
"equihash_96/5": 1,
Expand All @@ -134,8 +123,7 @@
"equihash_150/5": 1,
"equihash_125/4": 1,
"cuckatoo31": 1,
"cuckatoo29": 1,
"cuckaroo29d": 1
"cuckatoo29": 1
}
}
}
Loading

0 comments on commit fa144fe

Please sign in to comment.