Skip to content

Commit

Permalink
Update V4.0.5
Browse files Browse the repository at this point in the history
-Add New Miner (CryptoDredge,DSTM,EWBF-ZEC)
-Add New Algo (equihash)
-Fix Algo (equihash144)
  • Loading branch information
xiaolin1579 authored Aug 6, 2018
1 parent 47b0dfe commit fd7d3a2
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 171 deletions.
46 changes: 45 additions & 1 deletion Include.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,50 @@ function Get-HashRate {

try {
switch ($API) {
"Bminer" {
$Message = @{command = "summary"; parameter = ""} | ConvertTo-Json -Compress

do {
Get-HttpAsJson "http://$($Server):$Port/api/status"
Param([PSCustomObject] $resjson)

[decimal] $Hashrate = 0 # if var not initialized - this outputed to console
$resjson.miners | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | ForEach-Object
$Hashrate = [MultipleUnit]::ToValueInvariant($resjson.miners."$_".solver.solution_rate, [string]::Empty)
if ($HashRate -eq $null) {$HashRates = @(); break}

$HashRates += [Double]$HashRate * $Multiplier

if (-not $Safe) {break}

Start-Sleep $Interval
} while ($HashRates.Count -lt 6)
}
"cryptodredge" {
$Message = "summary"

do {
$Client = New-Object System.Net.Sockets.TcpClient $server, $Port
$Writer = New-Object System.IO.StreamWriter $Client.GetStream()
$Reader = New-Object System.IO.StreamReader $Client.GetStream()
$Writer.AutoFlush = $true

$Writer.Write($Message)
$Request = $Reader.ReadLine()

$Data = $Request -split ";" | ConvertFrom-StringData

$HashRate = if ([Double]$Data.KHS -ne 0 -or [Double]$Data.ACC -ne 0) {$Data.KHS}

if ($HashRate -eq $null) {$HashRates = @(); break}

$HashRates += [Double]$HashRate * $Multiplier

if (-not $Safe) {break}

Start-Sleep $Interval
} while ($HashRates.Count -lt 6)
}
"xgminer" {
$Message = @{command = "summary"; parameter = ""} | ConvertTo-Json -Compress

Expand Down Expand Up @@ -657,4 +701,4 @@ function Get-Location {

if ($Locations.$Location) {$Locations.$Location}
else {$Location}
}
}
31 changes: 31 additions & 0 deletions Miners/CryptoDredge.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

$Path = ".\Bin\NVIDIA-CryptoDredge\CryptoDredge.exe"
$Uri = "https://github.com/technobyl/CryptoDredge/releases/download/v0.8.2/CryptoDredge_0.8.2_cuda_9.1_windows.zip"

$Commands = [PSCustomObject]@{
"allium" = "" #Allium
"lyra2v2" = "" #Lyra2RE2
"lyra2z" = " --submit-stale" #Lyra2z
"neoscrypt" = "" #NeoScrypt
"phi" = "" #Phi
"phi2" = "" #Phi2
"skein" = "" #Skein
"skunk" = "" #Skunk
"tribus" = "" #Tribus
}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Commands | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | ForEach {
[PSCustomObject]@{
Type = "NVIDIA"
Path = $Path
Arguments = " --retry-pause 1 -b 127.0.0.1:4068 -d $($Config.SelGPUCC) -a $_ --no-watchdog -o stratum+tcp://$($Pools.(Get-Algorithm($_)).Host):$($Pools.(Get-Algorithm($_)).Port) -u $($Pools.(Get-Algorithm($_)).User) -p $($Pools.(Get-Algorithm($_)).Pass)$($Commands.$_) -R 1 -q -N 1"
HashRates = [PSCustomObject]@{(Get-Algorithm($_)) = $Stats."$($Name)_$(Get-Algorithm($_))_HashRate".Week * .99} # substract 1% devfee
API = "cryptodredge"
Port = 4068
Wrap = $false
URI = $Uri
User = $Pools.(Get-Algorithm($_)).User
}
}
22 changes: 22 additions & 0 deletions Miners/DSTM.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$Path = ".\Bin\NVIDIA-DSTM\zm.exe"
$Uri = "https://github.com/nemosminer/DSTM-equihash-miner/releases/download/DSTM-v0.6.1/zm_0.6.1_win.zip"

$Commands = [PSCustomObject]@{
"equihash" = " -d $SelGPUDSTM" #Equihash
}
$Port = 2222
$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Commands | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | ForEach-Object {
[PSCustomObject]@{
Type = "NVIDIA"
Path = $Path
Arguments = "--telemetry=127.0.0.1:$Port --server $($Pools.(Get-Algorithm($_)).Host) --port $($Pools.(Get-Algorithm($_)).Port) --user $($Pools.(Get-Algorithm($_)).User) --pass $($Pools.(Get-Algorithm($_)).Pass)$($Commands.$_)"
HashRates = [PSCustomObject]@{(Get-Algorithm($_)) = $Stats."$($Name)_$(Get-Algorithm($_))_HashRate".Hour * .98} # substract 2% devfee
API = "DSTM"
Port = $Port
Wrap = $false
URI = $Uri
User = $Pools.(Get-Algorithm($_)).User
}
}
24 changes: 24 additions & 0 deletions Miners/EWBF-ZEC.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$Path = '.\Bin\NVIDIA-EWBF(ZEC)\miner.exe'
$Uri = 'https://github.com/nanopool/ewbf-miner/releases/download/v0.3.4b/Zec.miner.0.3.4b.zip'


$Commands = [PSCustomObject]@{
Equihash = ' '

}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Commands | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | ForEach {
[PSCustomObject]@{
Type = "NVIDIA"
Path = $Path
Arguments = "--api --server $($Pools.(Get-Algorithm($_)).Host) --port $($Pools.(Get-Algorithm($_)).Port) --user $($Pools.(Get-Algorithm($_)).User) --pass $($Pools.(Get-Algorithm($_)).Pass)$($Commands.$_)"
HashRates = [PSCustomObject]@{(Get-Algorithm($_)) = $Stats."$($Name)_$(Get-Algorithm($_))_HashRate".Live}
API = "EWBF"
Port = 42000
Wrap = $false
URI = $Uri
User = $Pools.(Get-Algorithm($_)).User
}
}
6 changes: 5 additions & 1 deletion Miners/EWBF.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ $Uri = 'http://nemos.dx.am/opt/nemos/EWBFEquihashv0.3.7z'


$Commands = [PSCustomObject]@{
Equihash144 = ' --algo 144_5 --pers sngemPoW'
Equihash144 = ' --algo 144_5 --pers auto'
Equihash144btcz = ' --algo 144_5 --pers BitcoinZ'
Equihash144xsg = ' --algo 144_5 --pers sngemPoW'
Equihash144safe = ' --algo 144_5 --pers Safecoin'
Equihash144zel = ' --algo 144_5 --pers ZelProof'
Equihash192 = ' --algo 192_7 --pers ZERO_PoW'

}
Expand Down
115 changes: 59 additions & 56 deletions Pools/zergpool.ps1
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
. .\Include.ps1

try {
$zergpool_Request = Invoke-WebRequest "http://api.zergpool.com:8080/api/status" -UseBasicParsing -Headers @{"Cache-Control" = "no-cache"} | ConvertFrom-Json
}
catch { return }

if (-not $zergpool_Request) {return}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Locations = "US", "Europe"

$Locations | ForEach {
$Location = $_

$zergpool_Request | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | foreach {
$zergpool_Host = If ($Location -eq "Europe") {$Location + ".mine.zergpool.com"}else {"mine.zergpool.com"}
$zergpool_Port = $zergpool_Request.$_.port
$zergpool_Algorithm = Get-Algorithm $zergpool_Request.$_.name
$zergpool_Coin = ""

$Divisor = 1000000

switch ($zergpool_Algorithm) {
"equihash" {$Divisor /= 1000}
"blake2s" {$Divisor *= 1000}
"blakecoin" {$Divisor *= 1000}
"decred" {$Divisor *= 1000}
"keccak" {$Divisor *= 1000}
"keccakc" {$Divisor *= 1000}
}

if ((Get-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit") -eq $null) {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.estimate_last24h / $Divisor)}
else {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.estimate_current / $Divisor)}

$ConfName = if ($Config.PoolsConfig.$Name -ne $Null) {$Name}else {"default"}

if ($Config.PoolsConfig.default.Wallet) {
[PSCustomObject]@{
Algorithm = $zergpool_Algorithm
Info = $zergpool
Price = $Stat.Live * $Config.PoolsConfig.$ConfName.PricePenaltyFactor
StablePrice = $Stat.Week
MarginOfError = $Stat.Fluctuation
Protocol = "stratum+tcp"
Host = $zergpool_Host
Port = $zergpool_Port
User = $Config.PoolsConfig.$ConfName.Wallet
Pass = "$($Config.PoolsConfig.$ConfName.WorkerName),c=$Passwordcurrency"
Location = $Location
SSL = $false
}
}
}
}
. .\Include.ps1

try {
$zergpool_Request = Invoke-WebRequest "http://api.zergpool.com:8080/api/status" -UseBasicParsing -Headers @{"Cache-Control" = "no-cache"} | ConvertFrom-Json
}
catch { return }

if (-not $zergpool_Request) {return}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Locations = "US", "Europe"

$Locations | ForEach {
$Location = $_

$zergpool_Request | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | foreach {
$zergpool_Host = "$_.mine.zergpool.com"
$zergpool_Port = $zergpool_Request.$_.port
$zergpool_Algorithm = Get-Algorithm $zergpool_Request.$_.name
$zergpool_Coin = ""

$Divisor = 1000000

switch ($zergpool_Algorithm) {
"equihash" {$Divisor /= 1000}
"equihash144" {$Divisor /= 1000}
"equihash192" {$Divisor /= 1000}
"balloon" {$Divisor /= 1000}
"blake2s" {$Divisor *= 1000}
"blakecoin" {$Divisor *= 1000}
"decred" {$Divisor *= 1000}
"keccak" {$Divisor *= 1000}
"keccakc" {$Divisor *= 1000}
}

if ((Get-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit") -eq $null) {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.estimate_last24h / $Divisor)}
else {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.estimate_current / $Divisor)}

$ConfName = if ($Config.PoolsConfig.$Name -ne $Null) {$Name}else {"default"}

if ($Config.PoolsConfig.default.Wallet) {
[PSCustomObject]@{
Algorithm = $zergpool_Algorithm
Info = $zergpool
Price = $Stat.Live * $Config.PoolsConfig.$ConfName.PricePenaltyFactor
StablePrice = $Stat.Week
MarginOfError = $Stat.Fluctuation
Protocol = "stratum+tcp"
Host = $zergpool_Host
Port = $zergpool_Port
User = $Config.PoolsConfig.$ConfName.Wallet
Pass = "$($Config.PoolsConfig.$ConfName.WorkerName),c=$Passwordcurrency"
Location = $Location
SSL = $false
}
}
}
}
116 changes: 60 additions & 56 deletions Pools/zergpool24hr.ps1
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
. .\Include.ps1

try {
$zergpool_Request = Invoke-WebRequest "http://api.zergpool.com:8080/api/status" -UseBasicParsing -Headers @{"Cache-Control" = "no-cache"} | ConvertFrom-Json
}
catch { return }

if (-not $zergpool_Request) {return}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Locations = "US", "Europe"

$Locations | ForEach {
$Location = $_

$zergpool_Request | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | foreach {
$zergpool_Host = If ($Location -eq "Europe") {$Location + ".mine.zergpool.com"}else {"mine.zergpool.com"}
$zergpool_Port = $zergpool_Request.$_.port
$zergpool_Algorithm = Get-Algorithm $zergpool_Request.$_.name
$zergpool_Coin = ""

$Divisor = 1000000000

switch ($zergpool_Algorithm) {
"equihash" {$Divisor /= 1000}
"blake2s" {$Divisor *= 1000}
"blakecoin" {$Divisor *= 1000}
"decred" {$Divisor *= 1000}
"keccak" {$Divisor *= 1000}
"keccakc" {$Divisor *= 1000}
}

if ((Get-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit") -eq $null) {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.actual_last24h / $Divisor)}
else {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.actual_last24h / $Divisor)}

$ConfName = if ($Config.PoolsConfig.$Name -ne $Null) {$Name}else {"default"}

if ($Config.PoolsConfig.default.Wallet) {
[PSCustomObject]@{
Algorithm = $zergpool_Algorithm
Info = $zergpool
Price = $Stat.Live * $Config.PoolsConfig.$ConfName.PricePenaltyFactor
StablePrice = $Stat.Week
MarginOfError = $Stat.Fluctuation
Protocol = "stratum+tcp"
Host = $zergpool_Host
Port = $zergpool_Port
User = $Config.PoolsConfig.$ConfName.Wallet
Pass = "$($Config.PoolsConfig.$ConfName.WorkerName),c=$Passwordcurrency"
Location = $Location
SSL = $false
}
}
}
}
. .\Include.ps1

try {
$zergpool_Request = Invoke-WebRequest "http://api.zergpool.com:8080/api/status" -UseBasicParsing -Headers @{"Cache-Control" = "no-cache"} | ConvertFrom-Json
}
catch { return }

if (-not $zergpool_Request) {return}

$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName

$Locations = "US", "Europe"

$Locations | ForEach {
$Location = $_

$zergpool_Request | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | foreach {
$zergpool_Host = "$_.mine.zergpool.com"
$zergpool_Port = $zergpool_Request.$_.port
$zergpool_Algorithm = Get-Algorithm $zergpool_Request.$_.name
$zergpool_Coin = ""

$Divisor = 1000000000

switch ($zergpool_Algorithm) {
"equihash" {$Divisor /= 1000}
"equihash144" {$Divisor /= 1000}
"equihash192" {$Divisor /= 1000}
"balloon" {$Divisor /= 1000}
"blake2s" {$Divisor *= 1000}
"blakecoin" {$Divisor *= 1000}
"decred" {$Divisor *= 1000}
"keccak" {$Divisor *= 1000}
"keccakc" {$Divisor *= 1000}

}

if ((Get-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit") -eq $null) {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.actual_last24h / $Divisor)}
else {$Stat = Set-Stat -Name "$($Name)_$($zergpool_Algorithm)_Profit" -Value ([Double]$zergpool_Request.$_.actual_last24h / $Divisor)}

$ConfName = if ($Config.PoolsConfig.$Name -ne $Null) {$Name}else {"default"}

if ($Config.PoolsConfig.default.Wallet) {
[PSCustomObject]@{
Algorithm = $zergpool_Algorithm
Info = $zergpool
Price = $Stat.Live * $Config.PoolsConfig.$ConfName.PricePenaltyFactor
StablePrice = $Stat.Week
MarginOfError = $Stat.Fluctuation
Protocol = "stratum+tcp"
Host = $zergpool_Host
Port = $zergpool_Port
User = $Config.PoolsConfig.$ConfName.Wallet
Pass = "$($Config.PoolsConfig.$ConfName.WorkerName),c=$Passwordcurrency"
Location = $Location
SSL = $false
}
}
}
}
Loading

0 comments on commit fd7d3a2

Please sign in to comment.