by dvf

A simple Blockchain in Python

5.2K Stars 2.1K Forks Last release: Not found MIT License 69 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Learn Blockchains by Building One

Build Status

This is the source code for my post on Building a Blockchain.


  1. Make sure Python 3.6+ is installed.
  2. Install pipenv.
$ pip install pipenv 
  1. Install requirements

    $ pipenv install 
  2. Run the server:

    • $ pipenv run python
    • $ pipenv run python -p 5001
    • $ pipenv run python --port 5002


Another option for running this blockchain program is to use Docker. Follow the instructions below to create a local Docker container:

  1. Clone this repository
  2. Build the docker container
$ docker build -t blockchain .
  1. Run the container
$ docker run --rm -p 80:5000 blockchain
  1. To add more instances, vary the public port number before the colon:
$ docker run --rm -p 81:5000 blockchain
$ docker run --rm -p 82:5000 blockchain
$ docker run --rm -p 83:5000 blockchain

Installation (C# Implementation)

  1. Install a free copy of Visual Studio IDE (Community Edition):

  2. Once installed, open the solution file (BlockChain.sln) using the File > Open > Project/Solution menu options within Visual Studio.

  3. From within the "Solution Explorer", right click the BlockChain.Console project and select the "Set As Startup Project" option.

  4. Click the "Start" button, or hit F5 to run. The program executes in a console window, and is controlled via HTTP with the same commands as the Python version.


Contributions are welcome! Please feel free to submit a Pull Request.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.