主题
fabric-x-orderer · API 参考
CLI
arma
来源:cmd/arma/main.go:9-18、node/server/arma.go:224-233。
arma <router|assembler|batcher|consensus> [flags]4 个子命令分别启动 4 个角色(来源 node/server/arma.go:52,help map line 32-35)。
具体 flag 详见 docs/cli/arma.md [未核]。
armageddon
来源:cmd/armageddon/main.go:9-18、common/tools/armageddon/armageddon.go。
配置生成工具。默认配置:4 Party(ID 1-4),每 Party 含 1 router / 1 assembler / 1 consenter / 2 batchers,端点 127.0.0.1:7050-7069(armageddon.go:46-75)。
具体子命令详见 docs/cli/armageddon.md [未核]。
gRPC
客户端 API(Fabric AtomicBroadcast)
来源:README.md:38-58。
客户端 gRPC 服务与 Fabric 的 "Atomic Broadcast API" 相同,含两个 RPC:
| RPC | 实现方 | 用途 |
|---|---|---|
Broadcast(stream Envelope) | Router | 提交交易供排序 |
Deliver(stream Envelope) | Assembler | 消费已排序的块 |
提交交易时,客户端连接 router 端点并尽量向所有 party 的所有 router 提交(README.md:59-61)。
内部 gRPC(node/protos/comm/communication.proto)
| service | RPC |
|---|---|
RequestTransmit | Submit、SubmitStream(stream) |
Consensus | NotifyEvent(stream)、SubmitConfig |
BatcherControlService | NotifyAck(stream)、FwdRequestStream(stream) |
更多说明见 docs/api.md。
Makefile target
来源:Makefile。
| target | 行号 | 用途 |
|---|---|---|
basic-checks | 28 | 全部基础检查 |
linter | 30-33 | golangci-lint + help 文档检查 |
check-help-docs | 35-38 | CLI 帮助文档最新检查 |
check-deps | 40-43 | 依赖检查 |
binary | 45-49 | 编译 arma + armageddon 到 bin/ |
clean-binary | 51-53 | 清 bin/ |
protos | 55-58 | 编译非 API protobuf |
linter-extra | 60-64 | 增量 lint |
check-license | 66-69 | Apache 头检查 |
check-dco | 71-74 | DCO Signed-off-by 检查 |
check-protos | 76-79 | proto 检查 |
check-imports | 81-84 | import 检查 |
unit-tests | 87 | 全部单元测试 |
unit-tests-consensus | 89-91 | -race -timeout 20m |
unit-tests-batcher | 93-95 | -race -timeout 15m |
unit-tests-other | 97-99 | 其余 |
integration-tests | 101-102 | 全部集成测试 |
integration-basic | 104-106 | test/basic/ |
integration-faulttolerance | 108-110 | test/faulttolerance/ |
integration-reconfig | 112-113 | 重配置测试 |
sample-tests | 135-139 | 样本测试 |
build-image | 142-145 | 单平台 Docker |
build-multiplatform-image | 148-151 | 多平台 Docker |
端口(默认 armageddon 配置)
来源:common/tools/armageddon/armageddon.go:46-75。
每 Party 占 5 个连续端口(assembler、consenter、router、batcher×2),从 127.0.0.1:7050 起依次顺延:Party 1 用 :7050-7054、Party 2 用 :7055-7059、Party 3 用 :7060-7064、Party 4 用 :7065-7069。