Skip to content

Commit

Permalink
5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tutulino committed Jan 11, 2018
1 parent 51d9b09 commit 299ca21
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 48 deletions.
4 changes: 2 additions & 2 deletions Config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@

@@PERCENTTOSWITCH=10

-- seconds to delay closing of old miners when new miner is selected as more profitable, this minimizes inactive time while switch. For benchmarking interval this value is automatically zero.
-- seconds to delay closing of old miners when new miner is selected as more profitable, this minimizes inactive time while switch. For benchmarking interval this value is automatically zero. Some systems can turn unstable if non zero.

@@DELAYCLOSEMINERS=0


-- [OPTIONAL] API Keys
-- Some non-anonymous pools, such as Suprnova and MPH, require API keys to obtain wallet details.
-- Some non-anonymous pools, such as Suprnova and MPH, require API keys to obtain wallet details or pool speed.
-- For example @@APIKEY_MINING_POOL_HUB=a04e6sx30b38f73878ae40775f70efseff6582e8ec37600215755487ccbd36b4510b4
-- FORMAT: @@APIKEY_NAMEOFPOOL=XXXXXXXXXX) [optional]

Expand Down
66 changes: 49 additions & 17 deletions Pools/Mining_Pool_Hub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ if ($Querymode -eq "info"){
}





#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************




