Lattice Explorer

A web-based block explorer for inspecting chains, blocks, and the lattice tree hierarchy. Connects to a lattice-gateway JSON-RPC endpoint.

Overview

The explorer provides a visual interface for navigating any Lattice network. It can browse the nexus chain, discover child chains, and navigate the full lattice tree — switching context to view blocks, mempool state, and chain configuration on any chain in the hierarchy.

No build step

The explorer is a single-page app with zero dependencies. Open index.html in a browser, point it at a running gateway, and you're exploring.

Getting Started

Clone the repo and open in a browser:

git clone https://github.com/treehauslabs/lattice-explorer.git
cd lattice-explorer
open index.html

Or serve it locally:

python3 -m http.server 8080
# visit http://localhost:8080

Enter the gateway URL (default http://127.0.0.1:8545) and click Connect. The explorer polls the gateway every 5 seconds to keep data fresh.

Lattice Tree Navigation

The core feature: browsing the full chain hierarchy from a single interface.

When connected to a nexus chain, the Lattice Tree section lists all child chains discovered via lattice_getChildChains. Each entry shows:

A breadcrumb trail at the top tracks your position: Nexus / TokenLedger / .... Click any segment to jump back up the tree.

Chain Context

When you switch to a child chain, everything updates to reflect that chain's state:

SectionWhat changes
Network OverviewChain height, tip, and genesis hash for the selected chain
Chain SpecBlock time, max transactions, reward schedule for that chain
MempoolPending transactions scoped to the selected chain
Latest BlockMost recent block on the selected chain
Block BrowserNavigate blocks by index on the selected chain
Lattice TreeShows child chains of the currently selected chain
RPC ConsoleSends commands scoped to the selected chain

This means you can fully explore any child chain — its blocks, transactions, state — without switching tools or endpoints.

Block Browser

Two ways to navigate blocks on any chain:

By Index

The block browser provides First / Prev / Next / Latest controls. It calls lattice_getBlockByIndex with the current chain context and the selected index. This is the fastest way to walk through a chain's history.

By Hash

The block lookup section accepts a block hash and calls lattice_getBlock. All block hashes displayed in the explorer are clickable — clicking one populates the lookup field and fetches that block.

Block details include:

RPC Methods

The explorer uses the following gateway JSON-RPC methods:

MethodParametersDescription
lattice_nodeInfo[chainId?]Node info, chain height, tip, genesis hash
lattice_chainSpec[chainId?]Chain configuration
lattice_getMempoolInfo[chainId?]Pending transaction count and fees
lattice_getLatestBlock[chainId?]Latest block on the chain
lattice_getBlock[blockHash]Block by hash (cross-chain)
lattice_getBlockByIndex[chainId?,] indexBlock by index on a specific chain
lattice_getChildChains[chainId?]Child chains under a given chain
lattice_peerCount[chainId?]Connected peer count
lattice_generateKeyPair[]Generate a new keypair

When a chainId is omitted, the method operates on the nexus chain. The explorer automatically prepends the current chain context to all RPC calls when viewing a child chain.

Other Sections

Source

The explorer is a zero-dependency single-page app:

lattice-explorer/
  index.html   — layout and sections
  app.js       — RPC client, chain navigation, block browsing
  style.css    — dark theme

View on GitHub