Skip to content

feat(network): add Zcash network dashboard - #407

Open
MatiasOS wants to merge 4 commits into
issue-398-zcash-corefrom
issue-398-zcash-dashboard
Open

MatiasOS wants to merge 4 commits into
issue-398-zcash-corefrom
issue-398-zcash-dashboard

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Description

Adds the Zcash network dashboard at /zec and /tzec, and makes both networks visible across the app.

The dashboard is designed around the hosted gateway limit of about 5 requests per minute per IP:

  • Stats and the tip block load first, in 3 calls. Earlier block summaries then load one at a time.
  • Block summaries are cached across refreshes, so each 90s refresh usually costs 3–4 calls.
  • The navbar block indicator polls Zcash every 90s. Without this it would use the 12s EVM default, which alone is about 5 calls a minute.

Related Issue

Part of #398. Stacked on #406.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • src/config/networks.json: zec and tzec entries, taken from explorer-metadata with slugs added.
  • /zec and /tzec routes, with a lazy-loaded page.
  • useZcashDashboard plus the dashboard components:
    • Stats: height, difficulty, mempool, and chain supply with the shielded share.
    • A value pools bar covering Transparent, Sprout, Sapling, Orchard, Lockbox and Ironwood.
    • Latest blocks.
    • Latest transactions, with a badge for each transaction's kind.
  • i18n:
    • A new zcash namespace and a tooltips.zcash section in all 5 locales.
    • Relative times are localized, instead of reusing the English-only Bitcoin formatter.
  • NetworkBlockIndicator: a Zcash branch with a 90s poll.
  • useRpcLatencyTest: Zcash endpoints are tested with getblockcount.
  • README.md and .claude/rules/commands.md: list the Zcash networks and slugs.
  • A hermetic e2e spec at e2e/tests/shared/mocked/zcash-dashboard.spec.ts, with RPC traffic served from mainnet block 3,483,400.

Screenshots (if applicable)

Checked locally against mocked RPC data in dark, light and 400px-wide layouts.

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • METADATA_VERSION isn't bumped yet. The explorer-metadata publish of @openscan/metadata 1.3.0-alpha.0 failed, because npm requires --tag for prereleases. Until it's published:
  • The dashboard links to the blocks, block, txs and tx pages. Those pages arrive in the next PRs of the stack.
  • The navbar mempool link will ship with the mempool page.
  • Tests:
    • npm run test:run: 150 passing.
    • npx playwright test --project=mocked e2e/tests/shared/mocked/zcash-dashboard.spec.ts: 2 passing.

The dashboard loads stats and the tip block first, then earlier block summaries one at a time, and caches summaries across refreshes so a 90s refresh stays within hosted gateway rate limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant