首页|面向实践教学的区块链仿真实验平台构建

面向实践教学的区块链仿真实验平台构建

扫码查看
区块链应用通常都是基于大型网络的分布式系统,在实际的区块链上进行教学与实验是困难的。该文针对此问题,遵循通用、简约、可扩展的设计原则,构建了区块链仿真实验平台BCES。基于BCES平台,介绍了区块链课程的实践教学,以RBFT共识算法实验为例,详述了算法的设计和BCES平台在实验课程中的应用。教学效果表明,依托BCES平台开展实验,有助于学生理解区块链的底层原理,掌握区块链的理论知识,培养区块链的工程应用能力。
Construction of blockchain simulation experimental platform for practical teaching
[Objective]Blockchain technology,which originally stemmed from Bitcoin,has evolved significantly over more than a decade.It has now established its unique technological value,independent from Bitcoin.As the application of blockchain is rooted in distributed systems across large networks,practical experimentation is essential for teaching and researching this technology.However,conducting experiments on an in-use blockchain network is not feasible.Moreover,constructing a commercial dedicated network entails substantial software and hardware costs and requires implementing complex underlying technology,which complicates teaching efforts.To analyze the technical principles of blockchain systems and elucidate the impact of various components on blockchain operations,we have designed and implemented a blockchain experimental simulation platform named Blockchain Experimental Simulator(BCES).[Methods]1)The experimental platform BCES aims to simulate the system behavior of a blockchain,adhering to the principles of universality,simplicity,and extensibility.It ensures universality through a hierarchical architecture that decouples complex module dependencies.Simplicity is achieved by providing parameter configuration methods for core elements.Extensibility is facilitated using abstract classes and interface programming in the Java object-oriented language.BCES is designed as a four-layer architecture model consisting of data,network,configuration,and service layers.The data layer contains the most basic data storage structure in a blockchain:block and node.The network layer defines routing tables and consensus algorithms.The configuration layer provides parameter configuration methods for the block,node,and network.The service layer serves as the core engine of the simulator.2)We employed BCES as the teaching environment for practical instruction in blockchain courses.A 16-hour experimental lesson was arranged for the"Principles and Practice of Blockchain"course.The experimental content includes block structure,chain structure,node working principle,asymmetric encryption algorithm,peer-to-peer network,PoW consensus algorithm,Rotating Byzantine Fault Tolerant(RBFT)consensus algorithm,and smart contract development.3)Using the RBFT consensus algorithm experiment as an example,the design of the algorithm and the use of the BCES platform in the experiment class are described in detail.The traditional Practical Byzantine Fault Tolerance(PBFT)algorithm has good efficiency and fault tolerance.However,as the number of nodes in the blockchain network increases,its performance decreases rapidly.Given that the consortium chains adopt a permissioned membership mechanism for participating nodes,we propose an RBFT algorithm based on PBFT.This algorithm is suitable for weakly centralized alliance blockchain systems and can potentially enhance network efficiency.[Results]1)A comparative experiment between BCES and Gervais's simulator was conducted,with an evaluation experiment confirming that BCES can accurately simulate blockchain operations.2)We conducted delay and throughput experiments on the RBFT consensus algorithm.The delay experiment revealed that both the PBFT and RBFT algorithms experienced a gradual increase in delay with an increase in the number of nodes.However,owing to the small number of participating nodes in the RBFT consensus process,the RBFT algorithm exhibited lower delay.3)The throughput experiment demonstrated that the throughput for both the PBFT and RBFT algorithms gradually decreased with increasing the number of nodes.Nevertheless,the RBFT algorithm consistently outperformed the PBFT algorithm in terms of throughput.The result indicates that the RBFT algorithm provides better availability for blockchain networks and has considerable advantages over the PBFT consensus algorithm in improving the performance of the consortium chain.[Conclusions]BCES is the first simulation experiment platform based on the Java language in China,supporting the simulation of public or consortium blockchain for undergraduate teaching.BCES simplifies the complexities of blockchain teaching by emphasizing principles and implementation,enabling students to quickly grasp a comprehensive understanding of the technology.Through a series of progressive experiments,BCES aids students in understanding the application of data structures,computer networks,cryptography,and other technologies within blockchain.Furthermore,it promotes students'mastery of theoretical blockchain knowledge and improves their ability to design,develop,and implement blockchain projects.

blockchainblockchain simulator experimental platformpractical teachingconsensus algorithm experiment

任凯、朱惠娟、应毅

展开 >

南京理工大学 紫金学院,江苏南京 210023

三江学院计算机科学与工程学院,江苏 南京 210012

区块链 区块链仿真实验平台 实践教学 共识算法实验

江苏省教育科学规划重点课题国家社会科学基金一般项目江苏省青蓝工程项目南京理工大学紫金学院校级精品课程建设项目

B/2023/01/10717BTQ059苏教师函[2021]11号03145011

2024

实验技术与管理
清华大学

实验技术与管理

CSTPCD北大核心
影响因子:1.651
ISSN:1002-4956
年,卷(期):2024.41(2)
  • 16