Real XMR pilot

This commit is contained in:
2026-10-22 14:40:00 -04:00
parent 52559f65d7
commit 3f04c3afa9
19 changed files with 408 additions and 50 deletions
+10 -5
View File
@@ -1,13 +1,18 @@
/** Selection is fixed at server startup / browser build, never learned from an untrusted RPC. */
export function networkProfile(value: string | undefined): 'testnet' | 'mainnet' {
export type NetworkProfile = 'testnet' | 'mainnet' | 'pilot';
export function networkProfile(value: string | undefined): NetworkProfile {
const profile = value ?? 'testnet';
if (profile !== 'testnet' && profile !== 'mainnet') throw new Error('WIKIDECK_NETWORK must be testnet or mainnet');
if (profile !== 'testnet' && profile !== 'mainnet' && profile !== 'pilot') {
throw new Error('WIKIDECK_NETWORK must be testnet, mainnet, or pilot');
}
return profile;
}
export const PROFILE = networkProfile(typeof process !== 'undefined' && process.versions?.node
? process.env.WIKIDECK_NETWORK : import.meta.env?.VITE_WIKIDECK_NETWORK);
export const IS_MAINNET = PROFILE === 'mainnet';
export const NETWORK = IS_MAINNET ? 'wikideck-randomx-mainnet-1' as const : 'wikideck-randomx-testnet-6' as const;
export const IS_PILOT = PROFILE === 'pilot';
export const NETWORK = IS_MAINNET ? 'wikideck-randomx-mainnet-1' as const
: IS_PILOT ? 'wikideck-randomx-pilot-1' as const : 'wikideck-randomx-testnet-6' as const;
// Candidate mainnet genesis: 2027-01-01 00:00 UTC. NOT a commitment to a launch date.
export const NETWORK_GENESIS_TIME = IS_MAINNET ? 1_798_761_600 : 1_792_411_200;
export const NETWORK_LABEL = IS_MAINNET ? 'MAINNET CANDIDATE' : 'TESTNET';
export const NETWORK_GENESIS_TIME = IS_MAINNET ? 1_798_761_600 : IS_PILOT ? 1_792_627_200 : 1_792_411_200;
export const NETWORK_LABEL = IS_MAINNET ? 'MAINNET CANDIDATE' : IS_PILOT ? 'PRIVATE PILOT' : 'TESTNET';