Blockchain, like any other complex technology, needs a strong testing methodology to support its evolution in both research and development contexts. Setting up meaningful tests for permissionless blockchain technology is a notoriously complex task for several reasons: software is complex, large number of nodes are involved, network is non ideal, etc. Developers usually adopt small virtual laboratories or costly real devnets, based on real software. Researchers usually prefer simulations of a large number of nodes, based on simplified models. In this paper, we aim to obtain the advantages of both approaches, i.e., performing large, realistic, inexpensive, and flexible experiments, using real blockchain software within a virtual environment. To do that, we tackle the challenge of running large blockchain networks in a single physical machine, leveraging Linux and Docker. We analyze a number of problems that arise when large blockchain networks are emulated and we provide technical solutions for all of them. Finally, we describe two experiences of emulating fairly large blockchain networks on a single machine, adopting both research oriented and production oriented software, and involving up to more than 3000 containers.
翻译:区块链与其他复杂技术一样,需要强有力的测试方法来支撑其在研究与开发背景下的演进。为无许可区块链技术构建有意义的测试是一项公认的复杂任务,其原因包括:软件系统复杂、涉及大量节点、网络环境非理想等。开发者通常采用基于真实软件的小型虚拟实验室或成本高昂的实际开发网络,而研究者则更倾向于基于简化模型的大规模节点仿真。本文旨在兼顾两种方法的优势——即在虚拟环境中使用真实区块链软件,开展大规模、真实、低成本且灵活的实验。为此,我们利用Linux和Docker技术,攻克在单台物理机上运行大规模区块链网络的挑战。我们分析了仿真大规模区块链网络时出现的若干问题,并针对所有问题提供了技术解决方案。最后,我们描述了在单台机器上仿真相当大规模区块链网络的两次实践,分别采用面向研究与面向生产的软件,涉及最多超过3000个容器。