The embodiment of the invention discloses a method for realizing P2P communication in a
blockchain, a
blockchain application
system and related equipment, which are used for realizing decoupling of aP2P communication function in the
blockchain and improving P2P communication efficiency. According to the embodiment of the invention, A blockchain application program of a same blockchain node is divided into a P2P module, a node module, an intelligent contract module, a
consensus module and a storage module. The public P2P module is used for maintaining the IP interface of the blockchain node and the state information of each blockchain node in a unified manner, so that the P2P function implementation process is decoupled from the node module, the intelligent contract module, the consensusmodule and the storage module in program implementation, the implementation logic is simple, and the subsequent iterative development cost is reduced. Secondly, the P2P module is packaged into a container
mirror image by adopting an application container engine, and the container
mirror image is operated to generate at least one P2P container corresponding to the P2P module, so that the same blockchain node can operate a plurality of P2P containers at the same time, and the P2P communication efficiency is greatly improved.