TECHNICAL CASE STUDY · Unreleased · Explorer platform
PulseChain Explorer
A unified explorer, from indexing to the interface.
Pre-launch implementation · integrated platform qualification remained unfinished
FROM THE IMPLEMENTATION
Restore a partially parsed batch
pub fn rollback(self: *LineBoundary, batch: *BatchWriter) void {
inline for (TABLES, 0..) |table, i| {
@field(batch, table.count_field) = self.rows[i];
@field(batch, table.params_field).items.len = self.lengths[i];
}
std.mem.swap(AddressMap, &batch.address_map, &self.addresses);
std.mem.swap(AddressSet, &batch.token_seen, &self.tokens);
std.mem.swap(AddressSet, &batch.contract_seen, &self.contracts);
// Earlier rows still own arena bytes. An empty batch must release failed-line bytes
// here: flush skips an empty batch, so repeated malformed-first retries retain them.
if (batch.isEmpty()) batch.clear();
}
Selected complete helper from the unreleased explorer. A failed input restores row counts, parameter lengths and deduplication state; an empty batch releases memory retained by the failed input. This is source evidence, not a live indexing claim.
THE ENGINEERING PROBLEM
What needed to work
A block explorer connects several kinds of truth: execution blocks, transactions, consensus activity, indexed history and the chain head that may be ahead of storage. I designed and implemented substantial parts of an unreleased PulseChain explorer to bring these views into one product without presenting incomplete data as settled.
Constraints and requirements
- Mainnet and testnet need explicit network selection throughout queries and persisted progress. Execution block numbers, consensus slots and indexing cursors describe different timelines; they cannot be substituted for one another.
- The broader plan combined exploration, developer tools, validator analysis and other sections. That consolidation remained unfinished. The portfolio shows implemented source and a local mock-data preview of the actual frontend, rather than a launched service or proof of complete indexed coverage.
ARCHITECTURE & DESIGN
How the system fits together
- Execution / consensus sources
- Native ingestion + indexing components
- PostgreSQL schema boundaries
- Section APIs
- Consolidated explorer interface
The implementation includes a Zig API and indexing components, PostgreSQL persistence helpers and a static HTML/CSS/JavaScript frontend. API modules cover chain entities and derived statistics. The browser renders search, blocks, transactions, slots, epochs and network summaries through a common navigation and request layer.
Chain-scoped state helpers persist execution and backfill watermarks. Batch-writing code stages related records and preserves an explicit boundary around parsing each input. A separate recent-head API can expose proven source fields before the indexed history catches up, with an explicit distinction between those data lanes.
Decisions and tradeoffs
Keep head previews honest about what the source proves.
The API checks that a returned block matches the requested height and rejects missing or invalid fields. Preview rows carry a lane marker and omit indexed-only values that the source response cannot establish.
Tradeoff Users may see partial information while indexing continues. Explicit absence and provenance preserve meaning better than filling gaps with guesses.
Separate implemented modules from sections eligible for release.
A frontend registry gates integrated sections by environment. Missing configuration leaves unfinished sections closed, while development can expose them for connected implementation and review.
Tradeoff The product needs both section-specific checks and shared integration work. A coherent navigation shell does not automatically complete every journey.
PLANNING & EXECUTION
From requirements to working behavior
- I implemented shared API access, entity pages, network statistics, live feed updates and consensus visualization alongside the backend modules. The request layer bounds fetches, reports malformed responses and preserves the selected network rather than silently switching data sources.
- The batch writer snapshots row counts, parameter lengths and deduplication maps before an input can mutate them. Its rollback helper restores that logical state and releases failed-input memory when appropriate. Recovery is an implementation concern inside ingestion, not merely a later operations document.
VALIDATION & RECOVERY
How the behavior is checked
- Retained tests cover same-height head validation, null or invalid source data, omission of indexed-only fields and batch rollback behavior. Frontend tests cover shared request and section-gating behavior. The portfolio screenshot uses the actual frontend with synthetic responses in an isolated local browser; it establishes presentation only and makes no backend or deployment claim.
Implementation references
Repository-relative references identify the implementation behind this case study. Selected code excerpts are also available in the portfolio.
- tf-hetzner/projects/explorer/frontend/index.html
- tf-hetzner/projects/explorer/frontend/js/api.js
- tf-hetzner/projects/explorer/frontend/js/sections.js
- tf-hetzner/projects/explorer/src/api/head.zig
- tf-hetzner/projects/explorer/src/indexer/indexer_state.zig
- tf-hetzner/projects/explorer/src/db/batch_writer.zig