Skip to content

Commit

Permalink
Update pool SparkPool
Browse files Browse the repository at this point in the history
- fix ssl for BEAM
- fix price calculation for BEAM
  • Loading branch information
RainbowMiner committed Mar 7, 2019
1 parent 735e157 commit 8364812
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Pools/SparkPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ catch {
}

$Pools_Data = @(
[PSCustomObject]@{id = "beam"; coin = "Beam"; algo = "Equihash25x5"; symbol = "BEAM"; port = 2222; fee = 1; region = @("asia","eu","us")}
[PSCustomObject]@{id = ""; coin = "Ethereum"; algo = "Ethash"; symbol = "ETH"; port = 3333; fee = 1; region = @("cn")}
[PSCustomObject]@{id = "etc"; coin = "EthereumClassic"; algo = "Ethash"; symbol = "ETC"; port = 5555; fee = 1; region = @("cn")}
[PSCustomObject]@{id = "grin"; coin = "Grin"; algo = "Cuckaroo29"; symbol = "GRIN_29"; port = 6666; fee = 1; region = @("asia","eu","us")}
[PSCustomObject]@{id = "grin"; coin = "Grin"; algo = "Cuckatoo31"; symbol = "GRIN_31"; port = 6667; fee = 1; region = @("asia","eu","us")}
[PSCustomObject]@{id = "xmr"; coin = "Monero"; algo = "Monero"; symbol = "XMR"; port = 11000; fee = 1; region = @("cn")}
[PSCustomObject]@{id = "beam"; coin = "Beam"; algo = "Equihash25x5"; symbol = "BEAM"; port = 2222; fee = 1; ssl = $true; region = @("asia","eu","us")}
[PSCustomObject]@{id = ""; coin = "Ethereum"; algo = "Ethash"; symbol = "ETH"; port = 3333; fee = 1; ssl = $false; region = @("cn")}
[PSCustomObject]@{id = "etc"; coin = "EthereumClassic"; algo = "Ethash"; symbol = "ETC"; port = 5555; fee = 1; ssl = $false; region = @("cn")}
[PSCustomObject]@{id = "grin"; coin = "Grin"; algo = "Cuckaroo29"; symbol = "GRIN_29"; port = 6666; fee = 1; ssl = $false; region = @("asia","eu","us")}
[PSCustomObject]@{id = "grin"; coin = "Grin"; algo = "Cuckatoo31"; symbol = "GRIN_31"; port = 6667; fee = 1; ssl = $false; region = @("asia","eu","us")}
[PSCustomObject]@{id = "xmr"; coin = "Monero"; algo = "Monero"; symbol = "XMR"; port = 11000; fee = 1; ssl = $false; region = @("cn")}
)

$Pools_Data | Where-Object {$Wallets."$($_.symbol -replace "_.+$")" -or $InfoOnly} | ForEach-Object {
Expand All @@ -50,12 +50,13 @@ $Pools_Data | Where-Object {$Wallets."$($_.symbol -replace "_.+$")" -or $InfoOnl
$Pool_Fee = $_.fee
$Pool_ID = $_.id
$Pool_Regions = $_.region
$Pool_BtcRate = if ($Session.Rates.$Pool_Currency) {1/$Session.Rates.$Pool_Currency} else {0}
$Pool_SSL = $_.ssl

$Pool_Request.data | Where-Object currency -eq $Pool_Symbol | Foreach-Object {
if (-not $InfoOnly) {
if (-not $Session.Rates.$Pool_Currency -and $_.usd -and $Session.Rates.USD) {$Session.Rates.$Pool_Currency = $Session.Rates.USD / $_.usd}
$NewStat = -not (Test-Path ".\Stats\Pools\$($Name)_$($Pool_Symbol)_Profit.txt")
$Stat = Set-Stat -Name "$($Name)_$($Pool_Symbol)_Profit" -Value ($_."$(if ($NewStat) {"meanIncome24h"} else {"income"})" / $_.incomeHashrate * $Pool_BtcRate) -Duration $(if ($NewStat) {New-TimeSpan -Days 1} else {$StatSpan}) -ChangeDetection $false -HashRate $_.hashrate -BlockRate $_.blocks -Quiet
$Stat = Set-Stat -Name "$($Name)_$($Pool_Symbol)_Profit" -Value $(if ($Session.Rates.$Pool_Currency) {$_."$(if ($NewStat) {"meanIncome24h"} else {"income"})" / $_.incomeHashrate / $Session.Rates.$Pool_Currency} else {0}) -Duration $(if ($NewStat) {New-TimeSpan -Days 1} else {$StatSpan}) -ChangeDetection $false -HashRate $_.hashrate -BlockRate $_.blocks -Quiet
}

foreach ($Pool_Region in $Pool_Regions) {
Expand All @@ -73,7 +74,7 @@ $Pools_Data | Where-Object {$Wallets."$($_.symbol -replace "_.+$")" -or $InfoOnl
User = "$($Wallets.$Pool_Currency)$(if ($Pool_Currency -match "GRIN") {"/"} else {"."}){workername:$Worker}"
Pass = "x"
Region = $Pool_RegionsTable.$Pool_Region
SSL = $false
SSL = $Pool_SSL
Updated = $Stat.Updated
PoolFee = $Pool_Fee
DataWindow = $DataWindow
Expand Down

0 comments on commit 8364812

Please sign in to comment.