feat: split Z Ecosystem from OMNL/DBIS with separate builds and deploy
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m14s
CI/CD Pipeline / Security Scanning (push) Successful in 2m34s
CI/CD Pipeline / Lint and Format (push) Failing after 40s
CI/CD Pipeline / Terraform Validation (push) Failing after 24s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 26s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 37s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 22s
Validation / validate-genesis (push) Successful in 24s
Validation / validate-terraform (push) Failing after 24s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m22s
Validation / validate-documentation (push) Failing after 17s
Verify Deployment / Verify Deployment (push) Failing after 47s

Add VITE_ECOSYSTEM build profiles, Z-only nginx vhosts, standalone Z production stack script, and remove Z Chain from OMNL registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 05:17:40 -07:00
parent eaca1ee6ca
commit a2db92f3cb
27 changed files with 448 additions and 153 deletions

View File

@@ -81,8 +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://zblockchainsystem.com/swap"
log " Z Ecosystem: https://zblockchainsystem.com/z"
log " Digital Swap: https://exchange.omdnl.org/trade (OMNL) | Z: https://zblockchainsystem.com/swap"
log " Z Ecosystem: https://zblockchainsystem.com/z (separate product)"
log "=== Health ==="
curl -sf http://127.0.0.1:3011/api/v1/settlement/health | head -c 120 || true
echo

View File

@@ -0,0 +1,102 @@
#!/usr/bin/env bash
# Build and start Z Ecosystem stack only (no OMNL portal deploy).
set -euo pipefail
REPO_DIR="${Z_ECOSYSTEM_ROOT:-$HOME/smom-dbis-138}"
LOG_DIR="${Z_ECOSYSTEM_LOG_DIR:-$HOME/z-ecosystem/logs}"
ENV_FILE="${Z_ECOSYSTEM_ENV:-$REPO_DIR/config/z-ecosystem.local.env}"
FRONTEND_PORT="${Z_ECOSYSTEM_FRONTEND_PORT:-3002}"
log() { echo "[$(date -Iseconds)] $*"; }
mkdir -p "$LOG_DIR"
cd "$REPO_DIR"
if [[ -f "$REPO_DIR/.env" ]]; then
set -a; set +u; source "$REPO_DIR/.env"; set -u; set +a
fi
if [[ -f "$ENV_FILE" ]]; then
set -a; set +u; source "$ENV_FILE"; set -u; set +a
fi
export VITE_ECOSYSTEM=z
export VITE_ENABLE_Z_WALLET=true
export OMNL_SUPPORTED_CHAINS_CONFIG="${Z_SUPPORTED_CHAINS_CONFIG:-$REPO_DIR/config/z-supported-chains.v1.json}"
export SETTLEMENT_MIDDLEWARE_CONFIG="${SETTLEMENT_MIDDLEWARE_CONFIG:-$REPO_DIR/config/settlement-middleware.production.v1.json}"
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.zblockchainsystem.com}"
export VITE_Z_ECOSYSTEM_URL="${VITE_Z_ECOSYSTEM_URL:-https://zblockchainsystem.com}"
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}"
build_pkg() {
local dir="$1"
log "Building $dir..."
cd "$REPO_DIR/$dir"
NODE_ENV=development npm install --no-fund --no-audit
npm run build
}
for dir in packages/integration-foundation packages/settlement-core \
services/token-aggregation services/settlement-middleware services/dbis-exchange; do
build_pkg "$dir"
done
log "Building Z frontend (VITE_ECOSYSTEM=z)..."
cd "$REPO_DIR/frontend-dapp"
unset VITE_OMNL_API_KEY
if command -v pnpm >/dev/null 2>&1; then
pnpm install --frozen-lockfile 2>/dev/null || pnpm install
VITE_ECOSYSTEM=z pnpm run build:z
else
npm install
VITE_ECOSYSTEM=z npm run build:z
fi
start_svc() {
local name="$1"
local dir="$2"
local port="$3"
local cmd="$4"
log "Starting $name on :$port"
cd "$REPO_DIR/$dir"
pkill -f "smom-dbis-138/$dir" 2>/dev/null || true
fuser -k "${port}/tcp" 2>/dev/null || true
sleep 1
nohup env \
SETTLEMENT_MIDDLEWARE_CONFIG="$SETTLEMENT_MIDDLEWARE_CONFIG" \
OMNL_SUPPORTED_CHAINS_CONFIG="$OMNL_SUPPORTED_CHAINS_CONFIG" \
Z_SUPPORTED_CHAINS_CONFIG="$OMNL_SUPPORTED_CHAINS_CONFIG" \
TOKEN_AGGREGATION_URL="${TOKEN_AGGREGATION_URL:-http://127.0.0.1:3000}" \
CHAIN_900002_RPC_URL="$CHAIN_900002_RPC_URL" \
AZURE_OPENAI_ENDPOINT="${AZURE_OPENAI_ENDPOINT:-}" \
AZURE_OPENAI_API_KEY="${AZURE_OPENAI_API_KEY:-}" \
AZURE_OPENAI_DEPLOYMENT="${AZURE_OPENAI_DEPLOYMENT:-}" \
AZURE_OPENAI_API_VERSION="${AZURE_OPENAI_API_VERSION:-2024-02-15-preview}" \
bash -c "$cmd" >"$LOG_DIR/$name.log" 2>&1 &
echo $! >"$LOG_DIR/$name.pid"
}
start_svc token-aggregation services/token-aggregation 3000 "npm run start"
sleep 2
start_svc settlement-middleware services/settlement-middleware 3011 "npm run start"
sleep 2
start_svc dbis-exchange services/dbis-exchange 3012 "npm run start"
sleep 2
pkill -f "serve -s.*$FRONTEND_PORT" 2>/dev/null || true
cd "$REPO_DIR/frontend-dapp"
nohup npx --yes serve -s dist -l "$FRONTEND_PORT" >"$LOG_DIR/frontend.log" 2>&1 &
echo $! >"$LOG_DIR/frontend.pid"
sleep 5
log "Z health checks..."
curl -sf "http://127.0.0.1:3000/api/v1/z-bot/health" | head -c 200 || true
echo
curl -sf "http://127.0.0.1:3011/api/v1/settlement/health" | head -c 200 || true
echo
curl -sf -o /dev/null -w "z-hub=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/z"
curl -sf -o /dev/null -w "z-wallet=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/z-wallet"
log "Z stack ready on :$FRONTEND_PORT"

