Build a blockchain network

1. Practical training development plan

Building a blockchain system includes account functions, ledger functions, peer-to-peer (P2p) communication functions, and consensus algorithm functions.

  • The development includes specific models, including the transaction model in the blockchain (Translation), the block model in the blockchain (Block), the network model in the blockchain (Network), and the ledger model in the blockchain ( Blockchaim), the information model (message) of data communication, and the node model (peer) in the blockchain.
  • Predefined functions include specific encryption algorithm functions and entities. Encryption algorithm functions include account creation, data signature and verification, hash encryption functions, Merkel root calculation and other functions. Creation entities include nodes in the blockchain, networks and blockchain ledgers.
  • Develop functions including accounts, ledgers, P2p communications, and consensus algorithms.
  • Develop the entry module, including node communication, consensus algorithm and other timers, and HTTP interface.

2. Specific implementation steps:

Create the complete_blockchaim project and install the relevant dependent libraries. The specific operations are as follows:

pip install flask flask_scoketio flask_apscheduler
pip install ecdsa base58
pip install networkx
pip install matplotlib
pip install "python-socketio[client]"
 1. Develop system-related models

Create the models.py file module and add object models including transactions, blocks, networks, etc.

(1). First add the dependency packages that need to be referenced by the object model

Guess you like

Origin blog.csdn.net/2201_76041915/article/details/134840925