Skip to content

Repository files navigation

Lite-Dipper

Lite-Dipper is a lightweight frontend-first Desmos explorer built with React, Vite and Cloudflare Workers.

Stack

  • React + TypeScript + Vite
  • Tailwind CSS
  • React Router
  • Cloudflare Worker for public-page rendering, API aggregation, caching and RPC proxying
  • Keplr and Ledger wallet abstractions

Desmos Defaults

  • Chain ID: desmos-mainnet
  • Token denom: udsm
  • Token display: DSM
  • Exponent: 6
  • RPC: https://rpc.mainnet.desmos.network:443
  • REST: https://api.mainnet.desmos.network
  • Osmosis IBC channel: channel-2

The DESMOS_GRPC_URL variable is included in the config, but the current scaffold does not execute native browser-side gRPC calls. For a web app on Cloudflare, gRPC usually needs a gRPC-web or Connect-compatible bridge before it is practical in the browser.

Scripts

  • pnpm dev: run the Vite frontend
  • pnpm build: typecheck and build the browser assets
  • pnpm preview: build and serve the frontend, Worker API and RPC proxy at http://127.0.0.1:4173 using live Desmos data
  • pnpm test:e2e: build the SPA and run Playwright smoke tests
  • pnpm test:e2e:headed: run the same E2E suite in headed mode
  • pnpm worker:dev: run the Worker locally
  • pnpm deploy: build and deploy the Worker plus static assets

Use pnpm preview to review the app locally with live validators, profiles and wallet data. Vite alone serves the frontend without the /api/* or /rpc handlers. The preview:e2e script remains a static Vite preview for tests that mock those endpoints.

E2E Testing

The app includes a Playwright regression suite under tests/e2e.

Run it locally with:

pnpm exec playwright install chromium
pnpm test:e2e

The suite mocks /api/* and the direct Desmos governance REST requests so it stays deterministic. SEO tests also invoke the real Worker with mocked upstream services, exercise server-rendered pages with JavaScript disabled, and verify hydration, metadata navigation, error statuses, crawler files and safe serialization of untrusted chain data.

Search and crawler support

The Worker renders the existing React public pages into the initial HTML using RPC and REST queries. React hydrates that HTML for client navigation and polling. This adds no database or transaction indexer. The wallet initially renders disconnected; wallet connections and signing stay in the browser.

Every public route has a title, description, canonical URL, Open Graph/Twitter tags and WebSite/WebPage structured data. Validator and proposal metadata use their actual content. Canonicals always use https://lite.desmos.network; change SITE_ORIGIN and the public crawler files together when changing the production domain. Wallet pages and non-production HTML responses are marked noindex.

Unknown routes and missing records return HTTP 404. Unavailable upstream data returns HTTP 503 with Retry-After, without caching the error as a successful page. Static asset fallback is disabled so missing assets do not become soft 404s. Trailing slashes and lowercase transaction hashes redirect to their canonical routes. Public HTML is cached for 30 seconds, and wallet HTML is never cached.

/robots.txt points to /sitemap.xml. The sitemap includes public entry pages, active validators, the latest 20 proposals, recent blocks and recent transactions. It is an entry point, not a complete chain archive; normal links, including block pagination, support further discovery.

/llms.txt is an optional concise guide linking to /docs/explorer.md and public entry pages. It contains stable documentation rather than live balances or tallies. A duplicate llms-full.txt is intentionally omitted because the documentation is short and already directly linked. Neither file is an SEO requirement: Google's AI search guidance says no new AI-specific text files are needed. The optional guide follows the llms.txt proposal.

Use pnpm preview to verify the complete rendering path. Vite alone only serves the browser app. pnpm exec wrangler deploy --dry-run checks the Worker bundle without deploying it.

Governance without an indexer

Proposal list and detail pages query DESMOS_CHAIN.restUrl directly from the browser. Initial server-rendered HTML uses the same normalization code against the Worker's DESMOS_REST_URL. They also work with static SPA hosting, without initial HTML rendering. Neither path uses a transaction indexer for governance reads. The REST endpoint must allow browser requests through CORS; the default Desmos mainnet API does.

  • Latest 20 proposals: /cosmos/gov/v1/proposals?pagination.limit=20&pagination.reverse=true
  • Proposal status and stored final result: /cosmos/gov/v1/proposals/{id}
  • Live, stake-weighted result during voting: /cosmos/gov/v1/proposals/{id}/tally

Both views refresh every 30 seconds. Details also offer manual refresh and refresh after a successful vote. Active proposals always query /tally, because final_tally_result is a zero-filled placeholder until voting finishes. Completed proposals use the stored final result. Tally amounts are displayed in DSM with exact integer arithmetic; percentages are shares of total voted power including abstentions, not turnout or pass/fail predictions. Unavailable tallies and stale refreshes are shown explicitly.

These are governance state queries, so transaction search/indexing is unnecessary. This does not provide a historical vote-change timeline. Other explorer views and wallet RPC proxying still use the existing Worker.

Notes

  • The Worker renders public routes, serves static assets from dist, and handles /api/* plus /rpc*.
  • Governance normalization is shared by the browser and Worker; other explorer reads are normalized in the Worker.
  • Wallet transaction methods are scaffolded for send, staking and IBC transfer paths, but they still need live integration testing against Keplr and the Desmos Ledger app in a supported browser.

About

Lightweight block explorer with wallet support for Desmos

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages