block.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>DarkFi Blocks - Block Explorer</title>
  7. <link rel="stylesheet" href="/static/layout.css">
  8. </head>
  9. <body>
  10. <header class="header">
  11. <div class="container flex justify-between items-center">
  12. <div class="logo"><span>Dark</span>Fi {{ network }} Blocks</div>
  13. <nav class="nav">
  14. <a href="/" class="active">Explorer</a>
  15. <a href="#">Stats</a>
  16. <a href="https://dark.fi/book/">Docs</a>
  17. <a href="https://codeberg.org/darkrenaissance/darkfi/">Code</a>
  18. </nav>
  19. </div>
  20. </header>
  21. <main class="container section">
  22. <div class="input-group mb-lg" style="max-width: 600px;">
  23. <input type="search" class="input" placeholder="Search by block height, hash, or transaction...">
  24. <button type="submit" class="btn">Search</button>
  25. </div>
  26. <div class="stats-grid mb-lg">
  27. <div class="stat-card">
  28. <div class="label">Difficulty</div>
  29. <div class="value">{{ current_difficulty }}</div>
  30. </div>
  31. <div class="stat-card">
  32. <div class="label">Height</div>
  33. <div class="value">{{ current_height }}</div>
  34. </div>
  35. <div class="stat-card">
  36. <div class="label">Hashrate</div>
  37. <div class="value">n/a</div>
  38. </div>
  39. <div class="stat-card">
  40. <div class="label">Emission</div>
  41. <div class="value">n/a</div>
  42. </div>
  43. </div>
  44. <div class="block-title mb-lg">
  45. <h1>
  46. Block
  47. {% if block.height != 0 %}
  48. <a href="/block/{{ block.height - 1 }}" class="block-nav">&lt</a>
  49. {% else %}
  50. <a href="/block/0" class="block-nav">&lt</a>
  51. {% endif %}
  52. {{ block.height }}
  53. <a href="/block/{{ block.height + 1 }}" class="block-nav">&gt;</a>
  54. </h1>
  55. <span class="block-hash">{{ block.hash }}</span>
  56. </div>
  57. <div class="table-section mb-lg">
  58. <div class="table-header">
  59. <h3>Block Info</h3>
  60. </div>
  61. <div class="table-wrapper">
  62. <table class="info-table">
  63. <tbody>
  64. <tr>
  65. <td class="info-label">Version</td>
  66. <td>{{ block.version }}</td>
  67. </tr>
  68. <tr>
  69. <td class="info-label">Previous Hash</td>
  70. <td><a href="/block/{{ block.height -1 }}" class="hash">{{ block.previous_hash }}</a></td>
  71. </tr>
  72. <tr>
  73. <td class="info-label">Height</td>
  74. <td>{{ block.height }}</td>
  75. </tr>
  76. <tr>
  77. <td class="info-label">Nonce</td>
  78. <td>{{ block.nonce }}</td>
  79. </tr>
  80. <tr>
  81. <td class="info-label">Timestamp</td>
  82. <td>{{ block.timestamp }}</td>
  83. </tr>
  84. <tr>
  85. <td class="info-label">Transactions Root</td>
  86. <td class="hash">{{ block.transactions_root }}</td>
  87. </tr>
  88. <tr>
  89. <td class="info-label">State Root</td>
  90. <td class="hash">{{ block.state_root }}</td>
  91. </tr>
  92. <tr>
  93. <td class="info-label">Block Size (bytes)</td>
  94. <td>{{ block.size }}</td>
  95. </tr>
  96. <tr>
  97. <td class="info-label">Block Difficulty</td>
  98. <td>{{ block.difficulty }}</td>
  99. </tr>
  100. <tr>
  101. <td class="info-label">Cumulative Difficulty</td>
  102. <td>{{ block.cumulative }}</td>
  103. </tr>
  104. <tr>
  105. <td class="info-label">Transactions</td>
  106. <td>{{ block.n_txs }}</td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. </div>
  111. </div>
  112. {% if block.powtype == "Monero" %}
  113. <div class="table-section mb-lg pow-monero">
  114. <div class="table-header">
  115. <h3>PoW Data</h3>
  116. <span class="badge badge-monero">Merge Mined · Monero</span>
  117. </div>
  118. <div class="table-wrapper">
  119. <table class="info-table">
  120. <tbody>
  121. <tr>
  122. <td class="info-label">Monero Block Hash</td>
  123. <td><a href="https://localmonero.co/blocks/block/{{ monero_hash }}" target="_blank" class="hash hash-monero">{{ monero_hash }}</a></td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </div>
  128. </div>
  129. {% else %}
  130. <div class="table-section mb-lg pow-native">
  131. <div class="table-header">
  132. <h3>PoW Data</h3>
  133. <span class="badge">Native · DarkFi</span>
  134. </div>
  135. <div class="pow-native-info">
  136. <span class="text-muted">Native DarkFi proof-of-work</span>
  137. </div>
  138. </div>
  139. {% endif %}
  140. <div class="table-section mb-lg">
  141. <div class="table-header">
  142. <h3>Coinbase Transaction</h3>
  143. </div>
  144. <div class="table-wrapper">
  145. <table>
  146. <thead>
  147. <tr>
  148. <th>Hash</th>
  149. <th>Amount</th>
  150. <th>Bytes</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr>
  155. <td><a href="/tx/{{ block.coinbase.hash }}" class="hash">{{ block.coinbase.hash }}</a></td>
  156. <td>{{ block.coinbase.reward }}</td>
  157. <td>{{ block.coinbase.size }}</td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. </div>
  162. </div>
  163. <div class="table-section">
  164. <div class="table-header">
  165. <h3>Transactions ({{ block.n_txs }})</h3>
  166. </div>
  167. <div class="table-scroll">
  168. <table>
  169. <thead>
  170. <tr>
  171. <th>Hash</th>
  172. <th>Calls</th>
  173. <th>Fee</th>
  174. <th>Bytes</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. {% for tx in block.txs %}
  179. <tr>
  180. <td><a href="/tx/{{ tx.hash }}" class="hash">{{ tx.hash }}</a></td>
  181. <td>{{ tx.n_calls }}</td>
  182. <td>{{ tx.fee }}</td>
  183. <td>{{ tx.size }}</td>
  184. </tr>
  185. {% endfor %}
  186. </tbody>
  187. </table>
  188. </div>
  189. </div>
  190. </main>
  191. <footer class="footer">
  192. <div class="container">
  193. <a href="https://dark.fi">Let there be Dark</a> · Code licensed under AGPL-3
  194. </div>
  195. </footer>
  196. </body>
  197. </html>