Journal of Computer Applications ›› 2021, Vol. 41 ›› Issue (4): 956-962.DOI: 10.11772/j.issn.1001-9081.2020111977

Special Issue: 2020 CCF中国区块链技术大会(CCF CBCC 2020)

• 2020 CCF China Blockchain Conference (CCF CBCC 2020) • Previous Articles     Next Articles

Kubernetes-based Fabric chaincode management and high availability technology

LIU Hongyu, LIANG Xiubo, WU Junhan   

  1. School of Software Technology, Zhejiang University, Ningbo Zhejiang 315048, China
  • Received:2020-12-16 Revised:2021-01-14 Online:2021-04-10 Published:2021-04-16
  • Supported by:
    This work is partially supported by the General Research Project of the Department of Education of Zhejiang Province (Y202044224), the Zhejiang Graduate Education Association Project (2020-002), the Zhejiang Cultural Relic Protection Science and Technology Project (2019009).

基于Kubernetes的Fabric链码管理及高可用技术

刘宏宇, 梁秀波, 吴俊涵   

  1. 浙江大学 软件学院, 浙江 宁波 315048
  • 通讯作者: 梁秀波
  • 作者简介:刘宏宇(1994—),男,河北邯郸人,硕士,主要研究方向:容器云、区块链;梁秀波(1983—),男,山东莱阳人,副研究员,博士,CCF会员,主要研究方向:区块链、人工智能、自然人机交互、移动互联网;吴俊涵(1998—),男,浙江丽水人,硕士研究生,CCF会员,主要研究方向:区块链。
  • 基金资助:
    浙江省教育厅一般科研项目(Y202044224);浙江省研究生教育学会项目(2020-002);浙江省文物保护科技项目(2019009)。

Abstract: The core of the Blockchain as a Service(BaaS) platform is how to deploy the blockchain network on the cloud computing platform. Fabric deployment can be divided into static components and dynamic chaincodes according to the component startup time, and chaincode deployment is the core and the most complex part of Fabric cloudification. Because the Fabric has no interfaces for Kubernetes,the current solutions in the industry implement chaincode deployment through a series of auxiliary technologies, but these solutions do not incorporate the chaincodes into the Kubernetes management environment along with static components. In response to the existing problems of BaaS scheme, the following works were mainly done:1) a comprehensive study of the underlying infrastructure, especially of the Kubernetes platform with high availability in the production environment; 2) the cloud deployment of Kubernetes on Fabric was designed and implemented, especially in the chaincode part, a brand-new container control plug-in was used to realize the support for Kubernetes at the code level and complete the goal of incorporating chaincodes into Kubernetes environment management; 3) the functional computing service was used to manage the Fabric chaincodes to realize a brand-new chaincode execution mode, which means changing from the "start-wait-call-wait" mode to the "start-call-exit" mode. The above works in Fabric cloud deployment, especially in chaincode deployment management, have certain reference value for the optimization of the BaaS platform based on Fabric and Kubernetes.

Key words: blockchain, Blockchain as a Service (BaaS), Hyperledger Fabric, Kubernetes, chaincode, serverless function computing

摘要: 区块链即服务(BaaS)平台的核心在于如何将区块链网络部署在云计算平台上。Fabric部署可以按照组件启动时间分为静态组件和动态链码两部分,而链码部署是Fabric云化最核心、最复杂的部分。因为Fabric本身没有针对Kubernetes开发接口,所以业界当前的方案均是通过一系列辅助技术实现链码部署,而这些方案并没有将链码随静态组件一起纳入到Kubernetes管理环境中。针对当前BaaS方案存在的问题,主要做了如下几项工作:1)比较全面地研究了底层基础设施,尤其是生产环境下的高可用性Kubernetes平台;2)设计并实现了Fabric在Kubernetes上的云化部署,尤其是链码部分通过一个全新的容器控制插件实现了对Kubernetes在代码级别上的支持,并完成了将链码纳入Kubernetes环境管理的目标;3)用函数计算服务来管理Fabric链码的部署,从而实现了一个全新的链码执行模式,即从“启动-等待-调用-等待”的模式改变为“启动-调用-退出”的模式。上述在Fabric云化部署尤其是链码部署管理方面的工作,对基于Fabric和Kubernetes的BaaS平台优化有一定的参考价值。

关键词: 区块链, 区块链即服务, Hyperledger Fabric, Kubernetes, 链码, 无服务器函数计算

CLC Number: