Skip to content

luoxiaojun1992/blockchain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

用Python从零开始创建区块链

本文是博客:用Python从零开始创建区块链 的源码. 翻译自Building a Blockchain

博客地址| 英文README

安装

  1. 安装 Python 3.6+ is installed.
  2. 安装 pipenv.
$ pip install pipenv 
  1. 创建virtual env.
$ pipenv --python=python3.6
  1. 安装依赖.
$ pipenv install 
  1. 运行节点:
    • $ pipenv run python blockchain.py
    • $ pipenv run python blockchain.py -p 5001
    • $ pipenv run python blockchain.py --port 5002

Docker运行

另一种方式是使用Docker运行:

  1. 克隆库
  2. 构建docker容器
$ docker build -t blockchain .
  1. 运行
$ docker run --rm -p 80:5000 blockchain
  1. 添加多个节点:
$ docker run --rm -p 81:5000 blockchain
$ docker run --rm -p 82:5000 blockchain
$ docker run --rm -p 83:5000 blockchain

贡献

深入浅出区块链 想做好的区块链学习博客。 博客地址 欢迎大家一起参与贡献,一起推动区块链技术发展。

About

A simple Blockchain in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%