diff --git a/README.md b/README.md index ce714f6..2e7c0ca 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ -# ![BTC RPC Explorer](public/img/logo/logo-64.png) +# ![BTC RPC Explorer](public/img/logo/logo-64.png) BTC RPC Explorer -# BTC RPC Explorer - -Simple, stateless Bitcoin blockchain explorer, via RPC. Build with Node.js, express, bootstrap-v4. +Simple, stateless Bitcoin blockchain explorer, via RPC. Built with Node.js, express, bootstrap-v4. This tool is intended to be a simple, stateless, self-hosted explorer for the Bitcoin blockchain, driven by RPC calls to your own bitcoind node. Because it is stateless, it is easy to run but lacks some (many?) of the features of other explorers. +# Features + +* List of recent blocks +* Browse blocks by height, in ascending or descending order +* View block details +* View transaction details, with navigation backward via spent outputs +* View raw JSON output used to generate most pages + # Getting started ## Prerequisites @@ -39,5 +45,5 @@ This tool is intended to be a simple, stateless, self-hosted explorer for the Bi ### Transaction, Raw JSON # ![Connect](public/img/screenshots/transaction-raw.png) -### List of all Blocks +### List of Blocks by height (in ascending order) # ![Connect](public/img/screenshots/blocks.png) diff --git a/views/transaction.pug b/views/transaction.pug index a73f4f2..03693e4 100644 --- a/views/transaction.pug +++ b/views/transaction.pug @@ -14,8 +14,10 @@ block content a(href="/") strong #{host} span :#{port} - li(class="breadcrumb-item") - a(href=("/block/" + result.getrawtransaction.blockhash)) Block #{result.getblock.height} + + if (result.getrawtransaction.blockhash) + li(class="breadcrumb-item") + a(href=("/block/" + result.getrawtransaction.blockhash)) Block #{result.getblock.height} li(class="breadcrumb-item active") Transaction h1(class="h2") Transaction @@ -60,12 +62,21 @@ block content tr th(class="table-active properties-header") Included in Block td - a(href=("/block/" + result.getrawtransaction.blockhash)) #{result.getrawtransaction.blockhash} - span(class="text-muted") (#{result.getblock.height}) + if (result.getblock) + a(href=("/block/" + result.getrawtransaction.blockhash)) #{result.getrawtransaction.blockhash} + if (result.getblock.height) + span(class="text-muted") (#{result.getblock.height}) + else + span N/A + span(class="text-muted") (unconfirmed) tr th(class="table-active properties-header") Timestamp - td #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} (utc) + if (result.getrawtransaction.time) + td #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} (utc) + else + td N/A + span(class="text-muted") (unconfirmed) //tr // th(class="table-active properties-header") Transaction ID @@ -107,8 +118,8 @@ block content tr th(class="table-active properties-header") Confirmations td - if (result.getrawtransaction.confirmations == 0) - strong(class="text-danger") #{result.getrawtransaction.confirmations} (Unconfirmed!) + if (!result.getrawtransaction.confirmations || result.getrawtransaction.confirmations == 0) + strong(class="text-danger") 0 (unconfirmed) else if (result.getrawtransaction.confirmations < 6) strong(class="text-warning") #{result.getrawtransaction.confirmations} else @@ -268,4 +279,4 @@ block content //pre #{JSON.stringify(result.txInputs, null, 4)} - \ No newline at end of file +