Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: details of stratums instances per algo #228

Open
wants to merge 35 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
900e5fa
GoaCoin stratum support
phm87 Jan 7, 2018
bc7fa41
Update coinbase.cpp
phm87 Jan 16, 2018
815c955
Merge pull request #1 from tpruvot/next
phm87 Jan 16, 2018
cdd72bf
stratum: initialize segwit flag
tpruvot Jan 18, 2018
7f7d533
lbry: change estimates in mBTC/GH like other sha algos
tpruvot Jan 19, 2018
e0e7c14
backend: drop old blocks from the db after 60 days
tpruvot Jan 19, 2018
8509aae
stratum: pushing more old masternodes (#210)
Jan 19, 2018
b3a5761
stratum: handle proxy protocol (#196)
Jan 22, 2018
a3a3ba8
decred: listtransactions order is finally like others
tpruvot Jan 23, 2018
762fbdb
stratum: check coin filters early (#211)
Jan 24, 2018
2d4348e
new x16r algo, with stratum factor 256, like timetravel algos
tpruvot Jan 12, 2018
885b448
benchs: ignore some weird device names and x16r algo
tpruvot Jan 24, 2018
461f788
stratum: fix altminer commit
tpruvot Jan 24, 2018
ac42aab
cexio: include btc in orders for the balance
tpruvot Jan 24, 2018
5511d71
Add MAG (Magnet) masternode to oldmasternodes (#213)
FredericRezeau Jan 26, 2018
95aa7fc
balances: fill the btc 'onsell' field too (locked)
tpruvot Jan 27, 2018
f022346
stratum: avoid the use of getinfo
tpruvot Jan 30, 2018
5c5abe5
yescryptR16 algo (#217)
UniMiningNet Jan 31, 2018
73ac94f
sql: add hasgetinfo and no_explorer fields to coins table
tpruvot Feb 2, 2018
5d464ff
Fill url in stratum table with g_tcp_server
phm87 Feb 10, 2018
0af4987
Display g_tcp_server of stratums (url column)
phm87 Feb 10, 2018
682a293
stratum: set PBS as old masternode #220
phm87 Feb 10, 2018
e2ad0b5
Merge pull request #5 from tpruvot/next
phm87 Feb 10, 2018
18104f2
Merge pull request #6 from phm87/phm87-url-stratum-g_tcp_server
phm87 Feb 10, 2018
e451b12
actionGostratums & actionAdminStratums
phm87 Feb 10, 2018
a4a3ac9
Update SiteController.php
phm87 Feb 10, 2018
2f591bc
Update common_results.php
phm87 Feb 10, 2018
25bb472
Changes as discussed
phm87 Feb 11, 2018
0169fa3
single quotes
phm87 Feb 11, 2018
19e7933
single quote
phm87 Feb 11, 2018
594dda0
SQL fix + stratumstable fix
phm87 Feb 11, 2018
4ab3c35
Fix: quotes + table sort
phm87 Feb 11, 2018
eb56e26
admin: no need to prevent all
phm87 Feb 11, 2018
7f6bf1f
Remove double/useless <table>
phm87 Feb 11, 2018
d4bbbb9
display stratums instances when algo_selected=all
phm87 Feb 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stratum/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ void db_register_stratum(YAAMP_DB *db)
int t = time(NULL);
if(!db) return;

db_query(db, "INSERT INTO stratums (pid, time, started, algo, port) VALUES (%d, %d, %d, '%s', %d) "
db_query(db, "INSERT INTO stratums (pid, time, started, algo, port, url) VALUES (%d, %d, %d, '%s', %d, '%s') "
" ON DUPLICATE KEY UPDATE time=%d, algo='%s', port=%d",
pid, t, t, g_stratum_algo, g_tcp_port,
pid, t, t, g_stratum_algo, g_tcp_port, g_tcp_server,
t, g_stratum_algo, g_tcp_port
);
}
Expand Down
13 changes: 13 additions & 0 deletions web/yaamp/modules/site/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,19 @@ public function actionCommon_results()

/////////////////////////////////////////////////

public function actionGostratums()
{
if(!$this->admin) return;
$algo = substr(getparam('algo'), 0, 32);
if ($algo == 'all') {
return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to prevent "all" if its for the admin

}
user()->setState('yaamp-algo', $algo);
$this->redirect("common");
}

/////////////////////////////////////////////////

public function actionBalances()
{
if(!$this->admin) return;
Expand Down
43 changes: 41 additions & 2 deletions web/yaamp/modules/site/common_results.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

$mining = getdbosql('db_mining');

$algo_selected = user()->getState('yaamp-algo');

$showrental = (bool) YAAMP_RENTAL;

echo <<<END
Expand Down Expand Up @@ -127,8 +129,16 @@ function cmp($a, $b)
$ts = $isup ? datetoa2($stratum->started) : '';

echo '<tr class="ssrow">';
echo '<td style="background-color: '.$algo_color.'"><b>';
echo CHtml::link($algo, '/site/gomining?algo='.$algo);

$stratum_instances = dboscalar("SELECT COUNT(*) FROM stratums WHERE algo='$algo'");
$stratum_urls = dbolist("SELECT url FROM stratums WHERE algo='$algo'"); // AND NOT(url = NULL)");

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation spaces to fix (please keep tabs)

$urls = $stratum_instances." Stratums TCP Server:";
foreach ($stratum_urls as $stra) {
$urls = $urls . "\n" . $stra['url'];
}
echo '<td style="background-color: '.$algo_color.'"><b title="'.$urls.'">';
echo CHtml::link($algo, '/site/Gostratums?algo='.$algo);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cap should be removed here.. like "gomining"... the actionGostratum cap is only a way to make action functions more readable.

echo '</b></td>';
echo '<td align="left" style="font-size: .8em;" data="'.$ts.'">'.$isup.'&nbsp;'.$time.'</td>';
echo '<td align="right" style="font-size: .8em;">'.(empty($coins) ? '-' : $coins).'</td>';
Expand Down Expand Up @@ -176,6 +186,35 @@ function cmp($a, $b)
echo '<td align="right" style="font-size: .8em; '.$style.'">'.$btcmhday1.'</td>';

echo '</tr>';

if ($algo_selected == $algo) {
echo "<tr>";
echo "<td colspan='13'>";
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th data-sorter='numeric' align='left">PID</th>";
echo "<th data-sorter='numeric' align='left">Time</th>";
echo "<th data-sorter='numeric' align='left">Started</th>";
echo "<th data-sorter='numeric' align='left">Workers</th>";
echo "<th data-sorter='numeric' align='left">Port</th>";
echo "<th data-sorter='numeric' align='left">Symbol</th>";
echo "<th data-sorter='numeric' align='left">url</th>";
echo "<th data-sorter='numeric' align='left">fds</th>";
echo "</tr>";
$stratums_details_list = dbolist("SELECT * FROM stratums WHERE algo:=algo='$algo_selected'");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

algo:=algo='...' ?

Copy link

@mman07 mman07 Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to " to ' on th align

foreach ($stratums_details_list as $stratums_details) {
echo "<tr>";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you need to fill data="$time" in the time td... and use the datetoa2() function for the content

echo "<td>".$stratums_details['pid']."</td><td>".$stratums_details['time']."</td><td>";
echo $stratums_details['started']."</td><td>".$stratums_details['workers']."</td><td>";
echo $stratums_details['port']."</td><td>".$stratums_details['symbol']."</td><td>";
echo $stratums_details['url']."</td><td>".$stratums_details['fds']."</td><td>";
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
}
}

echo '</tbody>';
Expand Down