mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 17:01:02 +00:00
fix: update RPC endpoints to correct production URLs
- Relay Chain: wss://rpc.pezkuwichain.io - Asset Hub: wss://asset-hub-rpc.pezkuwichain.io - People Chain: wss://people-rpc.pezkuwichain.io - Add Zagros testnet configuration - Remove legacy staging/dev endpoints - Fix port suffix in Edge Functions
This commit is contained in:
@@ -58,35 +58,35 @@ export const NETWORKS: Record<NetworkType, NetworkConfig> = {
|
|||||||
pezkuwi: {
|
pezkuwi: {
|
||||||
name: 'pezkuwi',
|
name: 'pezkuwi',
|
||||||
displayName: 'Pezkuwi Mainnet',
|
displayName: 'Pezkuwi Mainnet',
|
||||||
rpcEndpoint: 'wss://rpc-mainnet.pezkuwichain.io:9944',
|
rpcEndpoint: ENV.wsEndpoint || 'wss://rpc.pezkuwichain.io',
|
||||||
ss58Format: 42,
|
ss58Format: 42,
|
||||||
type: 'mainnet',
|
type: 'mainnet',
|
||||||
},
|
},
|
||||||
dicle: {
|
dicle: {
|
||||||
name: 'dicle',
|
name: 'dicle',
|
||||||
displayName: 'Dicle Testnet',
|
displayName: 'Dicle Testnet',
|
||||||
rpcEndpoint: 'wss://rpc-dicle.pezkuwichain.io:9944',
|
rpcEndpoint: 'wss://dicle-rpc.pezkuwichain.io',
|
||||||
ss58Format: 2,
|
ss58Format: 2,
|
||||||
type: 'testnet',
|
type: 'testnet',
|
||||||
},
|
},
|
||||||
zagros: {
|
zagros: {
|
||||||
name: 'zagros',
|
name: 'zagros',
|
||||||
displayName: 'Zagros Canary',
|
displayName: 'Zagros Testnet',
|
||||||
rpcEndpoint: 'wss://rpc-zagros.pezkuwichain.io:9944',
|
rpcEndpoint: 'wss://zagros-rpc.pezkuwichain.io',
|
||||||
ss58Format: 42,
|
ss58Format: 42,
|
||||||
type: 'canary',
|
type: 'canary',
|
||||||
},
|
},
|
||||||
bizinikiwi: {
|
bizinikiwi: {
|
||||||
name: 'bizinikiwi',
|
name: 'bizinikiwi',
|
||||||
displayName: 'Bizinikiwi Testnet (Beta)',
|
displayName: 'Pezkuwi Mainnet',
|
||||||
rpcEndpoint: ENV.wsEndpoint || 'wss://rpc.pezkuwichain.io:9944',
|
rpcEndpoint: ENV.wsEndpoint || 'wss://rpc.pezkuwichain.io',
|
||||||
ss58Format: 42,
|
ss58Format: 42,
|
||||||
type: 'testnet',
|
type: 'mainnet',
|
||||||
},
|
},
|
||||||
zombienet: {
|
zombienet: {
|
||||||
name: 'zombienet',
|
name: 'zombienet',
|
||||||
displayName: 'Zombienet Dev (Alice/Bob)',
|
displayName: 'Zombienet Dev (Local)',
|
||||||
rpcEndpoint: 'wss://beta-rpc.pezkuwichain.io:19944',
|
rpcEndpoint: 'ws://127.0.0.1:9944',
|
||||||
ss58Format: 42,
|
ss58Format: 42,
|
||||||
type: 'dev',
|
type: 'dev',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
* Blockchain Network Endpoints Configuration
|
* Blockchain Network Endpoints Configuration
|
||||||
* Production, Staging, and Development environments
|
* Production, Testnet (Zagros), and Development environments
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface NetworkConfig {
|
export interface NetworkConfig {
|
||||||
name: string;
|
name: string;
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
wsEndpoint: string;
|
wsEndpoint: string;
|
||||||
type: 'production' | 'staging' | 'development';
|
assetHubEndpoint?: string;
|
||||||
|
peopleChainEndpoint?: string;
|
||||||
|
type: 'production' | 'testnet' | 'development';
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,49 +17,48 @@ export interface NetworkConfig {
|
|||||||
* Production Network Endpoints
|
* Production Network Endpoints
|
||||||
*/
|
*/
|
||||||
export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
|
export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
|
||||||
// Production Mainnet
|
// Production Mainnet (Primary)
|
||||||
MAINNET: {
|
MAINNET: {
|
||||||
name: 'Pezkuwi Mainnet',
|
name: 'Pezkuwi Mainnet',
|
||||||
endpoint: 'https://rpc.pezkuwichain.io',
|
endpoint: 'https://rpc.pezkuwichain.io',
|
||||||
wsEndpoint: 'wss://mainnet.pezkuwichain.io',
|
wsEndpoint: 'wss://rpc.pezkuwichain.io',
|
||||||
|
assetHubEndpoint: 'wss://asset-hub-rpc.pezkuwichain.io',
|
||||||
|
peopleChainEndpoint: 'wss://people-rpc.pezkuwichain.io',
|
||||||
type: 'production',
|
type: 'production',
|
||||||
description: 'Main production network for Pezkuwi blockchain',
|
description: 'Main production network for Pezkuwi blockchain',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Beta Testnet (Current Active)
|
// Production alias using mainnet subdomain
|
||||||
BETA: {
|
PRODUCTION: {
|
||||||
name: 'Pezkuwi Beta Testnet',
|
name: 'Pezkuwi Mainnet',
|
||||||
endpoint: 'https://rpc.pezkuwichain.io',
|
endpoint: 'https://mainnet.pezkuwichain.io',
|
||||||
wsEndpoint: 'wss://rpc.pezkuwichain.io',
|
wsEndpoint: 'wss://mainnet.pezkuwichain.io',
|
||||||
|
assetHubEndpoint: 'wss://asset-hub-rpc.pezkuwichain.io',
|
||||||
|
peopleChainEndpoint: 'wss://people-rpc.pezkuwichain.io',
|
||||||
type: 'production',
|
type: 'production',
|
||||||
description: 'Beta testnet - Currently active for testing',
|
description: 'Production mainnet (mainnet subdomain)',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Staging Environment
|
// Zagros Testnet
|
||||||
STAGING: {
|
ZAGROS: {
|
||||||
name: 'Pezkuwi Staging',
|
name: 'Zagros Testnet',
|
||||||
endpoint: 'https://staging.pezkuwichain.io',
|
endpoint: 'https://zagros-rpc.pezkuwichain.io',
|
||||||
wsEndpoint: 'wss://staging.pezkuwichain.io',
|
wsEndpoint: 'wss://zagros-rpc.pezkuwichain.io',
|
||||||
type: 'staging',
|
assetHubEndpoint: 'wss://zagros-asset-hub.pezkuwichain.io',
|
||||||
description: 'Staging environment for pre-production testing',
|
peopleChainEndpoint: 'wss://zagros-people.pezkuwichain.io',
|
||||||
|
type: 'testnet',
|
||||||
|
description: 'Zagros testnet for development and testing',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Alfa Testnet
|
// Testnet alias (maps to Zagros)
|
||||||
ALFA: {
|
TESTNET: {
|
||||||
name: 'Pezkuwi Alfa Testnet',
|
name: 'Zagros Testnet',
|
||||||
endpoint: 'https://alfa.pezkuwichain.io',
|
endpoint: 'https://zagros-rpc.pezkuwichain.io',
|
||||||
wsEndpoint: 'wss://alfa.pezkuwichain.io',
|
wsEndpoint: 'wss://zagros-rpc.pezkuwichain.io',
|
||||||
type: 'development',
|
assetHubEndpoint: 'wss://zagros-asset-hub.pezkuwichain.io',
|
||||||
description: 'Alfa testnet for early feature testing',
|
peopleChainEndpoint: 'wss://zagros-people.pezkuwichain.io',
|
||||||
},
|
type: 'testnet',
|
||||||
|
description: 'Testnet environment (Zagros)',
|
||||||
// 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 Development
|
||||||
@@ -65,17 +66,32 @@ export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
|
|||||||
name: 'Local Development',
|
name: 'Local Development',
|
||||||
endpoint: 'http://127.0.0.1:9944',
|
endpoint: 'http://127.0.0.1:9944',
|
||||||
wsEndpoint: 'ws://127.0.0.1:9944',
|
wsEndpoint: 'ws://127.0.0.1:9944',
|
||||||
|
assetHubEndpoint: 'ws://127.0.0.1:40944',
|
||||||
|
peopleChainEndpoint: 'ws://127.0.0.1:41944',
|
||||||
type: 'development',
|
type: 'development',
|
||||||
description: 'Local development node',
|
description: 'Local development node',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Development alias (maps to BETA for live testing)
|
// Development alias (maps to Zagros for live testing)
|
||||||
DEVELOPMENT: {
|
DEVELOPMENT: {
|
||||||
name: 'Pezkuwi Beta Testnet',
|
name: 'Zagros Testnet',
|
||||||
|
endpoint: 'https://zagros-rpc.pezkuwichain.io',
|
||||||
|
wsEndpoint: 'wss://zagros-rpc.pezkuwichain.io',
|
||||||
|
assetHubEndpoint: 'wss://zagros-asset-hub.pezkuwichain.io',
|
||||||
|
peopleChainEndpoint: 'wss://zagros-people.pezkuwichain.io',
|
||||||
|
type: 'development',
|
||||||
|
description: 'Development mode connecting to Zagros testnet',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Legacy: Beta (deprecated, maps to Mainnet)
|
||||||
|
BETA: {
|
||||||
|
name: 'Pezkuwi Mainnet',
|
||||||
endpoint: 'https://rpc.pezkuwichain.io',
|
endpoint: 'https://rpc.pezkuwichain.io',
|
||||||
wsEndpoint: 'wss://rpc.pezkuwichain.io',
|
wsEndpoint: 'wss://rpc.pezkuwichain.io',
|
||||||
type: 'development',
|
assetHubEndpoint: 'wss://asset-hub-rpc.pezkuwichain.io',
|
||||||
description: 'Development mode connecting to Beta testnet for live testing',
|
peopleChainEndpoint: 'wss://people-rpc.pezkuwichain.io',
|
||||||
|
type: 'production',
|
||||||
|
description: 'Legacy beta config - now maps to mainnet',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,31 +100,29 @@ export const NETWORK_ENDPOINTS: Record<string, NetworkConfig> = {
|
|||||||
*/
|
*/
|
||||||
export const DEFAULT_NETWORK =
|
export const DEFAULT_NETWORK =
|
||||||
process.env.NODE_ENV === 'production'
|
process.env.NODE_ENV === 'production'
|
||||||
? NETWORK_ENDPOINTS.BETA // Currently using Beta for production
|
? NETWORK_ENDPOINTS.MAINNET
|
||||||
: NETWORK_ENDPOINTS.DEV;
|
: NETWORK_ENDPOINTS.ZAGROS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Port Configuration
|
* Port Configuration
|
||||||
* - RPC HTTP: Port 9944 (proxied through HTTPS)
|
* - Relay Chain RPC: Port 9944
|
||||||
* - Mainnet Validator: Port 9944
|
* - Asset Hub RPC: Port 40944
|
||||||
* - Staging Validator: Port 9945
|
* - People Chain RPC: Port 41944
|
||||||
* - Testnet Validator: Port 9946
|
|
||||||
*/
|
*/
|
||||||
export const PORTS = {
|
export const PORTS = {
|
||||||
RPC: 9944,
|
RELAY_CHAIN: 9944,
|
||||||
MAINNET_VALIDATOR: 9944,
|
ASSET_HUB: 40944,
|
||||||
STAGING_VALIDATOR: 9945,
|
PEOPLE_CHAIN: 41944,
|
||||||
TESTNET_VALIDATOR: 9946,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frontend Deployments
|
* Frontend Deployments
|
||||||
*/
|
*/
|
||||||
export const FRONTEND_URLS = {
|
export const FRONTEND_URLS = {
|
||||||
PRODUCTION: 'https://pezkuwichain.app',
|
PRODUCTION: 'https://app.pezkuwichain.io',
|
||||||
BETA: 'https://beta.pezkuwichain.io',
|
TESTNET: 'https://zagros.pezkuwichain.io',
|
||||||
STAGING: 'https://staging.pezkuwichain.io',
|
EXPLORER: 'https://explorer.pezkuwichain.io',
|
||||||
SDK_UI: 'https://pezkuwichain.app/sdk',
|
EXTENSION: 'https://js.pezkuwichain.io',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,11 +24,15 @@ import { ApiPromise, WsProvider } from '@pezkuwi/api';
|
|||||||
import { web3Accounts, web3Enable } from '@pezkuwi/extension-dapp';
|
import { web3Accounts, web3Enable } from '@pezkuwi/extension-dapp';
|
||||||
import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types';
|
import type { InjectedAccountWithMeta } from '@pezkuwi/extension-inject/types';
|
||||||
import { DEFAULT_ENDPOINT } from '../../../shared/blockchain/pezkuwi';
|
import { DEFAULT_ENDPOINT } from '../../../shared/blockchain/pezkuwi';
|
||||||
|
import { getCurrentNetworkConfig } from '../../../shared/blockchain/endpoints';
|
||||||
import { isMobileApp, getNativeWalletAddress, getNativeAccountName } from '@/lib/mobile-bridge';
|
import { isMobileApp, getNativeWalletAddress, getNativeAccountName } from '@/lib/mobile-bridge';
|
||||||
|
|
||||||
// Teyrchain endpoints (from environment or defaults)
|
// Get network config from shared endpoints
|
||||||
const ASSET_HUB_ENDPOINT = import.meta.env.VITE_ASSET_HUB_ENDPOINT || 'wss://asset-hub-rpc.pezkuwichain.io';
|
const networkConfig = getCurrentNetworkConfig();
|
||||||
const PEOPLE_CHAIN_ENDPOINT = import.meta.env.VITE_PEOPLE_CHAIN_ENDPOINT || 'wss://people-rpc.pezkuwichain.io';
|
|
||||||
|
// Teyrchain endpoints (from environment or shared config)
|
||||||
|
const ASSET_HUB_ENDPOINT = import.meta.env.VITE_ASSET_HUB_ENDPOINT || networkConfig.assetHubEndpoint || 'wss://asset-hub-rpc.pezkuwichain.io';
|
||||||
|
const PEOPLE_CHAIN_ENDPOINT = import.meta.env.VITE_PEOPLE_CHAIN_ENDPOINT || networkConfig.peopleChainEndpoint || 'wss://people-rpc.pezkuwichain.io';
|
||||||
|
|
||||||
interface PezkuwiContextType {
|
interface PezkuwiContextType {
|
||||||
api: ApiPromise | null;
|
api: ApiPromise | null;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { cryptoWaitReady } from "https://esm.sh/@pezkuwi/util-crypto@14.0.5";
|
|||||||
const SUPABASE_URL = Deno.env.get("SUPABASE_URL")!;
|
const SUPABASE_URL = Deno.env.get("SUPABASE_URL")!;
|
||||||
const SUPABASE_SERVICE_ROLE_KEY = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!;
|
const SUPABASE_SERVICE_ROLE_KEY = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!;
|
||||||
const PLATFORM_WALLET_SEED = Deno.env.get("PLATFORM_WALLET_SEED")!;
|
const PLATFORM_WALLET_SEED = Deno.env.get("PLATFORM_WALLET_SEED")!;
|
||||||
const RPC_ENDPOINT = Deno.env.get("RPC_ENDPOINT") || "wss://rpc.pezkuwichain.io:9944";
|
const RPC_ENDPOINT = Deno.env.get("RPC_ENDPOINT") || "wss://rpc.pezkuwichain.io";
|
||||||
|
|
||||||
// Asset IDs
|
// Asset IDs
|
||||||
const ASSET_IDS: Record<string, number | null> = {
|
const ASSET_IDS: Record<string, number | null> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user