2.1 Python实现区块链环境准备

作者: 9c0ddf06559c | 来源:发表于2018-08-25 17:15 被阅读39次

2.1 Python实现区块链环境准备

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
}
"""

相关文章

网友评论

    本文标题:2.1 Python实现区块链环境准备

    本文链接:https://www.haomeiwen.com/subject/fgugiftx.html