Coder Social home page Coder Social logo

blockchain's Introduction

用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. clone repo
  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

貢獻

深入浅出区块链 想做好的區塊鏈學習博客。 博客地址 歡迎大家一起參預貢獻,一起推動區塊鏈技術發展。

blockchain's People

Contributors

rtshaw avatar dvf avatar hannah98 avatar xilibi2003 avatar fcu-d0449199 avatar marius92mc avatar massa142 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.