Skip to content

fabric-x · API 参考

本仓库无运行时服务;对外只暴露 4 个 CLI 工具。

configtxgen

来源:tools/configtxgen/main.goMakefile: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_encodeJSON → protobuf(--type--input--output
proto_decodeprotobuf → JSON(同上 flag)
compute_update由两份 common.Config 计算 config update(--original--updated--channel_id--output
version版本信息

cryptogen

来源:tools/cryptogen/main.goMakefile:21。委托 fabric-x-common/tools/cryptogen

用途:生成加密材料(证书、密钥),E2E 第 1 步(integration/test/README.md:105-117)。

子命令(main.go:31-39):generate--output 默认 crypto-config--config)、showtemplateextend--input--config)、version

fxconfig

来源:tools/fxconfig/tools/fxconfig/docs/README.mdscripts/help_docs.sh:95-106

用途:管理 Fabric-X 命名空间。子结构见 04-modules · fxconfig

命令:infonamespace create|list|updatetx endorse|merge|submitversionnamespace 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 在: