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

admin: details of stratums instances per algo #228

wants to merge 35 commits into from

Conversation

phm87
Copy link

@phm87 phm87 commented Feb 10, 2018

Thank you for the help.
Layout of display is still to enhance

phm87 and others added 27 commits January 7, 2018 01:31
Update to keep up to date
if needed (already mining) you can do that to update the pool estimate graph values:

UPDATE hashrate SET price=price*1000.0, rent=rent*1000 WHERE algo='lbry' AND price < 0.01;
Implemented PROXY v2 protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) so that stratum can be run behind an haproxy instance.

iptables/ipset still work if haproxy is run on local machine. if run on remote machine switch to using client_block_ipset() and periodically sync the ipset to the machine running haproxy.
haproxy must be configured with send-proxy-v2, version 1 does not work
Avoid the override of global variables
g_stratum_max_cons, g_max_shares, g_stratum_segwit
by excluded coinds by checking the include/exclude filters earlier.
beware: this algo may have a variable hashrate, unlike timetravel

its ignored from benchs for this reason
Greetings, I am head dev for Magnet masternode and noticed the change
made in coinbase.cpp for recent masternode RPC as default.
This change has disabled masternode payments on pools using MAG client.
So, we would like to add it to oldmasternodes list with this pull request.
and restore bitstamp & cexio behavior to act like other trading exchanges

todo: kraken if possible... real pain, need to parse open orders..
wallets without getinfo will be handled in a later commit...

ps: remember to restart memcached service after the db change..
@phm87 phm87 mentioned this pull request Feb 10, 2018
$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.


$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)

Thank you for you help @tpruvot
- replace tabs by spaces
- Remove uppercase G in Gostratums
- HTML enhancement: stratumstable
Remark: If anything else should be enhanced, please tell me.

I'll conduct tests and write a comment if tests are fine (ex: textExtraction fields of stratumstable).
</thead>
<tbody>
END;
$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

because single quotes were used and not double quotes
</tr>
</thead>
<tbody>
END;
$stratums_details_list = dbolist("SELECT * FROM stratums WHERE algo:=algo='$algo_selected'");
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

<th data-sorter='numeric' align='left">Started</th>
<th data-sorter='numeric' align='left">Workers</th>
<th data-sorter='numeric' align='left">Port</th>
<th data-sorter='numeric' align='left">Symbol</th>
Copy link
Owner

Choose a reason for hiding this comment

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

symbol and "url" are not numeric...

widgets: ["Storage","saveSort"],
textExtraction: {
1: function(node, table, cellIndex) { return $(node).attr("data"); },
5: function(node, table, cellIndex) { return $(node).attr("data"); }
Copy link
Owner

Choose a reason for hiding this comment

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

5th column doesnt need that

Thank you again for the review :-)
- Remove :=algo in SQL
- Remove 5 in stratumstable
@@ -195,7 +195,6 @@ function cmp($a, $b)
widgets: ["Storage","saveSort"],
textExtraction: {
1: function(node, table, cellIndex) { return $(node).attr("data"); },
Copy link
Owner

Choose a reason for hiding this comment

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

you need to remove the comma, some browsers dont like that ;)

<th data-sorter='numeric' align='left'>Port</th>
<th data-sorter='numeric' align='left'>Symbol</th>
<th data-sorter='numeric' align='left'>url</th>
<th data-sorter='numeric' align='left'>fds</th>
Copy link
Owner

@tpruvot tpruvot Feb 11, 2018

Choose a reason for hiding this comment

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

html single quotes are not standard use... and cant work echo '<td colspan='13'>';

Thank you again for your help and support during the weekend.
- Double quotes instead of single quotes
- data-sorter : text instead of numeric for url and Symbol
- fill data for time and started column

I've made the changes discussed, I'll test on a pooltest and write a comment about tests results later.
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

saveSort: true
}}');
echo <<<END
<table>
Copy link
Owner

Choose a reason for hiding this comment

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

showTableSorter() php func creates a <table class="dataGrid">... this one is double/useless so

As suggested by Epsy, no need to prevent "all" if its for the admin
phm87 referenced this pull request Mar 1, 2018
meant to detect socket leaks before its too late...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants