Clone
3
Explorer
Codex Bot edited this page 2026-03-24 02:00:25 +01:00
Explorer
Goal
Build a modern Peya explorer for live diagnostics and public visibility without carrying forward the structural debt of the old salstats stack.
This explorer is intended to surface:
- current block flow
- merge-mining status
- miner / protocol / burn amounts
- staking unlocks and inferred yield
- network-yield posture from daemon RPC
Active Repo
- local:
/mnt/duzy/sal11v4/peya-explorer - remote:
http://54.38.205.168:3000/tiamak/peya-explorer
Stack
- Apache as public reverse proxy
- Next.js frontend on localhost
- Fastify API on localhost
- MySQL as the primary explorer database
- Redis available for cache use
- dedicated RPC indexer process
Schema Direction
The explorer is intentionally not reusing the old PHP-era schema as the foundation.
Main tables:
blockstransactionstransaction_outputsprotocol_eventsyield_metricsexplorer_meta
The principle is:
- store enough normalized data for fast UI queries
- keep raw JSON where later reinterpretation may be necessary
- avoid promoting low-value legacy payloads just because the old stats stack stored them
Current Runtime Logic
Merge-Mining Detection
- current live Peya RPC exposes merge-mined blocks through
has_aux_headerandaux_header - the explorer now treats aux-header presence as the primary merge-mining signal
miner_tx.extramerge-mining-tag detection remains only as a fallback compatibility heuristic- exact badge semantics are now split:
aux-mmcan be inferred from chain datadual-mmis only assigned from pool submit telemetry- plain blocks carry no MM badge
Yield / Stake Linkage
- index raw protocol outputs first
- infer
locked_at_height = block_height - 21601 - match to the closest
STAKEtx on that height by amount - compute:
yield_atomic = unlocked_amount - staked_amountyield_percent = yield_atomic / staked_amount
This is deliberately isolated so it can be improved after live-RPC verification.
Live RPC Notes
Verified against the current fake-mainnet public RPC:
/getheightreturns the next height, so the top block isheight - 1gettransactionsis served on/gettransactionsget_blockincludes:has_aux_headeraux_header.parent_chain- raw parent blobs
- transaction JSON currently uses
vin/vout get_yield_infomay returnBUSYduring early/fake-mainnet operation
Pool Telemetry Integration
peya-nodejs-poolnow persists MM block classification with candidate and matured block entries in Redis- pool API exposes
/get_mm_blocks - explorer indexer can ingest pool-side MM telemetry into MySQL
- current intended badge meanings:
plainaux-mmdual-mm
Current UI Scope
Implemented:
- dashboard
- recent blocks
- block list
- block detail
- protocol event table on block detail
Still pending:
- search
- tx detail polish
- charts
- deployment snippets for Apache
- live tuning after RPC verification