if ($Querymode -eq "APIKEY") {
if ($Querymode -eq "APIKEY" -or $Querymode -eq "SPEED") {

Switch($Info.coin) {
"DigiByte" {
Expand All @@ -59,24 +62,53 @@ if ($Querymode -eq "info"){
"Verge" {$Info.Coin=$Info.coin+'-'+$Info.Algorithm}
}


try {
$http="http://"+$Info.Coin+".miningpoolhub.com/index.php?page=api&action=getdashboarddata&api_key="+$Info.ApiKey+"&id="
#$http |write-host
$Request = Invoke-WebRequest $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json | Select-Object -ExpandProperty getdashboarddata | Select-Object -ExpandProperty data
}
catch {}


#***************************
if ($Querymode -eq "APIKEY" ) {

try {
$http="http://"+$Info.Coin+".miningpoolhub.com/index.php?page=api&action=getdashboarddata&api_key="+$Info.ApiKey+"&id="
$Request = Invoke-WebRequest $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json | Select-Object -ExpandProperty getdashboarddata | Select-Object -ExpandProperty data
}
catch {}


if ($Request -ne $null -and $Request -ne ""){
$Result = [PSCustomObject]@{
Pool =$name
currency = $Info.OriginalCoin
balance = $Request.balance.confirmed+$Request.balance.unconfirmed+$Request.balance_for_auto_exchange.confirmed+$Request.balance_for_auto_exchange.unconfirmed
}
Remove-variable Request
}
}
#***************************


if ($Querymode -eq "SPEED") {

if ($Request -ne $null -and $Request -ne ""){
$Result = [PSCustomObject]@{
Pool =$name
currency = $Info.OriginalCoin
balance = $Request.balance.confirmed+$Request.balance.unconfirmed+$Request.balance_for_auto_exchange.confirmed+$Request.balance_for_auto_exchange.unconfirmed
}
Remove-variable Request

try {
$http="http://"+$Info.Coin+".miningpoolhub.com/index.php?page=api&action=getuserworkers&api_key="+$Info.ApiKey
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Request = Invoke-WebRequest $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json
}
catch {
}

if ($Request -ne $null -and $Request -ne ""){
$Request.getuserworkers.data | ForEach-Object {
$Result += [PSCustomObject]@{
PoolName =$name
Diff = $_.difficulty
Workername =($_.username -split "\.")[1]
Hashrate = $_.hashrate
}
}

}

}


}

Expand Down
53 changes: 45 additions & 8 deletions Pools/NANOPOOL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,62 @@ if ($Querymode -eq "info"){
}






#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************


if ($Querymode -eq "SPEED") {


try {
$http="https://api.nanopool.org/v1/"+$Info.symbol.tolower()+"/history/"+$Info.user
$Request = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json
}
catch {}


$Result=[PSCustomObject]@{
PoolName =$name
Workername = $Info.WorkerName
Hashrate = ($Request.data)[0].hashrate
}
}




#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************


if ($Querymode -eq "WALLET") {


try {
$http="https://api.nanopool.org/v1/"+$Info.symbol.tolower()+"/balance/"+$Info.user
$NP_Request = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 10 | ConvertFrom-Json
$Request = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json
}
catch {}


$Result=[PSCustomObject]@{
Pool =$name
currency = $Info.OriginalCoin
balance = $NP_Request.data
balance = $Request.data
}
}



#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************


if (($Querymode -eq "core" ) -or ($Querymode -eq "Menu")){
Expand All @@ -67,12 +104,12 @@ if (($Querymode -eq "core" ) -or ($Querymode -eq "Menu")){
$PrePools | ForEach-Object {

try {
$NP_RequestW=$null
$RequestW=$null
$http="https://api.nanopool.org/v1/"+$_.symbol.ToLower()+"/pool/activeworkers"
$NP_RequestW = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 3 | ConvertFrom-Json
$NP_RequestP=$null
$RequestW = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 3 | ConvertFrom-Json
$RequestP=$null
$http="https://api.nanopool.org/v1/"+$_.symbol.ToLower()+"/approximated_earnings/1"
$NP_RequestP = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 3 | ConvertFrom-Json |select-object -ExpandProperty data |select-object -ExpandProperty day
$RequestP = Invoke-WebRequest -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" $http -UseBasicParsing -timeoutsec 3 | ConvertFrom-Json |select-object -ExpandProperty data |select-object -ExpandProperty day
}
catch {}

Expand All @@ -86,7 +123,7 @@ if (($Querymode -eq "core" ) -or ($Querymode -eq "Menu")){
$Result+=[PSCustomObject]@{
Algorithm = $_.algo
Info = $_.Coin
Price = ($NP_RequestP.bitcoins / $_.Divisor)
Price = ($RequestP.bitcoins / $_.Divisor)
Price24h = $null
Protocol = "stratum+tcp" #$_.Protocol
Host = $loc.server
Expand All @@ -99,7 +136,7 @@ if (($Querymode -eq "core" ) -or ($Querymode -eq "Menu")){
AbbName = $AbbName
ActiveOnManualMode = $ActiveOnManualMode
ActiveOnAutomaticMode = $ActiveOnAutomaticMode
PoolWorkers = $NP_RequestW.Data
PoolWorkers = $RequestW.Data
PoolName = $Name
WalletMode = $WalletMode
WalletSymbol = $_.symbol
Expand Down
2 changes: 1 addition & 1 deletion Pools/NICEHASH.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$Name = (Get-Item $script:MyInvocation.MyCommand.Path).BaseName
$ActiveOnManualMode = $true
$ActiveOnAutomaticMode = $true
$ActiveOnAutomatic24hMode = $true
$ActiveOnAutomatic24hMode = $false
$AbbName = 'NH'
$WalletMode = "WALLET"
$Result=@()
Expand Down
24 changes: 12 additions & 12 deletions Pools/SUPRNOVA.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ if ($Querymode -eq "info"){


}


#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
Expand All @@ -68,26 +67,27 @@ if ($Querymode -eq "info"){


try {
$http="http://"+$Info.Symbol+".suprnova.cc/index.php?page=api&action=getuserbalance&api_key="+$Info.ApiKey+"&id="
$http="http://"+$Info.Symbol+".suprnova.cc/index.php?page=api&action=getuserworkers&api_key="+$Info.ApiKey
#$http |write-host
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Request = Invoke-WebRequest $http -UseBasicParsing -timeoutsec 5
$Request = $Request | ConvertFrom-Json | Select-Object -ExpandProperty getuserbalance | Select-Object -ExpandProperty data
$Request = Invoke-WebRequest $http -UseBasicParsing -timeoutsec 5 | ConvertFrom-Json
}
catch {
}



$Result=[PSCustomObject]@{
Pool =$name
currency = $Info.OriginalCoin
balance = $Request.confirmed+$Request.unconfirmed
if ($Request -ne $null -and $Request -ne ""){
$Request.getuserworkers.data | ForEach-Object {
$Result += [PSCustomObject]@{
PoolName =$name
Diff = $_.difficulty
Workername =($_.username -split "\.")[1]
Hashrate = $_.hashrate
}
}

}

}

}

#****************************************************************************************************************************************************************************************
#****************************************************************************************************************************************************************************************
Expand Down
Loading

0 comments on commit 299ca21

Please sign in to comment.