Skip to content

Commit

Permalink
add claymore Ethereum miner
Browse files Browse the repository at this point in the history
  • Loading branch information
Самсонов Олег authored and Самсонов Олег committed Jan 3, 2018
1 parent 672412f commit 93ea34f
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Code/Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions Code/Get-Speed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
78 changes: 78 additions & 0 deletions Miners/claymore-eth-102.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}

0 comments on commit 93ea34f

Please sign in to comment.