Skip to content

dashpay/evoblocks_distribution_visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Platform Explorer Visualizer (egui)

Visual desktop app that pulls validator and block header data from Dash Platform Explorer’s HTTP API and visualizes the Gaussian-like distribution of proposed blocks per validator over selectable windows.

Features

  • Timeframes: last 1 month, 3 months, 1 year.
  • Uptime proxy filter: only validators that appear near both the start and end of the window (configurable grace days) are included.
  • Histogram + normal fit: shows mean/std; overlays a scaled normal curve.
  • Goodness-of-fit: chi-square statistic and p-value.
  • Z-scores: top/bottom validators by z-score.
  • Search: type a pro_tx_hash (full or prefix) to highlight its bar and show its count.
  • Local persistence: caches data in a bundled SQLite DB (visualizer.db).

API

  • Base (testnet / production): https://platform-explorer.pshenmic.dev
  • Endpoints used:
    • GET /validators?page=&limit=
    • GET /blocks?page=&limit= (returns block header with timestamp and validator proTxHash)

Requirements

  • Rust toolchain (Rust 1.77+ recommended).
  • macOS, Linux, or Windows. Uses eframe/egui + OpenGL via glow.

Build & Run

  • Build:
    • cd platform_explorer_visualizer
    • cargo build
  • GUI app:
    • cargo run
    • Click “Sync data” to fetch (binary-searched to ~last year for speed), pick timeframe, adjust presence window, then “Recompute”.
    • Use the “Search pro_tx_hash” box to highlight and read the selected node’s count.
  • Headless sync + quick summary (optional):
    • cargo run --bin sync

Data Storage

  • SQLite database file visualizer.db is created in the current working directory.
  • Tables:
    • validators(pro_tx_hash, is_active, proposed_blocks_amount)
    • blocks(height, ts_utc, validator)

Uptime Filter (Approximation)

  • The API does not expose an explicit validator uptime over windows. We approximate by keeping validators that proposed at least one block within N days after the window start and at least one within N days before the window end (N is configurable; default 7 days).

Performance Notes

  • Sync uses conservative paging limits and retry logic to avoid server 500s/timeouts.
  • Initial block sync jumps directly to the page covering ~last year via binary search, then backfills new data only.
  • Subsequent syncs are incremental (based on last stored block height).

Project Layout

  • platform_explorer_visualizer/ crate with:
    • src/main.rs: egui app and plotting.
    • src/syncer.rs: HTTP fetching, pagination, binary search.
    • src/store.rs: SQLite schema and queries; windowed counts with presence filter.
    • src/types.rs: API JSON models.
    • src/bin/sync.rs: optional headless sync runner.

Troubleshooting

  • If sync shows intermittent errors, re-run “Sync data”; the client retries and uses smaller pages.
  • If the histogram is empty, ensure you clicked “Recompute” after syncing and the presence window isn’t too strict.
  • On systems without proper OpenGL drivers, consider running the headless sync only.

Roadmap Ideas

  • Parameterize sync cutoff by selected timeframe (only fetch needed pages).
  • Replace presence proxy with explicit membership/uptime if/when the API exposes it.
  • Export CSV and add per-validator detail view.

About

A visualizer of the amount of blocks Evonodes propose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages