## 背景 chain-indexer(:3009)此前使用Mock模式,每10秒生成假区块数据(hash为纯数字填充, txCount固定为0),未连接任何真实区块链节点。这是整个区块链架构中唯一的功能缺口 (8大核心服务中TX Indexer完成度仅85%)。 ## 改动内容 ### 新增文件 - internal/domain/repository/chain_client.go DDD领域接口ChainClient,定义GetLatestBlockNumber/GetBlockByNumber/Close三个方法, 遵循依赖倒置原则,应用层不依赖具体RPC实现 - internal/infrastructure/rpc/eth_client.go EthChainClient实现,基于go-ethereum/ethclient: · ethclient.Dial()连接EVM JSON-RPC节点 · BlockByNumber()获取完整区块(hash/timestamp/txCount) · types.LatestSignerForChainID()恢复交易发送方地址 · TransactionReceipt()获取交易执行状态(confirmed/failed) ### 修改文件 - go.mod: 新增github.com/ethereum/go-ethereum v1.14.8依赖 - internal/application/service/indexer_service.go · 注入ChainClient依赖,移除所有Mock逻辑 · 轮询间隔10s→2s(匹配链~1s出块时间) · 批量追赶:每周期最多索引50个区块,快速消化落后高度 · 新增GetChainHeight()/IsSynced()方法供API层使用 · 区块+交易分别持久化,每条交易独立发布Kafka事件 - cmd/server/main.go · 新增RPC_URL环境变量(默认http://localhost:8545) · 初始化EthChainClient并注入IndexerService · /api/v1/chain/status返回真实chainHeight和syncing状态 - internal/interface/http/handler/admin_chain_handler.go · GetContracts: 合约列表更新为真实11个已部署合约(与genex-contracts对齐) · GetGasMonitor: Gas数据全部归零(Genex Chain min_gas_price=0平台补贴) · GetChainStats: 使用真实chainHeight计算indexerLag/tps/indexerStatus · chainId修正88888→8888,consensusType修正PoA→CometBFT ## 环境变量 RPC_URL=http://localhost:8545 (Docker内使用 http://genex-node-1:8545) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| backend | ||
| blockchain | ||
| docs | ||
| frontend | ||
| .gitignore | ||
| README.md | ||
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
Legal & Operations
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