From eaca1ee6cabd14deb2c2c0bc3ca65ed26f448423 Mon Sep 17 00:00:00 2001 From: zaragoza444 Date: Tue, 7 Jul 2026 00:57:29 -0700 Subject: [PATCH] feat: separate Z Ecosystem onto zblockchainsystem.com Move Z Chain, wallet, bot, swap, and Z Bank UI off OMNL domains with dedicated nginx vhost and production DNS config. Co-authored-by: Cursor --- config/deployment-omnl.production.env.example | 13 +-- config/ecosystem-links.v1.json | 13 +-- .../omnl-customer-security.production.v1.json | 2 + config/omnl-production-domains.v1.json | 4 +- config/z-chain-integration.v1.json | 2 +- config/z-chain-production.v1.json | 11 ++- config/z-ecosystem-production-domains.v1.json | 28 ++++++ config/z-ecosystem.local.env.example | 14 ++- config/z-ecosystem.v1.json | 19 +++- deploy/nginx/z-ecosystem-domains.conf | 91 +++++++++++++++++++ docs/04-configuration/Z_ECOSYSTEM.md | 22 +++-- frontend-dapp/.env.local.example | 5 +- frontend-dapp/src/config/ecosystemLinks.ts | 10 +- frontend-dapp/src/config/zEcosystemDomain.ts | 11 +++ frontend-dapp/src/pages/HubPage.tsx | 42 +++++++-- package.json | 1 + .../deployment/activate-omnl-production.sh | 3 +- .../bootstrap-z-chain-production.sh | 4 +- .../deployment/deploy-omnl-bank-production.sh | 5 +- scripts/deployment/deploy-omnl-domains.sh | 3 +- scripts/deployment/deploy-z-domains.sh | 38 ++++++++ .../deploy-z-ecosystem-production.sh | 42 ++++++--- scripts/deployment/go-live-z-ecosystem.ps1 | 13 +-- scripts/deployment/print-omnl-dns-records.sh | 5 +- scripts/deployment/print-z-dns-records.sh | 24 +++++ 25 files changed, 349 insertions(+), 76 deletions(-) create mode 100644 config/z-ecosystem-production-domains.v1.json create mode 100644 deploy/nginx/z-ecosystem-domains.conf create mode 100644 frontend-dapp/src/config/zEcosystemDomain.ts create mode 100644 scripts/deployment/deploy-z-domains.sh create mode 100644 scripts/deployment/print-z-dns-records.sh diff --git a/config/deployment-omnl.production.env.example b/config/deployment-omnl.production.env.example index 31058cb..ece7ef2 100644 --- a/config/deployment-omnl.production.env.example +++ b/config/deployment-omnl.production.env.example @@ -50,17 +50,8 @@ CHAIN_138_RPC_URL=http://192.168.11.221:8545 # === Mirror chain 651940 === CHAIN_651940_RPC_URL=https://mainnet-rpc.alltra.global -# === Z Chain (consumer wallet, chainId 900002) === -CHAIN_900002_RPC_URL=http://127.0.0.1:8546 -OMNL_COMPLIANCE_CORE_900002= -VITE_RPC_URL_900002=http://127.0.0.1:8546 -VITE_Z_CHAIN_EXPLORER_URL=https://explorer.z.omdnl.org - -# === Z Bot (Azure OpenAI — optional; rule-based fallback when unset) === -AZURE_OPENAI_ENDPOINT= -AZURE_OPENAI_API_KEY= -AZURE_OPENAI_DEPLOYMENT=gpt-4o-mini -AZURE_OPENAI_API_VERSION=2024-02-15-preview +# === Z Chain — deploy via scripts/deployment/deploy-z-ecosystem-production.sh === +# Portal: https://zblockchainsystem.com — see config/z-ecosystem.local.env.example # === Major L1/L2 RPC (set per chain — CHAIN__RPC_URL) === CHAIN_1_RPC_URL=https://eth.llamarpc.com diff --git a/config/ecosystem-links.v1.json b/config/ecosystem-links.v1.json index 08fe960..bebe609 100644 --- a/config/ecosystem-links.v1.json +++ b/config/ecosystem-links.v1.json @@ -28,9 +28,6 @@ "reserve": "/reserve", "history": "/history", "wallets": "/wallets", - "zEcosystem": "/z", - "zWallet": "/z-wallet", - "zBot": "/z-wallet#z-bot", "admin": "/admin", "docs": "/docs" }, @@ -53,9 +50,6 @@ { "id": "reserve", "label": "Reserve", "path": "/reserve", "group": "app" }, { "id": "history", "label": "History", "path": "/history", "group": "app" }, { "id": "wallets", "label": "Wallets", "path": "/wallets", "group": "app" }, - { "id": "zEcosystem", "label": "Z Ecosystem", "path": "/z", "group": "app" }, - { "id": "zWallet", "label": "International Z Wallet", "path": "/z-wallet", "group": "app" }, - { "id": "zBot", "label": "Z Bot", "path": "/z-wallet#z-bot", "group": "app" }, { "id": "admin", "label": "Admin", "path": "/admin", "group": "app" }, { "id": "docs", "label": "Developers", "path": "/docs", "group": "app" }, { "id": "omnlCompliance", "label": "OMNL Compliance", "path": "/omnl/compliance", "group": "console" }, @@ -98,12 +92,15 @@ "centralBankSecure": "https://secure.omdnl.org/central-bank", "office24": "https://office24.omdnl.org/office-24", "exchangeTrade": "https://exchange.omdnl.org/trade", - "digitalSwap": "https://digital.omdnl.org/swap", "forexTrade": "https://forex.omdnl.org/trade", "omnlBankHybx": "https://bank.omnl.hybxfinance.io", "exchangeDbisMirror": "https://exchange.d-bis.org/trade", "centralBankDbisMirror": "https://secure.d-bis.org/central-bank", - "forexDbisMirror": "https://forex.d-bis.org/trade" + "forexDbisMirror": "https://forex.d-bis.org/trade", + "zEcosystem": "https://zblockchainsystem.com/z", + "zWallet": "https://zblockchainsystem.com/z-wallet", + "zSwap": "https://zblockchainsystem.com/swap", + "zOnlineBank": "https://zblockchainsystem.com/central-bank" }, "productionApis": { "explorerRoot": "https://explorer.d-bis.org/api/v1", diff --git a/config/omnl-customer-security.production.v1.json b/config/omnl-customer-security.production.v1.json index c09a5a8..50d1f52 100644 --- a/config/omnl-customer-security.production.v1.json +++ b/config/omnl-customer-security.production.v1.json @@ -16,6 +16,8 @@ "https://online.omdnl.org", "https://office24.omdnl.org", "https://digital.omdnl.org", + "https://zblockchainsystem.com", + "https://www.zblockchainsystem.com", "https://exchange.d-bis.org", "https://exchange.omdnl.org", "https://forex.omdnl.org" diff --git a/config/omnl-production-domains.v1.json b/config/omnl-production-domains.v1.json index 699c7c3..72676d7 100644 --- a/config/omnl-production-domains.v1.json +++ b/config/omnl-production-domains.v1.json @@ -41,9 +41,9 @@ }, { "host": "digital.omdnl.org", - "product": "digital-swap", + "product": "digital-swap-legacy", "defaultRoute": "/swap", - "routes": ["/z", "/z-wallet", "/swap", "/hub"] + "notes": "Legacy — prefer https://zblockchainsystem.com/swap" }, { "host": "office24.omdnl.org", diff --git a/config/z-chain-integration.v1.json b/config/z-chain-integration.v1.json index 4e6768d..a6a06d9 100644 --- a/config/z-chain-integration.v1.json +++ b/config/z-chain-integration.v1.json @@ -16,7 +16,7 @@ "nativeSymbol": "Z", "rpcEnv": "CHAIN_900002_RPC_URL", "rpcDefault": "http://127.0.0.1:8546", - "explorerUrl": "https://explorer.z.omdnl.org", + "explorerUrl": "https://explorer.zblockchainsystem.com", "omnlRegistrySlot": 900002 }, "fineract": { diff --git a/config/z-chain-production.v1.json b/config/z-chain-production.v1.json index 9a9c8c5..3a74668 100644 --- a/config/z-chain-production.v1.json +++ b/config/z-chain-production.v1.json @@ -7,11 +7,14 @@ "genesis": "config/genesis-z-chain-900002.json", "networkConfig": "config/z-chain-network-config.json", "endpoints": { - "rpcPublic": "https://rpc.z.omdnl.org", + "portal": "https://zblockchainsystem.com", + "rpcPublic": "https://rpc.zblockchainsystem.com", "rpcLan": "http://192.168.11.212:8546", - "explorer": "https://explorer.z.omdnl.org", - "walletPortal": "https://digital.omdnl.org/z-wallet", - "ecosystemHub": "https://digital.omdnl.org/z" + "explorer": "https://explorer.zblockchainsystem.com", + "walletPortal": "https://zblockchainsystem.com/z-wallet", + "ecosystemHub": "https://zblockchainsystem.com/z", + "digitalSwap": "https://zblockchainsystem.com/swap", + "zBankUi": "https://zblockchainsystem.com/central-bank" }, "env": { "rpc": "CHAIN_900002_RPC_URL", diff --git a/config/z-ecosystem-production-domains.v1.json b/config/z-ecosystem-production-domains.v1.json new file mode 100644 index 0000000..fef5ca0 --- /dev/null +++ b/config/z-ecosystem-production-domains.v1.json @@ -0,0 +1,28 @@ +{ + "version": "1.0.0", + "updated": "2026-07-06", + "brand": "Z Blockchain System", + "publicUrl": "https://zblockchainsystem.com", + "originHost": "dev-bis-zardasht", + "originIp": "76.53.10.34", + "frontendPort": 3002, + "domains": [ + { + "host": "zblockchainsystem.com", + "hostAliases": ["www.zblockchainsystem.com"], + "product": "z-ecosystem", + "defaultRoute": "/z", + "routes": ["/z", "/z-wallet", "/swap", "/central-bank"] + } + ], + "subdomains": { + "rpc": "rpc.zblockchainsystem.com", + "explorer": "explorer.zblockchainsystem.com" + }, + "apis": { + "zBotHealth": "https://zblockchainsystem.com/api/v1/z-bot/health", + "zWalletCorridors": "https://zblockchainsystem.com/api/v1/z-wallet/corridors", + "settlementHealth": "https://zblockchainsystem.com/settlement/health", + "zBankSettle": "https://zblockchainsystem.com/settlement/z-bank/settle-m0-m4" + } +} diff --git a/config/z-ecosystem.local.env.example b/config/z-ecosystem.local.env.example index dec4f91..00ee7c5 100644 --- a/config/z-ecosystem.local.env.example +++ b/config/z-ecosystem.local.env.example @@ -1,15 +1,21 @@ -# Z Ecosystem local overrides — copy to z-ecosystem.local.env (gitignored) -# Loaded by scripts/deployment/deploy-z-ecosystem.ps1 +# Z Ecosystem local overrides — copy to config/z-ecosystem.local.env +# Production portal: https://zblockchainsystem.com (separate from OMNL) + +Z_ECOSYSTEM_PUBLIC_URL=https://zblockchainsystem.com +VITE_Z_ECOSYSTEM_URL=https://zblockchainsystem.com # Z Chain (local Hardhat/Besu) CHAIN_900002_RPC_URL=http://127.0.0.1:8546 +VITE_RPC_URL_900002=http://127.0.0.1:8546 +VITE_Z_CHAIN_EXPLORER_URL=https://explorer.zblockchainsystem.com +VITE_ENABLE_Z_WALLET=true -# Z Bot — Azure OpenAI (optional; rule-based fallback when unset) +# Z Bot — Azure OpenAI (optional) AZURE_OPENAI_ENDPOINT=https://.openai.azure.com AZURE_OPENAI_API_KEY= AZURE_OPENAI_DEPLOYMENT=gpt-4o-mini AZURE_OPENAI_API_VERSION=2024-02-15-preview -# Settlement middleware (international transfers) +# Settlement (Z Bank API backend) SETTLEMENT_MIDDLEWARE_URL=http://127.0.0.1:3011 SETTLEMENT_MIDDLEWARE_CONFIG=config/settlement-middleware.production.v1.json diff --git a/config/z-ecosystem.v1.json b/config/z-ecosystem.v1.json index bed3352..da262f0 100644 --- a/config/z-ecosystem.v1.json +++ b/config/z-ecosystem.v1.json @@ -1,12 +1,14 @@ { "$schema": "Z consumer ecosystem hub links", - "version": "1.0.0", - "updated": "2026-07-05", - "brand": "Z Ecosystem", + "version": "1.1.0", + "updated": "2026-07-06", + "brand": "Z Blockchain System", + "publicUrl": "https://zblockchainsystem.com", "routes": { "hub": "/z", "wallet": "/z-wallet", "bot": "/z-wallet#z-bot", + "swap": "/swap", "onlineBank": "/central-bank", "settlement": "/central-bank#z-full-settlement" }, @@ -28,7 +30,13 @@ "label": "Z Chain", "path": "/z", "chainId": 900002, - "description": "Consumer EVM chain (OMNL expansion slot 900002)" + "description": "Consumer EVM chain (chainId 900002)" + }, + { + "id": "zSwap", + "label": "Digital Swap", + "path": "/swap", + "description": "M2 load, token swap, settlement rails" }, { "id": "zOnlineBank", @@ -37,5 +45,6 @@ "description": "M0–M4 banking and settlement rails" } ], - "integrationRef": "config/z-chain-integration.v1.json" + "integrationRef": "config/z-chain-integration.v1.json", + "productionDomainsRef": "config/z-ecosystem-production-domains.v1.json" } diff --git a/deploy/nginx/z-ecosystem-domains.conf b/deploy/nginx/z-ecosystem-domains.conf new file mode 100644 index 0000000..dbcc673 --- /dev/null +++ b/deploy/nginx/z-ecosystem-domains.conf @@ -0,0 +1,91 @@ +# Z Ecosystem — zblockchainsystem.com (Z Chain, Wallet, Bot, Swap, Z Bank UI) +# Deploy: scripts/deployment/deploy-z-domains.sh +# Shares upstreams with OMNL portal on :3000 / :3011 / :3012 / :3002 + +upstream z_ecosystem_frontend { + server 127.0.0.1:3002; +} + +upstream z_ecosystem_api { + server 127.0.0.1:3000; +} + +upstream z_ecosystem_settlement { + server 127.0.0.1:3011; +} + +upstream z_ecosystem_exchange { + server 127.0.0.1:3012; +} + +server { + listen 80; + listen [::]:80; + server_name zblockchainsystem.com www.zblockchainsystem.com; + + add_header X-Z-Product "z-ecosystem" always; + add_header X-Z-Chain "900002" always; + + location = / { + return 302 /z; + } + + location /api/v1/ { + proxy_pass http://z_ecosystem_api/api/v1/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 120s; + } + + location /settlement/ { + proxy_pass http://z_ecosystem_settlement/api/v1/settlement/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 120s; + } + + location /exchange/ { + proxy_pass http://z_ecosystem_exchange/api/v1/exchange/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_read_timeout 120s; + } + + location /omnl/ { + proxy_pass http://z_ecosystem_api/omnl/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_read_timeout 120s; + } + + location /reserve/ { + proxy_pass http://z_ecosystem_api/reserve/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_read_timeout 120s; + } + + location /assets/ { + proxy_pass http://z_ecosystem_frontend; + proxy_http_version 1.1; + proxy_set_header Host $host; + expires 1y; + add_header Cache-Control "public, immutable"; + } + + location / { + proxy_pass http://z_ecosystem_frontend; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + } +} diff --git a/docs/04-configuration/Z_ECOSYSTEM.md b/docs/04-configuration/Z_ECOSYSTEM.md index a614d5c..56bb577 100644 --- a/docs/04-configuration/Z_ECOSYSTEM.md +++ b/docs/04-configuration/Z_ECOSYSTEM.md @@ -109,16 +109,24 @@ sudo bash scripts/deployment/bootstrap-z-chain-production.sh Wire nginx/Cloudflare: -- `https://rpc.z.omdnl.org` → `127.0.0.1:8546` -- `https://explorer.z.omdnl.org` → Blockscout (optional, follow Chain 138 explorer pattern) -- Portal routes: `https://digital.omdnl.org/z` and `/z-wallet` +- `https://zblockchainsystem.com` → portal (`/z`, `/z-wallet`, `/swap`, `/central-bank`) +- `https://rpc.zblockchainsystem.com` → `127.0.0.1:8546` +- `https://explorer.zblockchainsystem.com` → Blockscout (optional) -Set on banking portal LXC: +Set on Z portal host: ```env -CHAIN_900002_RPC_URL=https://rpc.z.omdnl.org -VITE_RPC_URL_900002=https://rpc.z.omdnl.org -VITE_Z_CHAIN_EXPLORER_URL=https://explorer.z.omdnl.org +CHAIN_900002_RPC_URL=https://rpc.zblockchainsystem.com +VITE_RPC_URL_900002=https://rpc.zblockchainsystem.com +VITE_Z_CHAIN_EXPLORER_URL=https://explorer.zblockchainsystem.com +VITE_Z_ECOSYSTEM_URL=https://zblockchainsystem.com +``` + +Deploy: + +```bash +bash scripts/deployment/deploy-z-ecosystem-production.sh +bash scripts/deployment/print-z-dns-records.sh ``` ## Local dev without Docker diff --git a/frontend-dapp/.env.local.example b/frontend-dapp/.env.local.example index 5dc9faa..b9cbd51 100644 --- a/frontend-dapp/.env.local.example +++ b/frontend-dapp/.env.local.example @@ -1,5 +1,6 @@ -# Z Chain local dev — generated by complete-z-chain.ps1 +# Z Ecosystem local dev VITE_ENABLE_Z_WALLET=true +VITE_Z_ECOSYSTEM_URL=http://localhost:3002 VITE_RPC_URL_900002=http://127.0.0.1:8546 -VITE_Z_CHAIN_EXPLORER_URL=https://explorer.z.omdnl.org +VITE_Z_CHAIN_EXPLORER_URL=https://explorer.zblockchainsystem.com CHAIN_900002_RPC_URL=http://127.0.0.1:8546 diff --git a/frontend-dapp/src/config/ecosystemLinks.ts b/frontend-dapp/src/config/ecosystemLinks.ts index 579a726..f305f2d 100644 --- a/frontend-dapp/src/config/ecosystemLinks.ts +++ b/frontend-dapp/src/config/ecosystemLinks.ts @@ -55,10 +55,18 @@ export const PUBLIC_PORTAL_LINKS: EcosystemLink[] = [ { id: 'pub-o24', label: 'Office 24 Central Bank', description: 'office24.omdnl.org', icon: 'office', href: 'https://office24.omdnl.org/office-24', external: true, accent: 'purple' }, { id: 'pub-trade', label: 'Exchange', description: 'exchange.omdnl.org', icon: 'trade', href: 'https://exchange.omdnl.org/trade', external: true, accent: 'gold' }, { id: 'pub-forex', label: 'Forex', description: 'forex.omdnl.org', icon: 'trade', href: 'https://forex.omdnl.org/trade', external: true, accent: 'gold' }, - { id: 'pub-swap', label: 'Digital Swap', description: 'digital.omdnl.org', icon: 'swap', href: 'https://digital.omdnl.org/swap', external: true, accent: 'teal' }, { id: 'explorer', label: 'Chain 138 Explorer', description: 'Blocks, contracts, transactions', icon: 'globe', href: defaultFrontendExplorerUrl, external: true, accent: 'slate' }, ]; +/** Public Z Ecosystem portal — separate from OMNL (zblockchainsystem.com) */ +export const Z_ECOSYSTEM_PORTAL_LINKS: EcosystemLink[] = [ + { id: 'z-hub', label: 'Z Ecosystem', description: 'zblockchainsystem.com', icon: 'globe', href: 'https://zblockchainsystem.com/z', external: true, accent: 'purple' }, + { id: 'z-wallet', label: 'International Z Wallet', description: 'Z Chain wallet + corridors', icon: 'wallet', href: 'https://zblockchainsystem.com/z-wallet', external: true, accent: 'blue' }, + { id: 'z-bot', label: 'Z Bot', description: 'In-app assistant', icon: 'terminal', href: 'https://zblockchainsystem.com/z-wallet#z-bot', external: true, accent: 'teal' }, + { id: 'z-swap', label: 'Digital Swap', description: 'zblockchainsystem.com', icon: 'swap', href: 'https://zblockchainsystem.com/swap', external: true, accent: 'teal' }, + { id: 'z-bank', label: 'Z Online Bank', description: 'M0–M4 settlement UI', icon: 'central-bank', href: 'https://zblockchainsystem.com/central-bank', external: true, accent: 'green' }, +]; + /** API & docs endpoints — same-origin via portal-serve proxy on tunnel/local */ export const API_LINKS: EcosystemLink[] = [ { id: 'openapi', label: 'OpenAPI JSON', description: 'Machine-readable OMNL API spec', icon: 'code', href: '/api/v1/omnl/openapi.json', accent: 'teal' }, diff --git a/frontend-dapp/src/config/zEcosystemDomain.ts b/frontend-dapp/src/config/zEcosystemDomain.ts new file mode 100644 index 0000000..c2e841c --- /dev/null +++ b/frontend-dapp/src/config/zEcosystemDomain.ts @@ -0,0 +1,11 @@ +import zProd from '../../../config/z-ecosystem-production-domains.v1.json'; + +/** Canonical public origin for Z Ecosystem (not OMNL). */ +export const Z_ECOSYSTEM_PUBLIC_URL = + import.meta.env.VITE_Z_ECOSYSTEM_URL?.trim() || zProd.publicUrl; + +export function zEcosystemUrl(path: string): string { + const base = Z_ECOSYSTEM_PUBLIC_URL.replace(/\/$/, ''); + const suffix = path.startsWith('/') ? path : `/${path}`; + return `${base}${suffix}`; +} diff --git a/frontend-dapp/src/pages/HubPage.tsx b/frontend-dapp/src/pages/HubPage.tsx index e53eb2d..862d614 100644 --- a/frontend-dapp/src/pages/HubPage.tsx +++ b/frontend-dapp/src/pages/HubPage.tsx @@ -1,6 +1,7 @@ import { Link } from 'react-router-dom'; import NasaIcon, { type NasaIconName } from '../components/icons/NasaIcon'; import { GUOSMM_NOTICES } from '../config/guosmmNotices'; +import { Z_ECOSYSTEM_PORTAL_LINKS } from '../config/ecosystemLinks'; const BANKING: { path: string; label: string; icon: NasaIconName }[] = [ { path: '/central-bank', label: 'Z Online Bank / Central Bank', icon: 'central-bank' }, @@ -27,11 +28,40 @@ const OMNL_OPS: { path: string; label: string; icon: NasaIconName }[] = [ { path: '/omnl/terminal', label: 'Settlement terminal', icon: 'rail' }, ]; -const Z_ECOSYSTEM: { path: string; label: string; icon: NasaIconName }[] = [ - { path: '/z', label: 'Z Ecosystem hub', icon: 'globe' }, - { path: '/z-wallet', label: 'International Z Wallet', icon: 'globe' }, - { path: '/z-wallet#z-bot', label: 'Z Bot assistant', icon: 'rail' }, -]; +const Z_ECOSYSTEM = Z_ECOSYSTEM_PORTAL_LINKS.map((l) => ({ + href: l.href, + label: l.label, + icon: l.icon, +})); + +function ExternalGrid({ + title, + items, +}: { + title: string; + items: { href: string; label: string; icon: NasaIconName }[]; +}) { + return ( +
+

