Add best share analysis page, miner column, and UI improvements

- Best share page: hex + binary hash comparison against network target,
  per-bit coloring showing exactly which bits prevented a valid block,
  toggle between network diff at time of finding vs current diff
- Capture best share hash from ckpool logs with one-time backfill
- Persist network difficulty at time of best share for historical accuracy
- Add miner (worker) column to blocks table via coinbase address matching
- Truncate block hashes in table with full hash on hover
- Increase hashrate chart Y-axis to 7 ticks for better readability
This commit is contained in:
satoshi
2026-05-18 17:19:35 +03:00
parent f1dc0a8a79
commit 1157f3501a
17 changed files with 1499 additions and 81 deletions
+16 -2
View File
@@ -222,8 +222,13 @@ type BlockTx struct {
}
type BlockVout struct {
Value float64 `json:"value"`
N int `json:"n"`
Value float64 `json:"value"`
N int `json:"n"`
ScriptPubKey BlockScriptPubKey `json:"scriptPubKey"`
}
type BlockScriptPubKey struct {
Address string `json:"address"`
}
// GetBlock returns a verbose-level-2 block decode for the given hash.
@@ -249,6 +254,15 @@ func (b *BlockVerbose2) CoinbaseReward() float64 {
return total
}
// CoinbaseAddress returns the address of the first coinbase output.
// In ckpool-solo mode this is the miner's BTC payout address.
func (b *BlockVerbose2) CoinbaseAddress() string {
if len(b.Tx) == 0 || len(b.Tx[0].Vout) == 0 {
return ""
}
return b.Tx[0].Vout[0].ScriptPubKey.Address
}
// NetworkHashPS returns the network hashrate at the given block height.
// `blocks` is a window (default 120). Pass -1 to use the default.
func (c *RPC) GetNetworkHashPS(ctx context.Context, blocks, height int) (float64, error) {