主题
fabric-x · API 参考
本仓库无运行时服务;对外只暴露 4 个 CLI 工具。
configtxgen
来源:tools/configtxgen/main.go、Makefile:21。委托 fabric-x-common/tools/configtxgen。
用途:生成通道创世块(E2E 流程第 4 步,integration/test/README.md:105-117)。
主要 flag(tools/configtxgen/main.go:34-46):-outputBlock、-channelID、-profile、-configPath、-inspectBlock、-asOrg、-printOrg、-version。
configtxlator
来源:tools/configtxlator/main.go。
子命令(main.go:47-69):
| 子命令 | 用途 |
|---|---|
start | 启动 REST 服务(--hostname 默认 0.0.0.0、--port 默认 7059、--CORS) |
proto_encode | JSON → protobuf(--type、--input、--output) |
proto_decode | protobuf → JSON(同上 flag) |
compute_update | 由两份 common.Config 计算 config update(--original、--updated、--channel_id、--output) |
version | 版本信息 |
cryptogen
来源:tools/cryptogen/main.go、Makefile:21。委托 fabric-x-common/tools/cryptogen。
用途:生成加密材料(证书、密钥),E2E 第 1 步(integration/test/README.md:105-117)。
子命令(main.go:31-39):generate(--output 默认 crypto-config、--config)、showtemplate、extend(--input、--config)、version。
fxconfig
来源:tools/fxconfig/、tools/fxconfig/docs/README.md、scripts/help_docs.sh:95-106。
用途:管理 Fabric-X 命名空间。子结构见 04-modules · fxconfig。
命令:info、namespace create|list|update、tx endorse|merge|submit、version。namespace create/update 常用 flag(tools/fxconfig/docs/README.md):--policy、--version、--output、--endorse、--submit、--wait。
Makefile target
sh
make help # 列出命令
make tools # 构建 4 个 CLI
make generate # go generate ./...
make test # gotestsum 单元测试
make lint # golangci-lint + 许可证检查
make clean # 删 bin/无 REST / gRPC API
本仓库无任何服务进程。运行时 API 在:
- 排序服务 → fabric-x-orderer
- 提交服务 → fabric-x-committer
- 客户端 → fabric-x-sdk