From 93ea34f53f4680c47bd44a96e8f6ed10b5c1bf85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D1=81=D0=BE=D0=BD=D0=BE=D0=B2=20=D0=9E?= =?UTF-8?q?=D0=BB=D0=B5=D0=B3?= Date: Wed, 3 Jan 2018 21:38:28 +0300 Subject: [PATCH] add claymore Ethereum miner --- Code/Config.ps1 | 2 +- Code/Get-Speed.ps1 | 10 +++-- Miners/claymore-eth-102.ps1 | 78 +++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 Miners/claymore-eth-102.ps1 diff --git a/Code/Config.ps1 b/Code/Config.ps1 index f53848ca..d0a9633d 100644 --- a/Code/Config.ps1 +++ b/Code/Config.ps1 @@ -45,7 +45,7 @@ class Config : BaseConfig { static [int] $Processors = 0 static [int] $Cores = 0 static [int] $Threads = 0 - static [string] $Version = "v0.24" + static [string] $Version = "v0.25" static [string] $BinLocation = "Bin" static [eMinerType[]] $ActiveTypes static [string[]] $CPUFeatures diff --git a/Code/Get-Speed.ps1 b/Code/Get-Speed.ps1 index 3a0b6967..4c2118f5 100644 --- a/Code/Get-Speed.ps1 +++ b/Code/Get-Speed.ps1 @@ -242,21 +242,25 @@ function Get-Speed() { $resjson = $result | ConvertFrom-Json if ($resjson) { [decimal] $speed = 0 # if var not initialized - this outputed to console + $measure = [string]::Empty + if ($resjson.result[0].Contains("ETH")) { + $measure = "K" + } if (![string]::IsNullOrWhiteSpace($resjson.result[2])) { $item = $resjson.result[2].Split(@(';'), [StringSplitOptions]::RemoveEmptyEntries) | Select-Object -First 1 - $speed = [MultipleUnit]::ToValue($item, [string]::Empty) + $speed = [MultipleUnit]::ToValue($item, $measure) $MP.SetSpeed([string]::Empty, $speed, $AVESpeed) Remove-Variable item } if (![string]::IsNullOrWhiteSpace($resjson.result[3])) { $items = $resjson.result[3].Split(@(';'), [StringSplitOptions]::RemoveEmptyEntries) for ($i = 0; $i -lt $items.Length; $i++) { - $speed = [MultipleUnit]::ToValue($items[$i], [string]::Empty) + $speed = [MultipleUnit]::ToValue($items[$i], $measure) $MP.SetSpeed($i, $speed, $AVESpeed) } Remove-Variable items } - Remove-Variable speed + Remove-Variable measure, speed } Remove-Variable resjson } diff --git a/Miners/claymore-eth-102.ps1 b/Miners/claymore-eth-102.ps1 new file mode 100644 index 00000000..11784afc --- /dev/null +++ b/Miners/claymore-eth-102.ps1 @@ -0,0 +1,78 @@ +<# +MindMiner Copyright (C) 2017 Oleg Samsonov aka Quake4 +https://github.com/Quake4/MindMiner +License GPL-3.0 +#> + +. .\Code\Include.ps1 + +if (![Config]::Is64Bit) { exit } + +$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName + +$Cfg = [BaseConfig]::ReadOrCreate([IO.Path]::Combine($PSScriptRoot, $Name + [BaseConfig]::Filename), @{ + Enabled = $true + BenchmarkSeconds = 60 + Algorithms = @( + [AlgoInfoEx]@{ Enabled = $true; Algorithm = "ethash" } +# [AlgoInfoEx]@{ Enabled = $true; Algorithm = "equihash"; ExtraArgs = "" } +)}) + +if (!$Cfg.Enabled) { return } + +$file = [IO.Path]::Combine($BinLocation, $Name, "epools.txt") +if ([IO.File]::Exists($file)) { + [IO.File]::Delete($file) +} + +$file = [IO.Path]::Combine($BinLocation, $Name, "dpools.txt") +if ([IO.File]::Exists($file)) { + [IO.File]::Delete($file) +} + + +$Cfg.Algorithms | ForEach-Object { + if ($_.Enabled) { + $Algo = Get-Algo($_.Algorithm) + if ($Algo) { + # find pool by algorithm + $Pool = Get-Pool($Algo) + if ($Pool) { + $esm = 2 # MiningPoolHub + if ([string]::Equals($Pool.Name, "nicehash", [StringComparison]::InvariantCultureIgnoreCase)) { + $esm = 3 + } + [MinerInfo]@{ + Pool = $Pool.PoolName() + PoolKey = $Pool.PoolKey() + Name = $Name + Algorithm = $Algo + Type = [eMinerType]::AMD + API = "claymore" + URI = "https://github.com/Quake4/MindMinerPrerequisites/raw/master/AMD/Claymore/Claymore-Dual-Ethereum-AMD-NVIDIA-Miner-v10.2.zip" + Path = "$Name\EthDcrMiner64.exe" + ExtraArgs = "$($_.ExtraArgs)" + Arguments = "-epool $($Pool.Host):$($Pool.PortUnsecure) -ewal $($Pool.User) -epsw $($Pool.Password) -retrydelay 5 -mode 1 -allpools 1 -esm $esm -mport -3350 -platform 1 $($_.ExtraArgs)" + Port = 3350 + BenchmarkSeconds = if ($_.BenchmarkSeconds) { $_.BenchmarkSeconds } else { $Cfg.BenchmarkSeconds } + Fee = 1 + } + [MinerInfo]@{ + Pool = $Pool.PoolName() + PoolKey = $Pool.PoolKey() + Name = $Name + Algorithm = $Algo + Type = [eMinerType]::nVidia + API = "claymore" + URI = "https://github.com/Quake4/MindMinerPrerequisites/raw/master/AMD/Claymore/Claymore-Dual-Ethereum-AMD-NVIDIA-Miner-v10.2.zip" + Path = "$Name\EthDcrMiner64.exe" + ExtraArgs = "$($_.ExtraArgs)" + Arguments = "-epool $($Pool.Host):$($Pool.PortUnsecure) -ewal $($Pool.User) -epsw $($Pool.Password) -retrydelay 5 -mode 1 -allpools 1 -esm $esm -mport -3360 -platform 2 $($_.ExtraArgs)" + Port = 3360 + BenchmarkSeconds = if ($_.BenchmarkSeconds) { $_.BenchmarkSeconds } else { $Cfg.BenchmarkSeconds } + Fee = 1 + } + } + } + } +} \ No newline at end of file