Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

246 Zeilen
8.8KB

  1. ul(class='nav nav-tabs mb-3')
  2. li(class="nav-item")
  3. a(data-toggle="tab", href="#tab-summary", class="nav-link active", role="tab") Summary
  4. li(class="nav-item")
  5. a(data-toggle="tab", href="#tab-raw", class="nav-link", role="tab") Raw
  6. - var txCount = result.getblock.tx.length;
  7. div(class="tab-content")
  8. div(id="tab-summary", class="tab-pane active", role="tabpanel")
  9. table(class="table")
  10. tr
  11. th(class="table-active properties-header") Block Hash
  12. td(class="monospace")
  13. a(href=("/block/" + result.getblock.hash)) #{result.getblock.hash}
  14. tr
  15. th(class="table-active properties-header") Previous Block Hash
  16. td(class="monospace")
  17. if (result.getblock.previousblockhash)
  18. a(href=("/block/" + result.getblock.previousblockhash)) #{result.getblock.previousblockhash}
  19. tr
  20. th(class="table-active properties-header") Next Block Hash
  21. td(class="monospace")
  22. if (result.getblock.nextblockhash)
  23. a(href=("/block/" + result.getblock.nextblockhash)) #{result.getblock.nextblockhash}
  24. else
  25. span None
  26. span(class="text-muted") (latest block)
  27. tr
  28. th(class="table-active properties-header") Block Height
  29. td(class="monospace")
  30. a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height}
  31. tr
  32. th(class="table-active properties-header") Timestamp
  33. td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
  34. tr
  35. th(class="table-active properties-header") Transaction Count
  36. td(class="monospace") #{result.getblock.tx.length.toLocaleString()}
  37. tr
  38. th(class="table-active properties-header") Size
  39. td(class="monospace")
  40. span #{result.getblock.size.toLocaleString()} bytes
  41. if (result.getblock.weight)
  42. br
  43. span(class="text-muted") (weight: #{result.getblock.weight.toLocaleString()})
  44. tr
  45. th(class="table-active properties-header") Confirmations
  46. td(class="monospace")
  47. if (result.getblock.confirmations < 6)
  48. strong(class="text-warning") #{result.getblock.confirmations}
  49. else
  50. strong(class="text-success") #{result.getblock.confirmations.toLocaleString()}
  51. tr
  52. - var scales = [ {val:1000000000000000, name:"quadrillion"}, {val:1000000000000, name:"trillion"}, {val:1000000000, name:"billion"}, {val:1000000, name:"million"} ];
  53. - var scaleDone = false;
  54. th(class="table-active properties-header") Difficulty
  55. td(class="monospace")
  56. span #{result.getblock.difficulty.toLocaleString()}
  57. each item in scales
  58. if (!scaleDone)
  59. - var fraction = Math.floor(result.getblock.difficulty / item.val);
  60. if (fraction >= 1)
  61. - scaleDone = true;
  62. span(class="text-muted") (#{fraction} #{item.name})
  63. tr
  64. th(class="table-active text-right") Version
  65. td(class="monospace") 0x#{result.getblock.versionHex}
  66. span(class="text-muted") (decimal: #{result.getblock.version})
  67. tr
  68. th(class="table-active text-right") Nonce
  69. td(class="monospace") #{result.getblock.nonce}
  70. tr
  71. th(class="table-active text-right") Bits
  72. td(class="monospace") #{result.getblock.bits}
  73. tr
  74. th(class="table-active text-right") Merkle Root
  75. td(class="monospace") #{result.getblock.merkleroot}
  76. tr
  77. th(class="table-active text-right") Chainwork
  78. td(class="monospace") #{result.getblock.chainwork}
  79. hr
  80. h2(class="h4") Transactions (#{txCount.toLocaleString()})
  81. small - Showing
  82. if (txCount <= limit)
  83. span all
  84. else
  85. span #{(offset + 1)} - #{Math.min(offset + limit, txCount)}
  86. each tx, txIndex in result.transactions
  87. //pre
  88. // code #{JSON.stringify(tx, null, 4)}
  89. div(class="card mb-3")
  90. div(class="card-header")
  91. if (tx && tx.txid)
  92. a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid}
  93. else if (result.getblock.height == 0)
  94. a(href=(""), class="monospace") #{result.getblock.tx}
  95. div(class="card-body")
  96. //pre
  97. // code #{JSON.stringify(result.txInputsByTransaction[tx.txid], null, 4)}
  98. if (tx && tx.txid)
  99. div(class="row")
  100. div(class="col-md-6")
  101. h6 Input (#{tx.vin.length.toLocaleString()})
  102. if (result.txInputsByTransaction[tx.txid])
  103. - var totalInputValue = new Decimal(0);
  104. table(class="table mb-0")
  105. thead
  106. tr
  107. th(style="width: 40px;")
  108. th Input
  109. th Amount
  110. tbody
  111. if (tx.vin[0].coinbase)
  112. - totalInputValue = totalInputValue.plus(new Decimal(utils.getBlockReward(result.getblock.height)));
  113. tr
  114. th 1
  115. td
  116. span(class="tag monospace") coinbase
  117. span(class="monospace") Newly minted VIVO
  118. td(class="monospace") Σ #{utils.getBlockReward(result.getblock.height)}
  119. each txInput, txInputIndex in result.txInputsByTransaction[tx.txid]
  120. if (txInput)
  121. - var vout = txInput.vout[tx.vin[txInputIndex].vout];
  122. tr
  123. th #{(txInputIndex + 1)}
  124. //pre
  125. // code #{JSON.stringify(txInput)}
  126. td
  127. if (vout.scriptPubKey && vout.scriptPubKey.addresses)
  128. span(class="monospace") #{vout.scriptPubKey.addresses[0]}
  129. br
  130. span(class="monospace text-muted") via tx
  131. a(href=("/tx/" + txInput.txid + "#output-" + tx.vin[txInputIndex].vout), class="monospace") #{txInput.txid.substring(0, 14)}..., Output ##{tx.vin[txInputIndex].vout + 1}
  132. td
  133. if (vout.value)
  134. - totalInputValue = totalInputValue.plus(new Decimal(vout.value));
  135. span(class="monospace") Σ #{vout.value}
  136. - var coinbaseCount = tx.vin[0].coinbase ? 1 : 0;
  137. if ((tx.vin.length - coinbaseCount) > result.txInputsByTransaction[tx.txid].length)
  138. tr
  139. td
  140. td
  141. //span(class="monospace text-muted") #{(tx.vin.length - result.txInputsByTransaction[tx.txid].length).toLocaleString()} : click on transaction id for all ...
  142. //span(class="monospace text-muted") a(href=("/tx/" + tx.txid), click on transaction id for all ....)}
  143. //a(href=""/tx/" + #{tx.txid}", class="nav-link") more ... #{tx.txid}
  144. //a(href=("/tx/" + tx.txid), class="monospace") #{tx.txid}
  145. //span(class="monospace text-muted") #{(tx.vin.length - result.txInputsByTransaction[tx.txid].length).toLocaleString()}:
  146. span(class="monospace text-muted") #{tx.vin.length.toLocaleString()}:
  147. //a(href=("/tx/" + tx.txid), class="monospace")
  148. a(href=("/tx/" + tx.txid), class="monospace") Go to all #{tx.vin.length.toLocaleString()}
  149. td
  150. else
  151. tr
  152. td
  153. td
  154. td
  155. strong(class="monospace") Σ #{totalInputValue}
  156. div(class="col-md-6")
  157. h6 Output (#{tx.vout.length.toLocaleString()})
  158. - var totalOutputValue = new Decimal(0);
  159. table(class="table mb-0")
  160. thead
  161. tr
  162. th
  163. th Output
  164. th Amount
  165. tbody
  166. each vout, voutIndex in tx.vout
  167. tr
  168. th #{(voutIndex + 1)}
  169. td
  170. if (vout.scriptPubKey)
  171. if (vout.scriptPubKey.addresses)
  172. a(id="output-" + voutIndex)
  173. span(class="monospace") #{vout.scriptPubKey.addresses[0]}
  174. else if (vout.scriptPubKey.hex && vout.scriptPubKey.hex.startsWith('6a24aa21a9ed'))
  175. span(class="monospace") Segregated Witness committment -
  176. a(href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure") docs
  177. i(class="fa fa-external-link")
  178. else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN '))
  179. span(class="monospace") OP_RETURN:
  180. span(class="monospace text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))}
  181. td
  182. span(class="monospace") Σ #{vout.value}
  183. - totalOutputValue = totalOutputValue.plus(vout.value);
  184. tr
  185. td
  186. td
  187. td
  188. strong(class="monospace") Σ #{totalOutputValue}
  189. else if (result.getblock.height == 0)
  190. table(class="table mb-0")
  191. thead
  192. tr
  193. th(style="text-align: center;") Genesis
  194. //pre
  195. // code #{JSON.stringify(tx, null, 4)}
  196. if (txCount > limit)
  197. - var pageNumber = offset / limit + 1;
  198. - var pageCount = Math.floor(txCount / limit);
  199. - if (pageCount * limit < txCount) {
  200. - pageCount++;
  201. - }
  202. - var paginationUrlFunction = function(x) {
  203. - return paginationBaseUrl + "?limit=" + limit + "&offset=" + ((x - 1) * limit);
  204. - }
  205. hr
  206. include ./pagination.pug
  207. div(id="tab-raw", class="tab-pane", role="tabpanel")
  208. pre
  209. code #{JSON.stringify(result.getblock, null, 4)}