Bendras tekstas

AI Chat
[{"role": "user", "content": "Go beaconchain Ethereum BLS html grafana"}, {"role": "assistant", "content": "Here is a complete, standalone HTML dashboard that visualizes Ethereum Beacon Chain BLS (BLS12-381) data using **Grafana-compatible** styling principles (dark theme, clean metrics) and fetches live data from the **Ethereum Beaconcha.in API**.\n\n### Features:\n1. **Live Metrics:** Validator count, ETH staked, Average BLS PubKey length, and Epoch status.\n2. **BLS Specifics:** Shows the current Epoch, Slot, and Aggregate Signature stats.\n3. **Visuals:** Uses Chart.js for a simulated \"Block Proposals\" graph (since raw historical BLS data is heavy, this shows a representative pattern).\n4. **Dark Mode:** Styled to look like a professional Grafana panel.\n\n### How to use:\n1. Save the code below as `beacon-bls-dashboard.html`.\n2. Open it in any web browser.\n3. It pulls live data from `beaconcha.in`'s public API.\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Ethereum Beacon Chain BLS Monitor</title>\n <!-- Chart.js for Graphing -->\n <script src=\"https://cdn.jsdelivr.net/npm/chart.js\"></script>\n <style>\n :root {\n --bg-color: #1e1e1e;\n --panel-bg: #2a2a2a;\n --text-primary: #e0e0e0;\n --text-secondary: #a0a0a0;\n --accent-blue: #0d6efd;\n --accent-purple: #6f42c1;\n --accent-green: #28a745;\n --border-color: #444;\n }\n\n body {\n font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n background-color: var(--bg-color);\n color: var(--text-primary);\n margin: 0;\n padding: 20px;\n }\n\n .dashboard-container {\n max-width: 1200px;\n margin: 0 auto;\n }\n\n header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n border-bottom: 1px solid var(--border-color);\n padding-bottom: 10px;\n }\n\n h1 {\n margin: 0;\n font-size: 1.5rem;\n color: var(--accent-blue);\n }\n\n .status-badge {\n background-color: var(--accent-green);\n color: white;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 0.8rem;\n font-weight: bold;\n }\n\n /* Grid Layout */\n .grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 20px;\n margin-bottom: 20px;\n }\n\n .card {\n background-color: var(--panel-bg);\n border-radius: 8px;\n padding: 20px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.3);\n border: 1px solid var(--border-color);\n }\n\n .card-title {\n color: var(--text-secondary);\n font-size: 0.9rem;\n text-transform: uppercase;\n letter-spacing: 1px;\n margin-bottom: 10px;\n }\n\n .metric-value {\n font-size: 2rem;\n font-weight: bold;\n color: var(--text-primary);\n }\n\n .metric-sub {\n font-size: 0.85rem;\n color: var(--accent-green);\n margin-top: 5px;\n }\n\n /* Full Width Card */\n .full-width {\n grid-column: 1 / -1;\n }\n\n /* Table Styles */\n table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 10px;\n }\n\n th, td {\n text-align: left;\n padding: 12px;\n border-bottom: 1px solid var(--border-color);\n }\n\n th {\n color: var(--text-secondary);\n font-weight: 600;\n }\n\n tr:hover {\n background-color: #333;\n }\n\n .hash-cell {\n font-family: monospace;\n color: var(--accent-purple);\n cursor: pointer;\n }\n\n .hash-cell:hover {\n text-decoration: underline;\n }\n\n /* Loader */\n .loader {\n text-align: center;\n padding: 20px;\n color: var(--text-secondary);\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .grid {\n grid-template-columns: 1fr;\n }\n }\n </style>\n</head>\n<body>\n\n<div class=\"dashboard-container\">\n <header>\n <h1>Ethereum Beacon Chain <span style=\"color:var(--accent-purple)\">BLS</span> Monitor</h1>\n <div id=\"connection-status\" class=\"status-badge\">Connecting...</div>\n </header>\n\n <!-- Top Metrics Row -->\n <div class=\"grid\">\n <div class=\"card\">\n <div class=\"card-title\">Active Validators (BLS)</div>\n <div id=\"validator-count\" class=\"metric-value\">Loading...</div>\n <div class=\"metric-sub\">~<span id=\"eth-staked\">0</span> ETH Staked</div>\n </div>\n <div class=\"card\">\n <div class=\"card-title\">Current Epoch</div>\n <div id=\"current-epoch\" class=\"metric-value\">Loading...</div>\n <div class=\"metric-sub\">Slot: <span id=\"current-slot\">...</span></div>\n </div>\n <div class=\"card\">\n <div class=\"card-title\">Avg BLS PubKey Size</div>\n <div id=\"avg-pubkey-size\" class=\"metric-value\">96 bytes</div>\n <div class=\"metric-sub\">BLS12-381 Standard</div>\n </div>\n </div>\n\n <!-- Main Chart Area -->\n <div class=\"grid\">\n <div class=\"card full-width\">\n <div class=\"card-title\">Recent Block Proposals (BLS Signatures Verified)</div>\n <canvas id=\"proposalsChart\" height=\"100\"></canvas>\n </div>\n </div>\n\n <!-- Recent Blocks Table -->\n <div class=\"grid\">\n <div class=\"card full-width\">\n <div class=\"card-title\">Latest Attestations & Proposals</div>\n <table>\n <thead>\n <tr>\n <th>Slot</th>\n <th>Proposer</th>\n <th>BLS Signature</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody id=\"recent-blocks-body\">\n <tr>\n <td colspan=\"4\" class=\"loader\">Fetching latest beacon chain data...</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</div>\n\n<script>\n // Configuration\n const API_BASE = 'https://beaconcha.in/api/v1';\n \n // DOM Elements\n const elValidatorCount = document.getElementById('validator-count');\n const elEthStaked = document.getElementById('eth-staked');\n const elEpoch = document.getElementById('current-epoch');\n const elSlot = document.getElementById('current-slot');\n const elStatus = document.getElementById('connection-status');\n const elTableBody = document.getElementById('recent-blocks-body');\n const ctx = document.getElementById('proposalsChart').getContext('2d');\n\n // State\n let chartInstance = null;\n\n // Initialize\n async function init() {\n try {\n await fetchStats();\n await fetchRecentBlocks();\n elStatus.textContent = \"Live\";\n elStatus.style.backgroundColor = \"var(--accent-green)\";\n } catch (error) {\n console.error(\"Fetch error:\", error);\n elStatus.textContent = \"Error\";\n elStatus.style.backgroundColor = \"red\";\n elValidatorCount.innerHTML = \"<small>API Limit/Offline</small>\";\n }\n }\n\n // Fetch Global Stats (Validators & Epoch)\n async", "model": "Qwen/Qwen3-30B-A3B-Instruct"}]

Pasidalinti šiuo AI Chat:
Originalus pavedimas
Beaconchain Ethereum BLS Grafana
8 hours, 47 minutes prieš 0 žetonai

Sukurti savo AI pokalbio atsakymas

Free.ai turi 477 AI įrankius. Nėra užsiregistravimo, kredito kortelės. Chat kartu su 581 AI modeliais.

Pabandykite šį užklausą

Like this tool? Share it!

Vertinti šį bendrą rezultatą