• C4_872360
    了解作者
  • 3.6KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-01 18:15
    上传日期
区块链Python 遵循@dvf有关准则,为学习目的而。 使用Flask通过REST公开服务。 安装 确保已安装 。 安装 。 $ pip install pipenv 安装要求 $ pipenv install 运行服务器: $ pipenv run python blockchain.py $ pipenv run python blockchain.py -p 5001 $ pipenv run python blockchain.py --port 5002 服务 /矿 GET端点,指示服务器挖掘新块 / transactions / new POST端点,该端点为块创建新事务 / transactions / new 返回完整链的GET端点 /节点/注册 POST端点,它接受URL形式的新节点列表。 /节点/解决 运行链的共识算法的GET端点,以解决冲突并确保
blockchain-python-master.zip
  • blockchain-python-master
  • .gitignore
    10B
  • blockchain.py
    7.7KB
  • README.md
    1KB
内容介绍
# blockchain-python Simple blockchain built for learning purposes following @dvf guidelines on [Building a Blockchain](https://medium.com/p/117428612f46). The services are exposed via REST using Flask. ## Installation 1. Make sure [Python 3.6+](https://www.python.org/downloads/) is installed. 2. Install [pipenv](https://github.com/kennethreitz/pipenv). ``` $ pip install pipenv ``` 3. Install requirements ``` $ pipenv install ``` 4. Run the server: * `$ pipenv run python blockchain.py` * `$ pipenv run python blockchain.py -p 5001` * `$ pipenv run python blockchain.py --port 5002` ## Services 1. */mine* GET endpoint that tells the server to mine a new block 2. */transactions/new* POST endpoint that creates a new transaction to a block 3. */transactions/new* GET endpoint that returns the full chain 4. */nodes/register* POST endpoint that accepts a list of new nodes in the form of URLs. 5. */nodes/resolve* GET endpoint that runs the chain's Consensus Algorithm to resolve conflicts and ensure a node has the correct chain.
评论
    相关推荐