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.
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:
- Chain ID — clickable; switches the explorer to that child chain
- Height — current block height on the child chain
- Children — number of grandchild chains (lattice can nest arbitrarily deep)
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:
| Section | What changes |
|---|---|
| Network Overview | Chain height, tip, and genesis hash for the selected chain |
| Chain Spec | Block time, max transactions, reward schedule for that chain |
| Mempool | Pending transactions scoped to the selected chain |
| Latest Block | Most recent block on the selected chain |
| Block Browser | Navigate blocks by index on the selected chain |
| Lattice Tree | Shows child chains of the currently selected chain |
| RPC Console | Sends 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:
- Block hash — clickable
- Block index
- Previous block hash — clickable, lets you walk backwards through the chain
- On main chain — whether this block is on the canonical chain
- Child block hashes — clickable, follow any fork or child block
- Child chain IDs — if this block spawned child chains, clickable to navigate to them
RPC Methods
The explorer uses the following gateway JSON-RPC methods:
| Method | Parameters | Description |
|---|---|---|
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?,] index | Block 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
- Network Overview — chain height, tip hash, genesis hash, peer count
- Node Info — public key, address, listen port
- Chain Spec — directory, block time, transaction limits, reward parameters
- Mempool — pending count and total fees
- Key Generator — generate keypairs via the gateway for testing
- RPC Console — select a method and send raw calls, scoped to the active chain
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