Changes: + present not-found page for unhandled uri paths, eg /stuff + display the tip-height on front page + add favicon and neptune logo to front page + use ServerDir instead of ServeFile for /image and /css + add help tooltips for fields on front page + use monospace font for digests
131 lines
3.8 KiB
HTML
131 lines
3.8 KiB
HTML
<html>
|
|
<head>
|
|
<title>Neptune Block Explorer: (network: {{self.state.network}})</title>
|
|
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
|
|
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png">
|
|
|
|
<script>
|
|
function handle_submit(form) {
|
|
let value = form.height_or_digest.value;
|
|
var is_digest = value.length == 80;
|
|
var type = is_digest ? "digest" : "height";
|
|
var uri = form.action + "/" + type + "/" + value;
|
|
window.location.href = uri;
|
|
return false;
|
|
}
|
|
function handle_utxo_submit(form) {
|
|
let value = form.utxo.value;
|
|
var uri = form.action + "/" + value;
|
|
window.location.href = uri;
|
|
return false;
|
|
}
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<header class="container">
|
|
<h1>
|
|
<img src="/image/neptune-logo.png" align="right"/>
|
|
Neptune Block Explorer (network: {{self.state.network}})
|
|
</h1>
|
|
The blockchain tip is at height: {{self.tip_height}}
|
|
</header>
|
|
|
|
<main class="container">
|
|
|
|
<article>
|
|
<details open>
|
|
<summary>
|
|
Block Lookup
|
|
</summary>
|
|
<form action="/block" method="get" onsubmit="return handle_submit(this)">
|
|
<span class="tooltip">🛈
|
|
<span class="tooltiptext">
|
|
Provide a numeric block height or hexadecimal digest identifier to lookup any block in the Neptune blockchain.
|
|
</span>
|
|
</span>
|
|
|
|
Block height or digest:
|
|
<input type="text" size="80" name="height_or_digest" class="mono"/>
|
|
<input type="submit" name="height" value="Lookup Block"/>
|
|
</form>
|
|
|
|
Quick Lookup:
|
|
<a href="/block/genesis">Genesis Block</a> |
|
|
<a href="/block/tip">Tip</a><br/>
|
|
</details>
|
|
</article>
|
|
|
|
<article>
|
|
<details open>
|
|
<summary>UTXO Lookup</summary>
|
|
<form action="/utxo" method="get" onsubmit="return handle_utxo_submit(this)">
|
|
<span class="tooltip">🛈
|
|
<span class="tooltiptext">
|
|
An Unspent Transaction Output (UTXO) index can be found in the output of <i>neptune-cli wallet-status</i>. Look for the field: <b>aocl_leaf_index</b>
|
|
</span>
|
|
</span>
|
|
UTXO index:
|
|
<input type="text" size="10" name="utxo" />
|
|
<input type="submit" name="height" value="Lookup Utxo" />
|
|
</form>
|
|
</details>
|
|
</article>
|
|
|
|
<article>
|
|
<details>
|
|
<summary>REST RPCs</summary>
|
|
<section>
|
|
RPC endpoints are available for automating block explorer queries:
|
|
</section>
|
|
|
|
<details>
|
|
<summary>/block_info</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/block_info/genesis">/rpc/block_info/genesis</a></li>
|
|
<li><a href="/rpc/block_info/tip">/rpc/block_info/tip</a></li>
|
|
<li><a href="/rpc/block_info/height/2">/rpc/block_info/height/2</a></li>
|
|
<li><a href="/rpc/block_info/digest/{{self.state.genesis_digest.to_hex()}}">/rpc/block_info/digest/{{self.state.genesis_digest.to_hex()}}</a></li>
|
|
<li><a href="/rpc/block_info/height_or_digest/1">/rpc/block_info/height_or_digest/1</a></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>/block_digest</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/block_digest/genesis">/rpc/block_digest/genesis</a></li>
|
|
<li><a href="/rpc/block_digest/tip">/rpc/block_digest/tip</a></li>
|
|
<li><a href="/rpc/block_digest/height/2">/rpc/block_digest/height/2</a></li>
|
|
<li><a href="/rpc/block_digest/digest/{{self.state.genesis_digest.to_hex()}}">/rpc/block_digest/digest/{{self.state.genesis_digest.to_hex()}}</a></li>
|
|
<li><a href="/rpc/block_digest/height_or_digest/{{self.state.genesis_digest.to_hex()}}">/rpc/block_digest/height_or_digest/{{self.state.genesis_digest.to_hex()}}</a></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>/utxo_digest</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/utxo_digest/2">/rpc/utxo_digest/2</a><br/></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
|
|
</details>
|
|
</article>
|
|
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|