主题
fabric-x · 快速开始
本仓库本身不是 server,"跑起来" 等价于跑一遍 E2E 测试套件。
前置依赖
来源:README.md:86-91。
| 工具 | 版本 |
|---|---|
| Go | 1.26+ |
| golangci-lint | v2.11.4+ |
| Docker | 20.x+ |
| GNU Make | 任意 |
构建工具
来源:Makefile:21,39。
sh
make tools输出 4 个二进制到 bin/(BUILD_DIR ?= bin):configtxgen、configtxlator、cryptogen、fxconfig。
跑 E2E 测试
来源:integration/test/README.md、integration/test/build-e2e.sh、integration/test/run-e2e.sh、integration/test/clean.sh。
sh
cd integration/test
# 构建 orderer + committer 镜像 + 编译工具
./build-e2e.sh
# 完整 E2E(约 10,000 笔交易,断言 ≥ 5,000 提交)
./run-e2e.sh
# 清理(容器 / 卷 / 网络 / 工件)
./clean.shrun-e2e.sh 流程(integration/test/README.md:105-117):
cryptogen加密材料armageddon(跑在 orderer 镜像内)生成 Arma 共享配置 protobuf- 由模板生成 Orderer 本地配置
configtxgen创世块- 启 Arma orderer + committer 容器
- 启 Prometheus + Grafana 监控栈
- 等待健康(router 6022、batcher 6024、sidecar 4001)
fxconfig创建多组织命名空间(peer-org-0 与 peer-org-1 共同签名)loadgen推 ~10,000 笔交易- 经 VC Prometheus metrics 验证 ≥ 5,000 已提交
- 清理前提示用户(以便查看 Grafana 仪表板)
测试端口
来源:integration/test/README.md:296-341。
| 服务 | 端口 |
|---|---|
| Orderer Router(每方) | 6022 / 6122 / 6222 / 6322 |
| Committer Sidecar blocks | 4001 |
| Committer Sidecar metrics | 2114 |
| Grafana | 3000 |
| Prometheus | 9090 |
单元测试与 lint
sh
make test # cd tools && gotestsum 跑 ./...
make lint # cd tools && golangci-lint + scripts/license-lint.sh