feat(web): add network subpages and subdomains listing page

- Add /subdomains page listing all 20 PezkuwiChain subdomains
- Add Back to Home button to Subdomains page
- Create NetworkPage reusable component for network details
- Add 7 network subpages: /mainnet, /staging, /testnet, /beta, /alfa, /development, /local
- Update ChainSpecs network cards to navigate to network subpages
- Add i18n translations for chainSpecs section in en.ts
- Add SDK docs with rebranding support (rebrand-rustdoc.cjs)
- Add generate-docs-structure.cjs for automatic docs generation
- Update shared libs: endpoints, polkadot, wallet, xcm-bridge
- Add new token logos: TYR, ZGR, pezkuwi_icon
- Add new pages: Explorer, Docs, Wallet, Api, Faucet, Developers, Grants, Wiki, Forum, Telemetry
This commit is contained in:
2025-12-11 00:33:47 +03:00
parent 2c6c4f5606
commit 11678fe7cd
976 changed files with 60601 additions and 168 deletions
+44 -8
View File
@@ -42,13 +42,31 @@ export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
description: 'Staging environment for pre-production testing',
},
// Development Testnet
TESTNET: {
name: 'Pezkuwi Testnet',
endpoint: 'https://testnet.pezkuwichain.io',
wsEndpoint: 'wss://testnet.pezkuwichain.io',
// Alfa Testnet
ALFA: {
name: 'Pezkuwi Alfa Testnet',
endpoint: 'https://alfa.pezkuwichain.io',
wsEndpoint: 'wss://alfa.pezkuwichain.io',
type: 'development',
description: 'Development testnet for feature testing',
description: 'Alfa testnet for early feature testing',
},
// Development Environment
DEV: {
name: 'Pezkuwi Development',
endpoint: 'https://dev.pezkuwichain.io',
wsEndpoint: 'wss://dev.pezkuwichain.io',
type: 'development',
description: 'Development environment for feature testing',
},
// Local Development
LOCAL: {
name: 'Local Development',
endpoint: 'http://127.0.0.1:9944',
wsEndpoint: 'ws://127.0.0.1:9944',
type: 'development',
description: 'Local development node',
},
};
@@ -57,8 +75,8 @@ export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
*/
export const DEFAULT_NETWORK =
process.env.NODE_ENV === 'production'
? NETWORK_ENDPOINTS.BETA // Currently using Beta for production
: NETWORK_ENDPOINTS.TESTNET;
? NETWORK_ENDPOINTS.BETA // Currently using Beta for production
: NETWORK_ENDPOINTS.DEV;
/**
* Port Configuration
@@ -98,6 +116,23 @@ export function getAllNetworks(): NetworkConfig[] {
return Object.values(NETWORK_ENDPOINTS);
}
/**
* Get the current network configuration based on the VITE_NETWORK environment variable.
* This serves as the single source of truth for the application's network configuration.
* @returns {NetworkConfig} The active network configuration.
*/
export const getCurrentNetworkConfig = (): NetworkConfig => {
const networkName = (import.meta.env.VITE_NETWORK || 'local').toUpperCase();
const validNetworkKeys = Object.keys(NETWORK_ENDPOINTS);
if (validNetworkKeys.includes(networkName)) {
return NETWORK_ENDPOINTS[networkName as keyof typeof NETWORK_ENDPOINTS];
}
// Fallback to a default or local configuration if the name is invalid
return NETWORK_ENDPOINTS.LOCAL;
};
/**
* Check if endpoint is available
*/
@@ -109,3 +144,4 @@ export async function checkEndpoint(endpoint: string): Promise<boolean> {
return false;
}
}
export const NETWORKS = NETWORK_ENDPOINTS;
+4 -28
View File
@@ -3,46 +3,22 @@
*/
import type { BlockchainNetwork } from '../types/blockchain';
import { getCurrentNetworkConfig } from './endpoints';
/**
* Pezkuwi blockchain network configuration
* Uses BETA endpoint from centralized endpoints.ts (source of truth)
*/
export const PEZKUWI_NETWORK: BlockchainNetwork = {
name: 'Pezkuwi',
endpoint: 'wss://beta-rpc.pezkuwi.art',
endpoint: getCurrentNetworkConfig().wsEndpoint,
chainId: 'pezkuwi',
};
/**
* Common blockchain endpoints
*/
export const BLOCKCHAIN_ENDPOINTS = {
mainnet: 'wss://mainnet.pezkuwichain.io',
testnet: 'wss://ws.pezkuwichain.io',
local: 'ws://127.0.0.1:9944',
} as const;
/**
* Get the appropriate WebSocket endpoint based on environment
*/
function getWebSocketEndpoint(): string {
const network = import.meta.env.VITE_NETWORK || 'local';
switch (network) {
case 'mainnet':
return import.meta.env.VITE_WS_ENDPOINT_MAINNET || BLOCKCHAIN_ENDPOINTS.mainnet;
case 'testnet':
return import.meta.env.VITE_WS_ENDPOINT_TESTNET || BLOCKCHAIN_ENDPOINTS.testnet;
case 'local':
default:
return import.meta.env.VITE_WS_ENDPOINT_LOCAL || BLOCKCHAIN_ENDPOINTS.local;
}
}
/**
* Default endpoint (reads from environment variables)
*/
export const DEFAULT_ENDPOINT = getWebSocketEndpoint();
export const DEFAULT_ENDPOINT = getCurrentNetworkConfig().wsEndpoint;
/**
* Get block explorer URL for a transaction