Merge pull request #14 from cmgustavo/feature/transaction-page
great job!
This commit is contained in:
commit
9c7239e740
40
README.md
40
README.md
|
@ -45,26 +45,34 @@ $ npm install -g bower
|
||||||
|
|
||||||
http://localhost:3000
|
http://localhost:3000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
Get bitcore from github repository:
|
|
||||||
$ git clone https://github.com/bitpay/bitcore.git
|
|
||||||
$ cd bitcore
|
|
||||||
$ npm install
|
|
||||||
|
|
||||||
Run sync from mystery repository:
|
|
||||||
$ utils/sync.js
|
|
||||||
|
|
||||||
check utils/sync.js --help for options.
|
|
||||||
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
A REST API is provided at /api. The entry points are:
|
A REST API is provided at /api. The entry points are:
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
Get bitcore from github repository:
|
||||||
|
|
||||||
|
$ git clone https://github.com/bitpay/bitcore.git
|
||||||
|
|
||||||
|
$ cd bitcore
|
||||||
|
|
||||||
|
$ npm install
|
||||||
|
|
||||||
|
Then create a symbolic link from this to your mystery repository. We need to
|
||||||
|
use bitcore from github, not with npm for now:
|
||||||
|
|
||||||
|
$ cd mystery/node_modules
|
||||||
|
|
||||||
|
$ rm -R bitcore
|
||||||
|
|
||||||
|
$ ln -s <path-to-your-clone-repositoy>/bitcore
|
||||||
|
|
||||||
|
Run sync from mystery repository (to save blocks in MongoDB):
|
||||||
|
|
||||||
|
$ utils/sync.js
|
||||||
|
|
||||||
|
Check utils/sync.js --help for options.
|
||||||
|
|
||||||
### Blocks
|
### Blocks
|
||||||
```
|
```
|
||||||
/api/block/[:hash]
|
/api/block/[:hash]
|
||||||
|
|
|
@ -1,32 +1,101 @@
|
||||||
<section data-ng-controller="transactionsController" data-ng-init="findOne()">
|
<section data-ng-controller="transactionsController" data-ng-init="findOne()">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>Transaction <small>View information about a bitcoin transaction</small></h1>
|
<h1>
|
||||||
|
<span class="glyphicon glyphicon-transfer"> </span>
|
||||||
|
<a href="/#!/tx/{{tx.txid}}" title="{{tx.txid}}">Transaction</a>
|
||||||
|
<small>View information about a bitcoin transaction</small>
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
|
||||||
<li>{{tx.txid}}</li>
|
<table class="table table-striped">
|
||||||
<li>VIN
|
<thead>
|
||||||
<ul data-ng-repeat="vin in tx.vin">
|
<tr>
|
||||||
<li>coinbase: {{vin.coinbase}}</li>
|
<th>Input</th>
|
||||||
<li>sequence: {{vin.sequence}}</li>
|
<th> </th>
|
||||||
<li>txid: {{vin.txid}}</li>
|
<th>Output</th>
|
||||||
<li>vout: {{vin.vout}}</li>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="45%">
|
||||||
|
<ul class="list-unstyled" data-ng-repeat="vin in tx.vin" data-ng-show="!tx.isCoinBase">
|
||||||
|
<li><a href="/#!/address/{{vin.addr}}">{{vin.addr}}</a> <span class="pull-right badge">{{vin.value}} BTC</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
<div data-ng-show="tx.isCoinBase">
|
||||||
<li>VOUT
|
No Inputs (Newly Generated isCoinBasens)
|
||||||
<ul data-ng-repeat="vout in tx.vout">
|
</div>
|
||||||
<li>value: {{vout.value}}</li>
|
</td>
|
||||||
<li>n: {{vout.n}}</li>
|
<td width="10%" style="text-align: center;"><span class="glyphicon glyphicon-chevron-right"> </span></td>
|
||||||
<li>addresses: {{vin.scriptPubKey}}
|
<td width="45%">
|
||||||
<ul data-ng-repeat="addr in vout.scriptPubKey.addresses">
|
<div data-ng-repeat="vout in tx.vout">
|
||||||
<li>address: {{addr}}</li>
|
<ul class="list-unstyled" data-ng-repeat="addr in vout.scriptPubKey.addresses">
|
||||||
</ul>
|
<li><a href="/#!/address/{{addr}}">{{addr}}</a> <span class="pull-right badge">{{vout.value}} BTC</span></li>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>Blockhash: <a href="#!/block/{{tx.blockhash}}">{{tx.blockhash}}</a></li>
|
|
||||||
<li>Confirmations: {{tx.confirmations}}</li>
|
|
||||||
<li>Time {{tx.time}}</li>
|
|
||||||
<li>Bloctime {{tx.blocktime}}</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" style="text-align: right;">
|
||||||
|
<button type="button" class="btn btn-primary">{{tx.confirmations}} Confirmations</button>
|
||||||
|
<button type="button" class="btn btn-success">{{tx.valueOut}} BTC</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">Summary</h3>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Size</td>
|
||||||
|
<td>{{tx.size}} (bytes)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Received Time</td>
|
||||||
|
<td>{{tx.time * 1000|date:'medium'}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Reward From Block</td>
|
||||||
|
<td><a href="/#!/block/{{tx.blockhash}}">Need height to show (it links to block page)</a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="panel panel-default" data-ng-show="!tx.isCoinBase">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">Inputs and Outputs</h3>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Total Input</td>
|
||||||
|
<td>{{tx.valueIn}} BTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Total Output</td>
|
||||||
|
<td>{{tx.valueOut}} BTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Fees</td>
|
||||||
|
<td>{{tx.feeds}} BTC</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue