# CrossVerse **Repository Path**: czleader/cross-verse ## Basic Information - **Project Name**: CrossVerse - **Description**: No description available - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 28 - **Created**: 2026-05-19 - **Last Updated**: 2026-05-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Cross_Verse 跨链数字内容资产交易市场。 本项目提供面向数字内容资产交易场景的完整演示系统,覆盖用户注册登录、商品发布、交易流转、基础设施联通与状态验证。 ## 1. 项目简介 Cross_Verse 采用前后端分层架构,并接入联盟链与跨链组件作为可信底座。系统围绕数字内容资产交易生命周期设计,支持以下关键流程: 1. 资产发布与在售管理 2. 买家下单与交易创建 3. 交易状态推进(收据、质押、支付、交付等字段) 4. 交易完成或终止 5. 基础设施健康状态统一检查 ## 2. 技术栈 ### 2.1 前端 - Vue 3 - Vue Router - Bootstrap - 默认访问端口:8080 ### 2.2 后端 - Flask - REST API - 本地 JSON 持久化(当前实现) - 默认服务端口:5000 ### 2.3 基础设施 - FISCO BCOS 3.x - WeBASE - WeCross Router - WeCross Account-Manager - 独立 MySQL(13306) ## 3. 仓库结构 - `frontend/`:前端应用 - `backend/service/`:后端服务 - `backend/infra/`:基础设施脚本与运行手册 - `releases/`:桌面打包产物 ## 4. 环境要求 - Windows 10/11 - WSL2 + Ubuntu-22.04 - Git - Node.js LTS(建议 18 或 20) - Python 3.11+ - Java 17 Windows 可选安装命令: ```powershell winget install Git.Git winget install OpenJS.NodeJS.LTS winget install Python.Python.3.11 winget install EclipseAdoptium.Temurin.17.JDK ``` 版本校验: ```powershell git --version node -v npm -v python --version java -version wsl -l -v ``` ## 5. 获取项目 ```bash git clone cd <仓库目录> ``` > 说明:以下命令中的 `<仓库目录>` 请替换为你本机实际路径。 ## 6. 一次性基础设施部署 以下步骤在 PowerShell 执行,命令会自动进入 WSL。 ### 6.1 部署 FISCO BCOS ```powershell wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/fisco-bcos-3/setup_wsl.sh" ``` ### 6.2 部署 WeBASE ```powershell wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/webase-3/setup_wsl.sh" ``` ### 6.3 部署 WeCross ```powershell wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/wecross/setup_wsl.sh" ``` ## 7. 启动系统 ### 7.1 启动 WeCross 交易小栈 该脚本负责 MySQL(13306) + Account-Manager(8340) + Router(8250/25500): ```powershell wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/wecross/restart_stack_wsl.sh restart" ``` 状态检查与健康检查: ```powershell wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/wecross/restart_stack_wsl.sh status" wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/<盘符小写>/<仓库目录>; bash backend/infra/wecross/restart_stack_wsl.sh health" ``` ### 7.2 启动后端 ```powershell cd <仓库目录>\backend\service .\start_backend.ps1 ``` ### 7.3 启动前端 ```powershell cd <仓库目录>\frontend npm install npm run serve ``` ## 8. 访问入口 - 前端首页:`http://127.0.0.1:8080` - 后端健康:`http://127.0.0.1:5000/api/health` - 基础设施状态:`http://127.0.0.1:5000/api/infra/status` - WeBASE Web:`http://127.0.0.1:5500` - WeBASE Front:`http://127.0.0.1:5502/WeBASE-Front` ## 9. 用户操作流程 ### 9.1 注册与登录 1. 打开前端首页 2. 创建新账号或使用已有账号登录 3. 登录成功后进入交易页面 ### 9.2 发布商品 在售卖页填写并提交: 1. 商品图片 2. 商品名称 3. Hash 4. 承诺(Commitment) 5. 证书(Cert) 6. 价格 ### 9.3 购买商品 1. 进入购买页 2. 选择商品并提交购买 3. 系统创建交易记录并从在售列表移除该商品 ### 9.4 推进交易状态 在买入交易页和卖出交易页按业务流程推进状态,直至: 1. 交易完成 2. 或交易终止/追责 ## 10. API 列表 - `GET /api/health` - `GET /api/infra/status` - `GET /api/accounts?username=xxx` - `POST /api/accounts` - `GET /api/onsale` - `POST /api/onsale` - `POST /api/trades` - `GET /api/trades?role=buyer&username=xxx` - `GET /api/trades?role=seller&username=xxx` - `POST /api/trades/{productID}/update` - `DELETE /api/trades/{productID}` ## 11. 联通性检查 ### 11.1 端口检查 ```powershell wsl -d Ubuntu-22.04 -- bash -lc "ss -lnt | grep -E ':20200|:20201|:13306|:8340|:8250|:25500|:5500|:5502|:5001|:5004'" ``` ### 11.2 后端聚合状态检查 ```powershell Invoke-RestMethod http://127.0.0.1:5000/api/infra/status ``` ### 11.3 服务返回码说明 - 8340 返回 400 可视为 Account-Manager 存活 - 8250 返回 404 可视为 Router 存活 ## 12. 常见问题 ### 12.1 前端页面打不开或白屏 1. 确认 `npm run serve` 正在运行 2. 确认访问地址为 `http://127.0.0.1:8080` 3. 查看前端终端输出是否报错 ### 12.2 登录/上架接口失败 1. 确认后端已启动 2. 检查 `http://127.0.0.1:5000/api/health` 3. 查看后端终端日志 ### 12.3 `/api/infra/status` 返回 `ok=false` 按顺序检查: 1. FISCO 节点端口(20200/20201) 2. WeBASE 端口(5500/5502) 3. 执行 `restart_stack_wsl.sh restart` 4. 执行 `restart_stack_wsl.sh health` ### 12.4 WSL 执行脚本报 `bash\r` 错误 将脚本转换为 LF 行尾: ```bash dos2unix backend/infra/fisco-bcos-3/setup_wsl.sh dos2unix backend/infra/webase-3/setup_wsl.sh dos2unix backend/infra/wecross/setup_wsl.sh dos2unix backend/infra/wecross/restart_stack_wsl.sh ``` ## 13. 相关文档 - `backend/infra/RUNBOOK.md` - `backend/service/README.md` - `Cross_Verse_跨链数字内容资产交易市场_完整落地实施手册.md` ## 14. 说明 当前版本提供完整的业务流程演示能力与基础设施联通能力。后端交易数据采用本地 JSON 存储,适用于教学、演示和方案验证场景。