mirror of
https://github.com/luxfi/explore.git
synced 2026-10-30 16:57:53 +00:00
luxd serves no P-Chain JSON-RPC, so every platform.* read the explorer sent
answered 404 and the validators, chains and heights widgets were empty on Lux
and Zoo. Each read is now GET /v1/chain/P/ops/{validators,blockchains,height},
coded against the node's OpenAPI 3.1 document, through GET
/v1/node/p-chain?op=<op>. The proxy's fixed table allows those three ops and one
NodeID parameter; a POST there answers 405.
ChainEntry.pChain is where the P-Chain that secures a chain is read: Lux reads
its own; Zoo, an L2 carried by Lux's validator set, reads Lux's and never its
own node's; Hanzo, on its own committee until hanzod joins as an L2, has none.
P-Chain UI names whose it is ("Lux primary network validators securing Zoo
Network") and prices stake in LUX. The cross-network validator sum is gone: it
counted Lux's validators again under Zoo.
The top bar shows a link only where its page has content: Chains, Bridge and
DEX on the Lux C-Chain host (their pages now 404 elsewhere), Validators where a
P-Chain secures the chain, Stats where there is a P-Chain panel or a stats
service. A P-Chain at genesis renders height #0 rather than nothing. The chain
page's uptime is no longer multiplied by 100.
Claude-Session: https://claude.ai/code/session_011Ge9UnfkEK37Lapx5nfPQK
89 lines
2.8 KiB
TypeScript
89 lines
2.8 KiB
TypeScript
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import { getPChain } from 'configs/app/chainRegistry';
|
|
import useEtherscanRedirects from 'lib/router/useEtherscanRedirects';
|
|
import PageTitle from 'ui/shared/Page/PageTitle';
|
|
import NetworkStats from 'ui/stats/lux/NetworkStats';
|
|
|
|
import ChartsWidgetsList from '../stats/ChartsWidgetsList';
|
|
import NumberWidgetsList from '../stats/NumberWidgetsList';
|
|
import StatsFilters from '../stats/StatsFilters';
|
|
import useStats from '../stats/useStats';
|
|
|
|
// Aggregate counters and historical charts are served by the Blockscout stats
|
|
// microservice. On networks where it is not deployed we show the live,
|
|
// chain-sourced Network Overview (validators / chains / stake from the P-chain)
|
|
// plus an honest note — never fabricated counters.
|
|
const hasStatsService = config.features.stats.isEnabled;
|
|
|
|
const Stats = () => {
|
|
const {
|
|
isPlaceholderData,
|
|
isError,
|
|
sections,
|
|
currentSection,
|
|
handleSectionChange,
|
|
interval,
|
|
handleIntervalChange,
|
|
handleFilterChange,
|
|
displayedCharts,
|
|
initialFilterQuery,
|
|
} = useStats();
|
|
|
|
useEtherscanRedirects();
|
|
|
|
return (
|
|
<>
|
|
<PageTitle
|
|
title={ config.meta.seo.enhancedDataEnabled ? `${ config.chain.name } statistic & data` : `${ config.chain.name } stats` }
|
|
/>
|
|
|
|
{ getPChain() && <NetworkStats/> }
|
|
|
|
{ hasStatsService ? (
|
|
<>
|
|
<div className="mb-6 sm:mb-8">
|
|
<NumberWidgetsList/>
|
|
</div>
|
|
|
|
<div className="mb-6 sm:mb-8">
|
|
<StatsFilters
|
|
isLoading={ isPlaceholderData }
|
|
initialFilterValue={ initialFilterQuery }
|
|
sections={ sections }
|
|
currentSection={ currentSection }
|
|
onSectionChange={ handleSectionChange }
|
|
interval={ interval }
|
|
onIntervalChange={ handleIntervalChange }
|
|
onFilterInputChange={ handleFilterChange }
|
|
/>
|
|
</div>
|
|
|
|
<ChartsWidgetsList
|
|
initialFilterQuery={ initialFilterQuery }
|
|
isError={ isError }
|
|
isPlaceholderData={ isPlaceholderData }
|
|
charts={ displayedCharts }
|
|
interval={ interval }
|
|
sections={ sections }
|
|
selectedSectionId={ currentSection }
|
|
/>
|
|
</>
|
|
) : (
|
|
<div className="mt-8 rounded-lg border border-[var(--color-border-divider)] px-6 py-10 text-center">
|
|
<div className="text-base font-medium text-[var(--color-text-primary)]">
|
|
Historical statistics are being indexed
|
|
</div>
|
|
<div className="mt-2 text-sm text-[var(--color-text-secondary)]">
|
|
Live network data is shown above. Aggregate counters and charts will
|
|
appear here once the analytics indexer is online for { config.chain.name }.
|
|
</div>
|
|
</div>
|
|
) }
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Stats;
|