Go to file
hailin 0b1de382b0 fix(deploy): 服务器部署修复 — 全栈编译运行通过
在内网服务器 (192.168.1.222) 首次部署时发现并修复的所有问题,
涉及 backend (12微服务)、blockchain (Cosmos SDK节点)、前端 (admin-web)。

## Backend 修复

### docker-compose.yml
- DB_PASSWORD: 从硬编码 `genex_dev_password` 改为 `${DB_PASSWORD}` 环境变量插值,
  所有13个服务统一从 .env 读取,避免密码不一致导致连接失败
- Kong 镜像: `kong:3.5-alpine` → `kong:3.5`,alpine 版本在 amd64 上缺少依赖
- chain-indexer: 环境变量名 `CHAIN_RPC_URL` → `RPC_URL` (与 Go 代码 getEnv 一致)
- chain-indexer: RPC 地址改为 `http://172.17.0.1:8545` (Docker bridge gateway,
  跨 docker-compose network 访问 blockchain 节点的 EVM JSON-RPC)
- chain-indexer: 补全缺失的 DB_HOST/DB_PORT/DB_USERNAME/DB_PASSWORD/DB_NAME

### ai-service
- ai.module.ts: 移除重复的 TypeOrmModule.forRootAsync — 该模块错误地使用了
  DB_USER/DB_PASS (默认 'genex'/'genex') 和独立数据库 genex_ai,与 app.module.ts
  中已有的 TypeOrmModule.forRoot 冲突,导致密码认证失败
- app.module.ts: 添加 ConfigModule.forRoot({ isGlobal: true }),因为
  JwtModule.registerAsync 依赖 ConfigService 注入

### 依赖补全
- user-service/package.json: 添加 kafkajs ^2.2.4 (Kafka 事件消费)
- admin-service/package.json: 添加 kafkajs ^2.2.4 (Kafka 事件消费)

## Blockchain 修复

### genex-chain/app.go — 修复 chainConfig panic
- 问题: NewGenexApp 被调用两次 (tempApp 注册编码 + 实际启动),cosmos/evm 的
  SetChainConfig 在第二次调用时 panic: "chainConfig already set"
- 原因: 原代码 `if evmChainID == 0 { evmChainID = GenexEVMChainID }` 导致
  tempApp 也使用 8888,SetChainConfig 设置后,实际 app 再次设置时触发 panic
- 修复: 移除默认值回退,让 tempApp 使用 evmChainID=0 → DefaultEVMChainID(262144),
  实际 app 从 app.toml 读取 8888 后可正常覆盖

### genex-chain/cmd/genexd/cmd/root.go
- 移除未使用的 banktypes import (编译错误)

### docker-compose.yml
- 添加 `command: ["start", "--chain-id", "genex-testnet-1"]` 到 x-genex-node 默认配置,
  否则 InitChain 时 chain-id 为空导致校验失败

### init-genesis.sh (新增)
- 创世初始化脚本: init → 补丁 genesis.json → 创建验证者 → gentx → collect-gentxs
- 将所有默认 denom (aatom) 替换为 agnx (GNX, 18 decimals EVM 兼容)
- 配置: evm_denom, bond_denom, mint_denom, gov min_deposit, bank denom_metadata
- 启用 JSON-RPC (0.0.0.0:8545/8546)、REST API、CORS
- 设置 evm-chain-id=8888

## 部署结果
- 20 个 Docker 容器全部运行 (4 基础设施 + 12 后端 + 1 区块链节点 + 1 前端 + 2 辅助)
- 区块链稳定出块 (height 80+),EVM JSON-RPC 正常
- chain-indexer 实时索引区块 (lag=0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 05:29:33 -08:00
.claude feat: 区块链生态基础设施完整实现 — 12组件全量交付 (Phase 11) 2026-02-15 18:03:04 -08:00
backend fix(deploy): 服务器部署修复 — 全栈编译运行通过 2026-02-20 05:29:33 -08:00
blockchain fix(deploy): 服务器部署修复 — 全栈编译运行通过 2026-02-20 05:29:33 -08:00
docs feat: 新增 deploy.sh 部署管理脚本体系 — 后端主控+12服务独立+区块链 2026-02-19 17:13:09 -08:00
frontend feat: 三端集成 App升级 + 内部推送 + FCM外部推送框架 (genex-mobile/admin-app/mobile) 2026-02-13 07:02:14 -08:00
.gitignore chore: Ignore Claude Code config and Flutter auto-generated files 2026-02-11 07:28:02 -08:00
README.md Update company names and structure (Inc. for West, Ltd. for Asia) 2026-01-28 00:15:01 -08:00

README.md

Global Coupon Exchange

Website: gogenex.com

Brand Naming Strategy

This project adopts a regional branding strategy, using different brand names for different markets while maintaining brand family consistency.

Brand Structure

Market Brand Abbr Description
Western (US/Europe) Genex GNX Derived from Generation + Exchange, familiar Western naming style
Asian (including China) Gensen / 券信 GS "Gensen" from Cantonese pronunciation of Chinese characters "券信"

Unified Domain

  • gogenex.com - Single global domain for all markets
  • Subdomains or paths for regional content (e.g., gogenex.com/cn, gogenex.com/asia)

Naming Logic

Genex (Western Markets)

  • Gen = Generation / Generic / Genesis
  • ex = Exchange
  • Natural pronunciation, similar to well-known Western brands like FedEx, Amex
  • Professional, modern, and trustworthy fintech image

Gensen / 券信 (Asian Markets)

  • 券 (Quan) = Coupon / Voucher
  • 信 (Xin) = Trust / Credit
  • Gensen = Romanization of Cantonese pronunciation "gyun seon"
  • Use Chinese characters "券信" in Mainland China
  • Use romanized "Gensen" in other Asian regions
  • Two characters conveying core values: coupon trading + trust guarantee

Brand Consistency

Genex    ←── "Gen-" prefix ──→  Gensen
   ↑                              ↑
   └─────── Same brand family ────┘
                   ↓
                 券信 (Chinese localization)
  • Genex and Gensen share the "Gen-" prefix, establishing brand family recognition
  • Gensen directly transliterates to 券信, providing seamless connection
  • Global users can recognize these as regional versions of the same platform

Usage Scenarios

Scenario Western Markets Asian Markets (non-China) China Market
Company Name GoGenex Inc. Gensen Asia Ltd. 券信科技有限公司
App Name Genex Gensen 券信
Domain gogenex.com gogenex.com/asia gogenex.com/cn
Social Media @gogenex @gensen_official @券信official

Note on Company Structure:

  • Inc. (Corporation) for Western markets: Better for VC funding, stock issuance, and potential IPO
  • Ltd. (Limited) for Asian markets: Common structure in Asia-Pacific region
  • Social media handles use variations to avoid conflicts with existing accounts

Due to varying financial regulations across countries, each regional brand will:

  • Operate as an independent legal entity
  • Comply with local regulatory requirements
  • Share core technology platform and philosophy
  • Establish brand association through parent company

Project Overview

Global Coupon Exchange (GCX) is a coupon asset trading platform designed to provide users with secure and convenient trading services for digital assets such as coupons, gift cards, and vouchers.

Core Features

  • Coupon asset listing and trading
  • Secure transaction matching mechanism
  • Multi-currency settlement support
  • User credit system

Tech Stack

TBD

Documentation

For detailed development documentation, please refer to the docs directory.

License

TBD