{title}

+ +
+ ); +} function LinkGrid({ title, @@ -77,7 +107,7 @@ export default function HubPage() { - +

GUOSMM official gazette

diff --git a/package.json b/package.json index 503e076..a138111 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "zchain:deploy-portal": "powershell -ExecutionPolicy Bypass -File scripts/deployment/deploy-z-ecosystem.ps1", "zchain:go-live": "powershell -ExecutionPolicy Bypass -File scripts/deployment/go-live-z-ecosystem.ps1", "zchain:deploy-production": "bash scripts/deployment/deploy-z-ecosystem-production.sh", + "zchain:deploy-domains": "bash scripts/deployment/deploy-z-domains.sh", "zchain:compile": "hardhat compile --config hardhat.zchain.config.js", "zchain:deploy": "hardhat run scripts/deployment/deploy-z-chain-contracts.js --network zchain --config hardhat.zchain.config.js", "verify:logger": "hardhat verify --network mainnet", diff --git a/scripts/deployment/activate-omnl-production.sh b/scripts/deployment/activate-omnl-production.sh index d1eadab..9d120d7 100644 --- a/scripts/deployment/activate-omnl-production.sh +++ b/scripts/deployment/activate-omnl-production.sh @@ -81,7 +81,8 @@ log " Central Bank: https://secure.d-bis.org/central-bank" log " Online banking: https://online.omdnl.org/central-bank" log " Office 24: https://office24.omdnl.org/office-24" log " DBIS Trade: https://exchange.d-bis.org/trade" -log " Digital Swap: https://digital.omdnl.org/swap" +log " Digital Swap: https://zblockchainsystem.com/swap" +log " Z Ecosystem: https://zblockchainsystem.com/z" log "=== Health ===" curl -sf http://127.0.0.1:3011/api/v1/settlement/health | head -c 120 || true echo diff --git a/scripts/deployment/bootstrap-z-chain-production.sh b/scripts/deployment/bootstrap-z-chain-production.sh index 3224367..64125be 100644 --- a/scripts/deployment/bootstrap-z-chain-production.sh +++ b/scripts/deployment/bootstrap-z-chain-production.sh @@ -55,5 +55,5 @@ docker run -d \ echo "" echo "Production Z Chain RPC (localhost): http://127.0.0.1:$RPC_PORT" -echo "Expose via nginx/Cloudflare as https://rpc.z.omdnl.org" -echo "Set CHAIN_900002_RPC_URL on portal LXC after tunnel/nginx is wired." +echo "Expose via nginx/Cloudflare as https://rpc.zblockchainsystem.com" +echo "Z portal: https://zblockchainsystem.com" diff --git a/scripts/deployment/deploy-omnl-bank-production.sh b/scripts/deployment/deploy-omnl-bank-production.sh index b2593e4..dfa9b5d 100644 --- a/scripts/deployment/deploy-omnl-bank-production.sh +++ b/scripts/deployment/deploy-omnl-bank-production.sh @@ -99,8 +99,9 @@ export VITE_TOKEN_AGGREGATION_URL="${VITE_TOKEN_AGGREGATION_URL:-/api/v1}" export VITE_SETTLEMENT_MIDDLEWARE_URL="${VITE_SETTLEMENT_MIDDLEWARE_URL:-/settlement}" export VITE_DBIS_EXCHANGE_URL="${VITE_DBIS_EXCHANGE_URL:-/exchange}" export VITE_ENABLE_Z_WALLET="${VITE_ENABLE_Z_WALLET:-true}" -export VITE_RPC_URL_900002="${VITE_RPC_URL_900002:-${CHAIN_900002_RPC_URL:-https://rpc.z.omdnl.org}}" -export VITE_Z_CHAIN_EXPLORER_URL="${VITE_Z_CHAIN_EXPLORER_URL:-https://explorer.z.omdnl.org}" +export VITE_RPC_URL_900002="${VITE_RPC_URL_900002:-${CHAIN_900002_RPC_URL:-https://rpc.zblockchainsystem.com}}" +export VITE_Z_CHAIN_EXPLORER_URL="${VITE_Z_CHAIN_EXPLORER_URL:-https://explorer.zblockchainsystem.com}" +export VITE_Z_ECOSYSTEM_URL="${VITE_Z_ECOSYSTEM_URL:-https://zblockchainsystem.com}" # Never embed operator API keys in production frontend — nginx injects server-side. unset VITE_OMNL_API_KEY if command -v pnpm >/dev/null 2>&1; then diff --git a/scripts/deployment/deploy-omnl-domains.sh b/scripts/deployment/deploy-omnl-domains.sh index 157ba00..2a4e644 100644 --- a/scripts/deployment/deploy-omnl-domains.sh +++ b/scripts/deployment/deploy-omnl-domains.sh @@ -41,7 +41,8 @@ check_host exchange.omdnl.org /trade check_host secure.d-bis.org /central-bank check_host office24.omdnl.org /office-24 check_host digital.omdnl.org /swap -check_host digital.omdnl.org /z + +log "Z Ecosystem domain (separate) — run scripts/deployment/deploy-z-domains.sh" log "OMNL domain deploy complete" log "DNS: point all domains A record to 76.53.10.34 (or Cloudflare proxy to origin)" diff --git a/scripts/deployment/deploy-z-domains.sh b/scripts/deployment/deploy-z-domains.sh new file mode 100644 index 0000000..a07a30c --- /dev/null +++ b/scripts/deployment/deploy-z-domains.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Install nginx vhost for Z Ecosystem (zblockchainsystem.com) +set -euo pipefail + +REPO_DIR="${Z_ECOSYSTEM_ROOT:-${OMNL_BANK_ROOT:-$HOME/smom-dbis-138}}" +VHOST_SRC="$REPO_DIR/deploy/nginx/z-ecosystem-domains.conf" +VHOST_DST="/etc/nginx/sites-available/z-ecosystem-domains" +VHOST_LINK="/etc/nginx/sites-enabled/z-ecosystem-domains" + +log() { echo "[$(date -Iseconds)] $*"; } + +if [ ! -f "$VHOST_SRC" ]; then + echo "Missing $VHOST_SRC" >&2 + exit 1 +fi + +log "Installing Z Ecosystem nginx vhost..." +sudo cp "$VHOST_SRC" "$VHOST_DST" +sudo ln -sf "$VHOST_DST" "$VHOST_LINK" + +log "Testing nginx..." +sudo nginx -t + +log "Reloading nginx..." +sudo systemctl reload nginx + +check_host() { + local host="$1" + local expect="$2" + local code + code=$(curl -s -o /dev/null -w '%{http_code}' -H "Host: $host" "http://127.0.0.1/") + log " $host -> HTTP $code (expect redirect toward $expect)" +} + +check_host zblockchainsystem.com /z +check_host www.zblockchainsystem.com /z + +log "Z domain deploy complete — https://zblockchainsystem.com/z" diff --git a/scripts/deployment/deploy-z-ecosystem-production.sh b/scripts/deployment/deploy-z-ecosystem-production.sh index 2465627..89336b5 100644 --- a/scripts/deployment/deploy-z-ecosystem-production.sh +++ b/scripts/deployment/deploy-z-ecosystem-production.sh @@ -1,13 +1,22 @@ #!/usr/bin/env bash -# Production deploy: Z Chain env + OMNL banking portal (LXC / server). +# Production deploy: Z Ecosystem on zblockchainsystem.com (separate from OMNL portals). set -euo pipefail ROOT="$(cd "$(dirname "$0")/../.." && pwd)" -ENV_FILE="${Z_ECOSYSTEM_ENV:-${OMNL_BANK_ENV:-$ROOT/.env}}" +ENV_FILE="${Z_ECOSYSTEM_ENV:-$ROOT/config/z-ecosystem.local.env}" PROD_CFG="$ROOT/config/z-chain-production.v1.json" +DOMAIN_CFG="$ROOT/config/z-ecosystem-production-domains.v1.json" log() { echo "[$(date -Iseconds)] $*"; } +if [[ -f "$ROOT/.env" ]]; then + set -a + set +u + # shellcheck disable=SC1090 + source "$ROOT/.env" + set -u + set +a +fi if [[ -f "$ENV_FILE" ]]; then set -a set +u @@ -17,36 +26,45 @@ if [[ -f "$ENV_FILE" ]]; then set +a fi -export CHAIN_900002_RPC_URL="${CHAIN_900002_RPC_URL:-https://rpc.z.omdnl.org}" +export CHAIN_900002_RPC_URL="${CHAIN_900002_RPC_URL:-https://rpc.zblockchainsystem.com}" export VITE_RPC_URL_900002="${VITE_RPC_URL_900002:-$CHAIN_900002_RPC_URL}" -export VITE_Z_CHAIN_EXPLORER_URL="${VITE_Z_CHAIN_EXPLORER_URL:-https://explorer.z.omdnl.org}" +export VITE_Z_CHAIN_EXPLORER_URL="${VITE_Z_CHAIN_EXPLORER_URL:-https://explorer.zblockchainsystem.com}" +export VITE_Z_ECOSYSTEM_URL="${VITE_Z_ECOSYSTEM_URL:-https://zblockchainsystem.com}" export VITE_ENABLE_Z_WALLET="${VITE_ENABLE_Z_WALLET:-true}" +export VITE_TOKEN_AGGREGATION_URL="${VITE_TOKEN_AGGREGATION_URL:-/api/v1}" +export VITE_SETTLEMENT_MIDDLEWARE_URL="${VITE_SETTLEMENT_MIDDLEWARE_URL:-/settlement}" +export VITE_DBIS_EXCHANGE_URL="${VITE_DBIS_EXCHANGE_URL:-/exchange}" -log "Z Ecosystem production deploy" -log " config: $PROD_CFG" -log " rpc: $CHAIN_900002_RPC_URL" +log "Z Ecosystem production deploy (zblockchainsystem.com)" +log " chain: $PROD_CFG" +log " domain: $DOMAIN_CFG" +log " portal: $VITE_Z_ECOSYSTEM_URL" +log " rpc: $CHAIN_900002_RPC_URL" if [[ "${Z_CHAIN_BOOTSTRAP_PROD:-0}" == "1" ]]; then - log "Bootstrapping Besu Z Chain on this host..." + log "Bootstrapping Besu Z Chain..." sudo bash "$ROOT/scripts/deployment/bootstrap-z-chain-production.sh" fi if [[ "${Z_CHAIN_DEPLOY_CONTRACTS:-0}" == "1" ]]; then log "Deploying Z Chain contracts..." - export CHAIN_900002_RPC_URL node "$ROOT/scripts/deployment/deploy-z-chain-contracts.js" --network zchain node "$ROOT/scripts/deployment/sync-z-chain-deployed-addresses.mjs" fi -log "Building and starting OMNL stack (includes Z Wallet routes)..." +log "Build backend + frontend (Z routes in SPA)..." bash "$ROOT/scripts/deployment/deploy-omnl-bank-production.sh" +log "Install Z domain nginx vhost..." +bash "$ROOT/scripts/deployment/deploy-z-domains.sh" + if [[ "${Z_ECOSYSTEM_PUSH_PCT:-0}" == "1" ]]; then log "Pushing portal bundle to Proxmox LXC..." bash "$ROOT/scripts/deployment/deploy-omnl-banking-portal-pct.sh" fi log "Done. Verify:" -log " curl -sf http://127.0.0.1:3011/api/v1/settlement/health" log " curl -sf http://127.0.0.1:3000/api/v1/z-bot/health" -log " Portal: https://digital.omdnl.org/z-wallet (after nginx/Cloudflare)" +log " curl -sf http://127.0.0.1:3011/api/v1/settlement/health" +log " curl -sI https://zblockchainsystem.com/z" +log " bash scripts/deployment/print-z-dns-records.sh" diff --git a/scripts/deployment/go-live-z-ecosystem.ps1 b/scripts/deployment/go-live-z-ecosystem.ps1 index 01dd70a..0bae353 100644 --- a/scripts/deployment/go-live-z-ecosystem.ps1 +++ b/scripts/deployment/go-live-z-ecosystem.ps1 @@ -29,13 +29,14 @@ Set-Location $Root Import-DotEnvFile (Join-Path $Root ".env") Import-DotEnvFile (Join-Path $Root "config\z-ecosystem.local.env") -# Production frontend env (same-origin paths on digital.omdnl.org) +# Production frontend env (same-origin on zblockchainsystem.com) $env:VITE_TOKEN_AGGREGATION_URL = "/api/v1" $env:VITE_SETTLEMENT_MIDDLEWARE_URL = "/settlement" $env:VITE_DBIS_EXCHANGE_URL = "/exchange" $env:VITE_ENABLE_Z_WALLET = "true" -$env:VITE_RPC_URL_900002 = if ($env:VITE_RPC_URL_900002) { $env:VITE_RPC_URL_900002 } else { "https://rpc.z.omdnl.org" } -$env:VITE_Z_CHAIN_EXPLORER_URL = if ($env:VITE_Z_CHAIN_EXPLORER_URL) { $env:VITE_Z_CHAIN_EXPLORER_URL } else { "https://explorer.z.omdnl.org" } +$env:VITE_RPC_URL_900002 = if ($env:VITE_RPC_URL_900002) { $env:VITE_RPC_URL_900002 } else { "https://rpc.zblockchainsystem.com" } +$env:VITE_Z_CHAIN_EXPLORER_URL = if ($env:VITE_Z_CHAIN_EXPLORER_URL) { $env:VITE_Z_CHAIN_EXPLORER_URL } else { "https://explorer.zblockchainsystem.com" } +$env:VITE_Z_ECOSYSTEM_URL = if ($env:VITE_Z_ECOSYSTEM_URL) { $env:VITE_Z_ECOSYSTEM_URL } else { "https://zblockchainsystem.com" } Remove-Item Env:VITE_OMNL_API_KEY -ErrorAction SilentlyContinue Write-Host "=== 1/4 Local stack (Z Chain + APIs + portal) ===" @@ -126,11 +127,11 @@ if ($tunnelUrl) { Write-Host " Local: http://localhost:3002/z" } Write-Host "" -Write-Host "Production origin digital.omdnl.org - run on dev-bis-ali:" +Write-Host "Production portal zblockchainsystem.com - run on dev-bis-ali:" Write-Host ' cd ~/smom-dbis-138; git pull; bash scripts/deployment/deploy-z-ecosystem-production.sh' Write-Host ' # or push bundle to LXC:' Write-Host ' Z_ECOSYSTEM_PUSH_PCT=1 bash scripts/deployment/deploy-z-ecosystem-production.sh' Write-Host "" Write-Host "DNS still required for Z Chain RPC:" -Write-Host ' rpc.z.omdnl.org -> Besu host port 8546' -Write-Host ' explorer.z.omdnl.org -> explorer optional' +Write-Host ' rpc.zblockchainsystem.com -> Besu host port 8546' +Write-Host ' explorer.zblockchainsystem.com -> explorer optional' diff --git a/scripts/deployment/print-omnl-dns-records.sh b/scripts/deployment/print-omnl-dns-records.sh index c967d08..60368df 100644 --- a/scripts/deployment/print-omnl-dns-records.sh +++ b/scripts/deployment/print-omnl-dns-records.sh @@ -16,7 +16,7 @@ Zone: omdnl.org A secure $ORIGIN_IP yes Central Bank (/central-bank) A online $ORIGIN_IP yes Online banking (/central-bank) A forex $ORIGIN_IP yes Forex terminal (/trade) - A digital $ORIGIN_IP yes Digital swap (/swap) + A digital $ORIGIN_IP yes Legacy swap (/swap) — prefer zblockchainsystem.com Zone: omdnl.org (Office 24) Type Name Content Proxy Dashboard @@ -40,6 +40,9 @@ Live URLs once DNS is active: https://online.omdnl.org/central-bank https://forex.omdnl.org/trade https://digital.omdnl.org/swap + https://zblockchainsystem.com/z + https://zblockchainsystem.com/z-wallet + https://zblockchainsystem.com/swap https://office24.omdnl.org/office-24 https://exchange.d-bis.org/trade https://secure.d-bis.org/central-bank diff --git a/scripts/deployment/print-z-dns-records.sh b/scripts/deployment/print-z-dns-records.sh new file mode 100644 index 0000000..50791f5 --- /dev/null +++ b/scripts/deployment/print-z-dns-records.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# DNS records for Z Ecosystem (zblockchainsystem.com) — separate from OMNL + +ORIGIN_IP="${Z_ECOSYSTEM_ORIGIN_IP:-${OMNL_ORIGIN_IP:-76.53.10.34}}" + +cat <