-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathp2pool_stats.html
64 lines (56 loc) · 1.43 KB
/
p2pool_stats.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
// PUT YOUR P2POOL SERVER'S ADDRESS HERE:
var servaddr = 'http://10.0.1.210:9332';
$(document).ajaxError(function(event, request, settings, err) {
alert("error: " + settings.url + ": " + err.message);
});
$.get(servaddr + '/rate', function(data) {
$('#hashrate').html(data / 1000000000);
});
$.getJSON(servaddr + '/payout_addr', function(addr) {
$('#payout').html(addr);
$.getJSON(servaddr + '/current_payouts', function(pays) {
$('#amt').html(pays[addr]);
});
});
$.getJSON(servaddr + '/recent_blocks', function(blocks) {
for(i in blocks) {
var ts = new Date(1000 * blocks[i]['ts']);
var padded_hash = blocks[i]['hash'];
while(padded_hash.length < 64) {
padded_hash = '0' + padded_hash;
}
$('#blocks tr:last').after('<tr><td>' + ts.toString() +
'</td><td><a href="http://blockexplorer.com/block/'
+ padded_hash + '">' + padded_hash + '</a></td></tr>');
}
});
</script>
</head>
<body>
<h1>p2pool stats</h1>
<ul>
<li>
Total pool Ghash/sec: <span id="hashrate"></span>
</li>
<li>
My payout address: <span id="payout"></span>
</li>
<li>
Payout if block was found NOW: <span id="amt"></span> BTC
</li>
<li>
Recently found blocks: <br />
<table border="1" id="blocks">
<tr>
<th>time</th>
<th>hash</th>
</tr>
</table>
</li>
</ul>
</body>
</html>