consensus/cmd/web/templates/miner.html

254 lines
12 KiB
HTML

{% extends "base.html" %}
{% block title %} - Miner {{ miner.address }} {% endblock %}
{% block content %}
<div style="text-align: center; font-weight: bold;">
{% if refresh %}
<a href="/miner/{{ miner.address }}">Autorefresh is ON ({{ refresh }} s)</a>
{% else %}
<a href="/miner/{{ miner.address }}?refresh">Autorefresh is OFF</a>
{% endif %}
</div>
<div style="text-align: center">
{% if miner.last_share_timestamp == 0 %}
<div style="border: #d1d1d1 1px dashed;">
<h3 style="color:#FF4433">No shares have been reported to the P2Pool network in the past for this miner.</h3>
<p>Finding shares is a random process based on your hashrate vs P2Pool hashrate. This can take several days for low hashrate miners, and depending on your luck.</p>
<p>Please use the calculator below to find your average share time (with average luck).</p>
<br/>
<form action="/calculate-share-time" method="get">
<label for="hashrate">Your Hashrate</label><br/>
<input type="numeric" name="hashrate" id="hashrate" placeholder="100" size="8" class="mono" value=""/>
<select name="magnitude">
<option value="1" selected>H/s</option>
<option value="1000">KH/s</option>
<option value="1000000">MH/s</option>
<option value="1000000000">GH/s</option>
</select>
<br/>
<input type="submit" value="Calculate" style="width: 20em; margin: 20px;"/>
</form>
</div>
<hr/>
{% endif %}
{% if (last_raw_share is defined) and (last_raw_share.ShareVersion()|str != "v2") and (last_raw_share.ShareVersionSignaling()|str != "v2") %}
<div style="border: #d1d1d1 1px dashed;">
<h3 style="color:#FF4433" title="Share version {{ last_raw_share.ShareVersion() }}, signaling {{ last_raw_share.ShareVersionSignaling() }}">Recent shares indicate you are running an outdated version of P2Pool</h3>
<p>A new version of <a href="https://github.com/SChernykh/p2pool/releases/tag/v3.1">P2Pool (v3.0+)</a> has been released with several improvements, which requires a consensus change.</p>
<p>P2Pool (not Monero!) will hardfork to new consensus rules on <strong>March 18th, 2023 at 21:00 UTC</strong>. All versions before P2Pool v3.0 are incompatible. P2Pool v3.1 is recommended.</p>
<p>If you keep using previous versions, you will keep mining as usual, but become almost a solo miner, as incompatible clients will mine on their own.</p>
<p>{% if getenv('NET_SERVICE_ADDRESS') == "p2pool.observer" %}After the fork, you can check on <a href="https://old.p2pool.observer/miner/{{ miner.address }}">OLD.P2Pool.Observer</a>.{% elseif getenv('NET_SERVICE_ADDRESS') == "mini.p2pool.observer" %}After the fork, you can check on <a href="https://old-mini.p2pool.observer/miner/{{ miner.address }}">OLD-MINI.P2Pool.Observer</a>.{% else %}Please check on an observer tracking the old chain.{% endif %}</p>
<p>After upgrading to a supported P2Pool version and mine a share, this message will be dismissed.</p>
<br/>
</div>
<hr/>
{% endif %}
<h2>Miner statistics</h2>
<p><strong>Payout Address:</strong> <span class="mono small">{{ miner.address }}</span></p>
{% if miner.alias != "" %}
<p><strong>Miner Alias:</strong> <span class="mono">{{ miner.alias }}</span></p>
<p><small>Miner Alias is user content and not verified. This value should only be used for vanity purposes.</small></p>
{% endif %}
<table class="center" style="max-width: calc(15em + 15em + 15em + 15em)">
<tr>
<th>Last Share</th>
<th>Current Shares</th>
<th>Estimated Hashrate</th>
<th>Pool Share %</th>
</tr>
<tr>
<td title="{{ utc_date(miner.last_share_timestamp) }}">{{ time_elapsed_short(miner.last_share_timestamp) }}</td>
<td>{{ window_count_blocks }} blocks (+{{ window_count_uncles }} uncles)</td>
<td>{{ ((window_weight / pool.sidechain.window.weight|diff_int) * diff_hashrate(pool.sidechain.difficulty, pool.sidechain.block_time))|si_units(3) }}H/s</td>
<td>{{ (((window_weight / pool.sidechain.window.weight|diff_int))*100)|round(3) }}%</td>
</tr>
<tr><td colspan="4">&nbsp;</td></tr>
<tr>
<th>Total Shares</th>
<th>Day Shares</th>
<th>Day Hashrate</th>
<th>Day Share %</th>
</tr>
<tr>
<td>{{ miner.shares.blocks }} blocks (+{{ miner.shares.uncles }} uncles)</td>
<td>{{ count_blocks }} blocks (+{{ count_uncles }} uncles)</td>
<td>{{ ((weight / (pool.sidechain.window.weight|diff_int * 4)) * diff_hashrate(pool.sidechain.difficulty, pool.sidechain.block_time))|si_units(3) }}H/s</td>
<td>{{ (((weight / (pool.sidechain.window.weight|diff_int * 4)))*100)|round(3) }}%</td>
</tr>
</table>
</div>
<hr/>
<div style="text-align: center;">
<h2>Share positions</h2>
<p class="small">
Shares appear on the right, and get older towards the left. The pipe (<code>|</code>) character denotes the current PPLNS window end.
<br/>
Number denotes the amount of shares per slice, with the plus (<code>+</code>) character being more than 9, and dot (<code>.</code>) being none.
<br/>
Each slice accounts for {{ position_resolution }} P2Pool blocks, or around {{ (position_resolution * pool.sidechain.block_time) / 60 }} minutes.
</p>
<h3>Shares during last day</h3>
<code class="mono">{{ position_blocks }}</code>
<h3>Uncles during last day</h3>
<code class="mono">{{ position_uncles }}</code>
{% if count_payouts > 0 %}
<h3>Payouts during last day</h3>
<code class="mono">{{ position_payouts }}</code>
{% endif %}
</div>
<br/>
<br/>
<hr/>
<div style="text-align: center">
<h2>Most recent payouts</h2>
<table class="center datatable" style="max-width: calc(8em + 8em + 8em + 10em + 7em + 12em + 12em)">
<tr>
<th style="width: 8em;">Monero Height</th>
<th style="width: 8em;">P2Pool Height</th>
<th style="width: 8em;">Age <small>[h:m:s]</small></th>
<th style="width: 10em;">Reward</th>
<th style="width: 12em;">Coinbase Transaction</th>
<th style="width: 12em;" title="You can use this Private Key to verify payouts sent by P2Pool on each block through the Coinbase Transaction">Coinbase Tx Private Key</th>
</tr>
{% for p in last_payouts %}
<tr>
<th title="{{ p.main.id }}"><a href="/b/{{ p.main.height|benc }}">{{ p.main.height }}</a></th>
<th title="{{ p.id }}"><a href="/share/{{ p.id }}">{{ p.height }}</a></th>
<td title="{{ utc_date(p.timestamp) }}">{{ date_diff_short(p.timestamp) }}</td>
<td class="small">{{ monero_to_xmr(p.coinbase.reward) }} XMR</td>
<td title="{{ p.coinbase.id }}" class="mono small"><a href="/t/{{ p.coinbase.id|henc }}">{{ p.coinbase.id|shorten(10) }}</a></td>
<td class="mono smaller" title="{{ p.coinbase.private_key }}">{{ p.coinbase.private_key|shorten(10) }} <a href="/proof/{{ p.id }}/{{ p.coinbase.index }}" title="Prove you have a matching output for your address on this transaction">[[prove]]</a></td>
</tr>
{% endfor %}
<tr>
<th colspan="9"><a href="/payouts/{{ miner.address }}">[show all historical payouts]</a></th>
</tr>
</table>
</div>
<hr/>
<div style="text-align: center">
<h2>Most recent shares</h2>
<table class="center datatable" style="max-width: calc(8em + 12em + 8em + 8em + 8em + 12em)">
<tr>
<th style="width: 8em;">P2Pool Height</th>
<th style="width: 12em;">P2Pool Id</th>
<th style="width: 8em;">Monero Height</th>
<th style="width: 8em;">Age <small>[h:m:s]</small></th>
<th style="width: 8em;" title="Weight is the difficulty of mined share, with any uncle adjustments. It is variable, and is used in reward calculations">Weight</th>
<th style="width: 12em;">Valuation</th>
</tr>
{% for s in last_shares %}
<tr{% if s.main.found %} class="hl-found"{% endif %}>
<th><a href="/share/{{ s.id }}">{{ s.height }}</a></th>
<td class="mono smaller"><a href="/share/{{ s.id }}">{{ s.id|shorten(10) }}</a></td>
<td title="{{ s.main.id }}">{{ s.main.height }}</td>
<td title="{{ utc_date(s.timestamp) }}">{{ date_diff_short(s.timestamp) }}</td>
<td>{{ s.weight|si_units(1) }}</td>
<td>
{% if s.parent is defined %}
{{ 100 - pool.sidechain.uncle_penalty }}% (uncle)
{% else %}
100%
{% if (s.uncles is defined) and s.uncles|length > 0 %}
+ {{ pool.sidechain.uncle_penalty }}% of {{ s.uncles|length }} uncle(s)
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
<hr/>
<div style="text-align: center">
<h2>Most recent Monero blocks found</h2>
<table class="center datatable" style="max-width: calc(8em + 8em + 8em + 10em + 7em + 12em + 28em)">
<tr>
<th style="width: 8em;">Monero Height</th>
<th style="width: 8em;">P2Pool Height</th>
<th style="width: 8em;">Age <small>[h:m:s]</small></th>
<th style="width: 10em;">Total Reward</th>
<th style="width: 7em;" title="Number of miners that got paid on the Coinbase Transaction">Outputs</th>
<th style="width: 12em;">Coinbase Transaction</th>
<th style="width: 28em;" title="You can use this Private Key to verify payouts sent by P2Pool on each block through the Coinbase Transaction">Coinbase Tx Private Key</th>
</tr>
{% for b in last_found %}
<tr>
<th title="{{ b.main.id }}"><a href="/b/{{ b.main.height|benc }}">{{ b.main.height }}</a></th>
{% if b.parent.height is defined %}
<th title="{{ b.id }} is an uncle of height {{ b.parent.height }}, {{ b.parent.id }}">
<a href="/share/{{ b.id }}">{{ b.height }}*</a>
</th>
{% else %}
<th title="{{ b.id }}">
<a href="/share/{{ b.id }}">{{ b.height }}</a>
</th>
{% endif %}
<td title="{{ utc_date(b.timestamp) }}">{{ date_diff_short(b.timestamp) }}</td>
<th class="small">{{ monero_to_xmr(b.coinbase.reward) }} XMR</th>
<td>{{ b.coinbase.payouts|length }}</td>
<td title="{{ b.coinbase.id }}" class="mono small"><a href="/t/{{ b.coinbase.id|henc }}">{{ b.coinbase.id|shorten(10) }}</a></td>
<td class="mono smaller">{{ b.coinbase.private_key }}</td>
</tr>
{% endfor %}
<tr>
<th colspan="9"><a href="/blocks?miner={{ miner.address }}">[show more found blocks]</a></th>
</tr>
</table>
</div>
{% if miner.last_share_timestamp != 0 %}
<hr/>
<div style="text-align: center">
<form action="/api/miner_alias/{{ miner.address }}" method="get" target="_blank">
<h3>Set Miner Alias</h3>
<p>To set a miner alias you will need to sign a message using your wallet. On the Monero GUI, go to Advanced -> Sign/verify -> Select Mode "Message"</p>
<p>Enter the desired Miner Alias in Message, then press Sign Message. Copy the Signature and paste it on the field below, along with your chosen Miner Alias.</p>
<p><small>Miner Alias must be 4 to 20 characters long, and only 0-9, a-z, A-Z, and _-. are allowed, and cannot start with a number or symbol. No spaces are allowed either. Alias are unique for the observer instance.</small></p>
<p><small>You can remove your miner alias by using "REMOVE_MINER_ALIAS" as an alias.</small></p>
<div>
<label for="miner-alias">Miner Alias</label><br/>
<input type="text" name="message" id="miner-alias" size="20" class="mono"/>
</div>
<div>
<label for="signature">Signature</label><br/>
<input type="text" name="signature" id="signature" size="96" class="mono"/>
</div>
<div style="margin-top: 10px">
<input type="submit" value="Set Alias" style="width: 20em;"/>
</div>
</form>
</div>
{% endif %}
{% endblock %}