pip install pipenv
cd ~/your_workspace
mkdir blockchain_principle
cd blockchain_principle
pipenv shell
pipenv install flask==1.0
pipenv install requests==2.18.4
创建blockchain.py文件,编写区块结构
"""
{
"index": 0, 索引
"timestamp": "", 时间戳
"transactions": [
{
"sender": "",
"recipient": "",
"amount": 5
}
],
"proof": "", # 工作量证明
"previous_hash": "" # 上一个区块的hash
}
"""