Hyperledger Fabric 2.0在1月29日正式发布, 这是自1.0以来的大版本, 也意味着是大变化, 既做了加法增强功能和配置, 也做了减法简化并且去掉了不少历史包袱。一些新的特性和2.0 alpha透露的大多类似,可参考“Hyperledger Fabric 2.0 Alpha新特性”, 我们粗粗看下release note。

Fabric2.0新特性

去中心化智能合约自治

  • FAB-11237: Decentralized smart contract governance

私有数据加强

  • FAB-10889: Implicit org-specific collections
  • FAB-15066: Endorsement policies for collections
  • FAB-13581: memberOnlyWrite collection configuration option
  • FAB-13527: GetPrivateDataHash chaincode API
  • FAB-12043: Option to include private data in block events

外部链码启动器

  • FAB-13584: External chaincode launcher, 除了docker容器的另一选择,自己构建打包启动链码。

CouchDB加强

  • FAB-103: State database cache for CouchDB 缓存走起

重要的变化

  • FAB-5177: The ccenv build image no longer includes the shim, 运行链码的镜像不再包括shim api依赖包了,自行go mod vendor解决依赖吧。
  • FAB-15366: Logger removed from chaincode shim, 链码日志记录认为开发者自己的职责, 考虑下分布式日志ELK这些方案。
  • FAB-16213: The go chaincode entities extension has been removed, 以前有扩展包?
  • FAB-12075: Client Identity (CID) library has moved, 移动到fabric-chaincode-go仓库下的/pkg/cid.
  • FAB-14720: Support for CAR chaincode package format removed
  • FAB-15285: Support for invoking system chaincodes from user chaincodes has been removed, 系统链码例如QSCC, 用户链码调用系统链码可能会导致死锁.
  • FAB-15390: Support for peer’s Admin service has been removed, 以前的运维API例如 GetLogSpec()和etLogSpec().
  • FAB-16303: GetHistoryForKey returns results from newest to oldest,排序变了下。
  • FAB-16722: The ‘provisional’ genesis method of generating the system channel for orderers has been removed, 取而代之的是把BootstrapMethod设置为file, 使用configtxgen命令行生成创始块文件用于系统通道。
  • FAB-16477 and FAB-17116: New configuration for orderer genesismethod and genesisfile, orderer节点配置项general.genesismethod和general.genesisfile 被general.bootstrapmethod和general.bootstrapfile所替代.
  • FAB-15343: System Chaincode Plugins have been removed
  • FAB-11096: Docker images with Alpine Linux 更轻量级更安全的操作系统,镜像更小
  • FAB-11096: Bash not available in Docker images with Alpine Linux
  • FAB-15499: Ledger data format upgrade 账本数据格式做了优化和扩展
  • FAB-16866: Chaincode built upon installation on peer
  • FAB-15837: Orderer FileLedger location moved if specified with relative path
  • FAB-14271: Policies must be specified in configtx.yaml
  • FAB-17000: Warn when certificates are about to expire
  • FAB-16987: Go version has been updated to 1.13.4.

被废弃的功能

  • FAB-15754: The ‘Solo’ consensus type is deprecated, solo暂时还是可用,只能用于测试,将来版本会整体删除
  • FAB-16408: The ‘Kafka’ consensus type is deprecated, kafka共识将来版本会被删除,暂时可用,建议使用raft共识
  • FAB-7559: Support for specifying orderer endpoints at the global level in channel configuration is deprecated
  • FAB-17428: Support for configtxgen flag –outputAnchorPeersUpdate is deprecated.

把东西做大而简是不容易的事情, fabric 1.x系列有不少历史包袱和尝试性的功能, 能不断的复盘重构是好事。fisco-bcos貌似更精简些, 开源的联盟链不多,而市场供需蛮多还是选择to c的公链,产品五花八门,都说自己怎么怎么好。发展基础设施是好事,但是跑上面的业务和场景应该更重要。