fix(BUG-20): ElectrumX shows index size instead of "Building..."
When ElectrumX is indexing and can't accept TCP connections, the UI now shows the actual index size (e.g. "126.9 GB") in the Indexed Height field instead of a generic "Building..." label. Also shows the size in the status message for better progress visibility. Updated estimated full index size from 55GB to 130GB (2026 mainnet). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9d3a59e156
commit
4e65265ae8
@ -10,8 +10,8 @@ const ELECTRUMX_HOST: &str = "127.0.0.1";
|
||||
const ELECTRUMX_PORT: u16 = 50001;
|
||||
const BITCOIN_RPC_URL: &str = "http://127.0.0.1:8332/";
|
||||
const ELECTRUMX_DATA_DIR: &str = "/var/lib/archipelago/electrumx";
|
||||
// Approximate final index size in bytes for mainnet (~55GB for ElectrumX full index)
|
||||
const ESTIMATED_FULL_INDEX_BYTES: f64 = 55_000_000_000.0;
|
||||
// Approximate final index size in bytes for mainnet (~130GB for ElectrumX full index as of 2026)
|
||||
const ESTIMATED_FULL_INDEX_BYTES: f64 = 130_000_000_000.0;
|
||||
|
||||
/// Build Bitcoin RPC Basic auth header using shared credentials.
|
||||
async fn bitcoin_rpc_auth() -> String {
|
||||
|
||||
@ -367,11 +367,20 @@
|
||||
var networkH = data.network_height || 0;
|
||||
var pct = data.progress_pct || 0;
|
||||
|
||||
document.getElementById('indexedHeight').textContent = indexedH > 0 ? indexedH.toLocaleString() : (data.status === 'indexing' ? 'Building...' : '-');
|
||||
// Show indexed height, or index size when still building
|
||||
if (indexedH > 0) {
|
||||
document.getElementById('indexedHeight').textContent = indexedH.toLocaleString();
|
||||
document.getElementById('currentBlock').textContent = 'Block ' + indexedH.toLocaleString();
|
||||
} else if (data.index_size) {
|
||||
document.getElementById('indexedHeight').textContent = data.index_size;
|
||||
document.getElementById('currentBlock').textContent = 'Index: ' + data.index_size;
|
||||
} else {
|
||||
document.getElementById('indexedHeight').textContent = '-';
|
||||
document.getElementById('currentBlock').textContent = 'Block 0';
|
||||
}
|
||||
document.getElementById('networkHeight').textContent = networkH > 0 ? networkH.toLocaleString() : '-';
|
||||
document.getElementById('indexSize').textContent = data.index_size || '-';
|
||||
document.getElementById('progressPct').textContent = pct > 0 ? pct.toFixed(1) + '%' : '-';
|
||||
document.getElementById('currentBlock').textContent = indexedH > 0 ? 'Block ' + indexedH.toLocaleString() : (data.index_size ? 'Index: ' + data.index_size : 'Block 0');
|
||||
document.getElementById('syncPercentage').textContent = pct > 0 ? pct.toFixed(1) + '%' : '0%';
|
||||
document.getElementById('syncProgressBar').style.width = Math.max(pct, 0.5) + '%';
|
||||
|
||||
@ -380,12 +389,13 @@
|
||||
var syncIcon = document.getElementById('syncIcon');
|
||||
|
||||
if (data.status === 'indexing') {
|
||||
statusTextEl.textContent = data.error || 'Building index...';
|
||||
var indexMsg = data.index_size ? 'Building index (' + data.index_size + ')...' : 'Building index...';
|
||||
statusTextEl.textContent = indexMsg;
|
||||
statusTextEl.style.color = '#fbbf24';
|
||||
statusDot.className = 'status-dot bg-amber animate-pulse';
|
||||
document.getElementById('statusText').textContent = 'Indexing';
|
||||
syncIcon.classList.add('animate-spin-slow');
|
||||
document.getElementById('connSubtitle').textContent = 'Connections will be available once ElectrumX has completed syncing.';
|
||||
document.getElementById('connSubtitle').textContent = 'Wallet connections will be available once indexing completes. This can take several hours on first run.';
|
||||
} else if (data.status === 'error') {
|
||||
statusTextEl.textContent = data.error || 'Unknown error';
|
||||
statusTextEl.style.color = '#f87171';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user