Skip to content

fabric-x-orderer · 架构

4 个角色

来源:README.md:19-32node/docs/architecture.md

关键 struct

来源:源码 node/

角色关键 struct出处
Routernode/router/Routernode/router/router.go:48
Batchernode/batcher/Batchernode/batcher/batcher.go:54
Consensusnode/consensus/Consensusnode/consensus/consensus.go:90
Assemblernode/assembler/Assemblernode/assembler/assembler.go:32
CLInode/server/CLInode/server/arma.go:40

CLI 命令树

来源:node/server/arma.go:224-233

NewCLI()kingpin 构造命令,描述:"Launches an Arma node (Router | Assembler | Batcher | Consensus)"。

4 个子命令(node/server/arma.go:52,help map line 32-35):

命令用途
router运行 router 节点
assembler运行 assembler 节点
batcher运行 batcher 节点
consensus运行 consensus 节点

入口:cmd/arma/main.go:9-18arma.NewCLI()(line 16),channel 驱动执行(line 17)。

node/ 包结构

来源:node/

用途
node/router/Router 节点
node/batcher/Batcher 节点
node/consensus/Consenter 节点
node/assembler/Assembler 节点
node/server/CLI 与节点启动
node/comm/通信层
node/config/节点配置
node/crypto/密码学
node/delivery/块交付
node/ledger/分类账
node/protos/protobuf 定义(comm/communication.protostate/state.proto
node/examples/示例 / sample 测试脚本
node/utils/工具

common/ 包结构

来源:common/

用途
common/configstore/配置存储
common/deliver/原子广播 API 实现
common/deliverclient/块交付客户端
common/filerepo/文件仓库
common/ledger/分类账接口
common/monitoring/监控
common/msputils/MSP 工具
common/policy/策略
common/requestfilter/请求过滤
common/tools/armageddon/配置生成工具
common/types/共享类型(PartyIDShardIDBatchID 等)
common/utils/工具

关键依赖

来源:go.mod:5-33

依赖版本备注
github.com/alecthomas/kingpinv2.2.6+incompatibleCLI 框架
github.com/hyperledger-labs/SmartBFTv1.0.1BFT 共识
github.com/hyperledger/fabric-x-commonv0.2.4
github.com/hyperledger/fabricv3.1.1(tag)
github.com/hyperledger/fabric-protos-go-apiv2v0.3.7
github.com/syndtr/goleveldbv1.0.1-0.20220721030215LevelDB
go.uber.org/zapv1.27.1日志
google.golang.org/grpcv1.79.3gRPC

文档结构

来源:docs/

文档用途
docs/api.mdgRPC 服务定义 + API
docs/architecture.md系统架构(11 个章节,见 04-modules · docs
docs/cli/arma.mdarma CLI 文档
docs/cli/armageddon.mdarmageddon 配置工具文档
docs/monitoring/metrics.md监控与指标