Adds a 'Canonical' field to the /block page. note: this requires updating neptune-core in order to obtain the field from neptune-core's /block_info rpc endpoint. it was also necessary to change 'use neptune_core::<x>" statements to 'use neptune_cash::<x>'
97 lines
2.4 KiB
HTML
97 lines
2.4 KiB
HTML
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>{{self.header.state.config.site_name}}: Block Height {{self.block_info.height}}</title>
|
|
{{html_escaper::Trusted(include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/templates/web/html/components/head.html")))}}
|
|
</head>
|
|
|
|
<body>
|
|
{{Trusted(self.header.to_string())}}
|
|
|
|
<main class="container">
|
|
|
|
<article>
|
|
<h2>Block height: {{self.block_info.height}}</h2>
|
|
|
|
<!-- special_block_notice -->
|
|
%% if self.block_info.is_genesis {
|
|
<p>This is the genesis block</p>
|
|
%% }
|
|
%% if self.block_info.is_tip {
|
|
<p>This is the latest block (tip)</p>
|
|
%% }
|
|
|
|
<table class="striped">
|
|
<tr>
|
|
<td>Digest</td>
|
|
<td class="mono">{{self.block_info.digest.to_hex()}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Canonical
|
|
<span class="tooltip">🛈
|
|
<span class="tooltiptext">
|
|
The canonical blockchain is the chain with the most accumulated proof-of-work and is considered the official record of transaction history.
|
|
</span>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
%% if self.block_info.is_canonical {
|
|
This block is a link in the canonical blockchain.
|
|
%% } else {
|
|
This block is not in the canonical blockchain.
|
|
%% }
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Created</td>
|
|
<td>{{self.block_info.timestamp.standard_format()}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Inputs</td>
|
|
<td>{{self.block_info.num_inputs}}<br /></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Outputs</td>
|
|
<td>{{self.block_info.num_outputs}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Difficulty</td>
|
|
<td>{{self.block_info.difficulty}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Mining Reward</td>
|
|
<td>{{self.block_info.mining_reward}}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Fee</td>
|
|
<td>{{self.block_info.fee}}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</article>
|
|
|
|
<article>
|
|
|
|
<p>
|
|
<a href="/">Home</a>
|
|
| <a href='/block/genesis'>Genesis</a>
|
|
| <a href='/block/tip'>Tip</a>
|
|
%% if self.block_info.is_genesis {
|
|
| Previous Block
|
|
%% } else {
|
|
| <a href='/block/height/{{self.block_info.height.previous()}}'>Previous Block</a>
|
|
%% }
|
|
|
|
%% if self.block_info.is_tip {
|
|
| Next Block
|
|
%% } else {
|
|
| <a href='/block/height/{{self.block_info.height.next()}}'>Next Block</a>
|
|
%% }
|
|
</p>
|
|
|
|
</article>
|
|
</main>
|
|
</body>
|
|
</html>
|