View File

@@ -98,18 +98,17 @@ cd "$REPO_DIR/frontend-dapp"
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.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}"
export VITE_ECOSYSTEM="${VITE_ECOSYSTEM:-omnl}"
export VITE_ENABLE_Z_WALLET="${VITE_ENABLE_Z_WALLET:-false}"
unset VITE_RPC_URL_900002 VITE_Z_CHAIN_EXPLORER_URL VITE_Z_ECOSYSTEM_URL
# 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
pnpm install --frozen-lockfile 2>/dev/null || pnpm install
pnpm run build
VITE_ECOSYSTEM=omnl pnpm run build:omnl
else
npm install
npm run build
VITE_ECOSYSTEM=omnl npm run build:omnl
fi
start_svc() {
@@ -188,10 +187,7 @@ echo
curl -sf "http://127.0.0.1:3012/api/v1/exchange/health" | head -c 200 || true
echo
curl -sf -o /dev/null -w "frontend=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/central-bank"
curl -sf -o /dev/null -w "z-hub=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/z"
curl -sf -o /dev/null -w "z-wallet=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/z-wallet"
curl -sf "http://127.0.0.1:3000/api/v1/z-bot/health" | head -c 200 || true
echo
curl -sf -o /dev/null -w "hub=%{http_code}\n" "http://127.0.0.1:$FRONTEND_PORT/hub"
curl -sf "http://127.0.0.1:8788/health" 2>/dev/null | head -c 80 || log "WARN: SWIFT listener :8788 not reachable"
if [[ -n "${DATABASE_URL:-}" ]] && [[ "${SEED_SUPER_ADMIN_USERS:-1}" == "1" ]]; then

View File

@@ -16,6 +16,9 @@ fi
log "Installing Z Ecosystem nginx vhost..."
sudo cp "$VHOST_SRC" "$VHOST_DST"
SNIPPET_SRC="$REPO_DIR/deploy/nginx/z-ecosystem-common-locations.conf"
SNIPPET_DST="/etc/nginx/snippets/z-ecosystem-common-locations.conf"
sudo cp "$SNIPPET_SRC" "$SNIPPET_DST"
sudo ln -sf "$VHOST_DST" "$VHOST_LINK"
log "Testing nginx..."

View File

@@ -52,8 +52,8 @@ if [[ "${Z_CHAIN_DEPLOY_CONTRACTS:-0}" == "1" ]]; then
node "$ROOT/scripts/deployment/sync-z-chain-deployed-addresses.mjs"
fi
log "Build backend + frontend (Z routes in SPA)..."
bash "$ROOT/scripts/deployment/deploy-omnl-bank-production.sh"
log "Build Z-only backend + frontend..."
bash "$ROOT/scripts/deployment/build-z-ecosystem-stack.sh"
log "Install Z domain nginx vhost..."
bash "$ROOT/scripts/deployment/deploy-z-domains.sh"

View File

@@ -48,6 +48,8 @@ $env:CHAIN_900002_RPC_URL = if ($env:CHAIN_900002_RPC_URL) { $env:CHAIN_900002_R
$env:SETTLEMENT_MIDDLEWARE_URL = if ($env:SETTLEMENT_MIDDLEWARE_URL) { $env:SETTLEMENT_MIDDLEWARE_URL } else { "http://127.0.0.1:3011" }
$env:SETTLEMENT_URL = $env:SETTLEMENT_MIDDLEWARE_URL
$env:TOKEN_AGGREGATION_URL = "http://127.0.0.1:3000"
$env:VITE_ECOSYSTEM = "z"
$env:OMNL_SUPPORTED_CHAINS_CONFIG = Join-Path $Root "config\z-supported-chains.v1.json"
if (-not $env:SETTLEMENT_MIDDLEWARE_CONFIG) {
$env:SETTLEMENT_MIDDLEWARE_CONFIG = Join-Path $Root "config\settlement-middleware.production.v1.json"
@@ -84,10 +86,10 @@ if (-not (Test-Path node_modules)) { npm install --legacy-peer-deps 2>&1 | Out-N
npm run build
if ($LASTEXITCODE -ne 0) { throw "token-aggregation build failed" }
Write-Host "Building frontend-dapp (Z Wallet routes) ..."
Write-Host "Building frontend-dapp (Z Ecosystem only) ..."
Set-Location "$Root\frontend-dapp"
if (-not (Test-Path node_modules)) { npm install --legacy-peer-deps 2>&1 | Out-Null }
npm run build
npm run build:z
if ($LASTEXITCODE -ne 0) { throw "frontend build failed" }
Stop-Port 3011

View File

@@ -0,0 +1,12 @@
# Run as Administrator to map zblockchainsystem.com to this PC (local Z portal on :3002)
$marker = '# Z Ecosystem only'
$hostsPath = "$env:SystemRoot\System32\drivers\etc\hosts"
$line = '127.0.0.1 zblockchainsystem.com www.zblockchainsystem.com rpc.zblockchainsystem.com explorer.zblockchainsystem.com'
$content = Get-Content $hostsPath -Raw
if ($content -match [regex]::Escape($marker)) {
Write-Host 'Z hosts entries already present.'
exit 0
}
Add-Content -Path $hostsPath -Value "`n$marker`n$line"
Write-Host 'Added zblockchainsystem.com -> 127.0.0.1'
Write-Host 'Open: http://zblockchainsystem.com:3002/z'

View File

@@ -30,6 +30,7 @@ Import-DotEnvFile (Join-Path $Root ".env")
Import-DotEnvFile (Join-Path $Root "config\z-ecosystem.local.env")
# Production frontend env (same-origin on zblockchainsystem.com)
$env:VITE_ECOSYSTEM = "z"
$env:VITE_TOKEN_AGGREGATION_URL = "/api/v1"
$env:VITE_SETTLEMENT_MIDDLEWARE_URL = "/settlement"
$env:VITE_DBIS_EXCHANGE_URL = "/exchange"
@@ -43,9 +44,9 @@ Write-Host "=== 1/4 Local stack (Z Chain + APIs + portal) ==="
& "$PSScriptRoot\deploy-z-ecosystem.ps1"
Write-Host ""
Write-Host "=== 2/4 Production frontend build ==="
Write-Host "=== 2/4 Production frontend build (Z-only) ==="
Set-Location "$Root\frontend-dapp"
npm run build
npm run build:z
if ($LASTEXITCODE -ne 0) { throw "production frontend build failed" }
Write-Host ""