A simple Blockchain implemented in Python
Go to file
Daniel van Flymen d38a86b25f updates 2017-12-29 16:37:10 -05:00
tests more cleanup 2017-12-29 15:38:57 -05:00
.gitattributes C# Implementation 2017-11-18 20:45:28 +00:00
.gitignore Updating for collaborators 2017-12-28 15:52:11 -05:00
.travis.yml May finally be losing my mind 2017-11-12 16:31:50 -05:00
Dockerfile Update Dockerfile 2017-10-04 06:49:03 -05:00
LICENSE Initial commit 2017-09-24 15:36:36 -04:00
Pipfile Minor fixups while working together 2017-12-28 16:59:48 -05:00
Pipfile.lock more cleanup 2017-12-29 15:38:57 -05:00
README.md Add Travis Icon 2017-11-12 16:35:26 -05:00
blockchain.py updates 2017-12-29 16:37:10 -05:00
database.py more cleanup 2017-12-29 15:38:57 -05:00
helpers.py more cleanup 2017-12-29 15:38:57 -05:00
mining.py more cleanup 2017-12-29 15:38:57 -05:00
networking.py Updating for collaborators 2017-12-28 15:52:11 -05:00
node.py more cleanup 2017-12-29 15:38:57 -05:00
tasks.py more cleanup 2017-12-29 15:38:57 -05:00

README.md

Learn Blockchains by Building One

Build Status

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

Installation

  1. Make sure Python 3.6+ is installed.
  2. Install pipenv.
$ pip install pipenv 
  1. Create a virtual environment and specify the Python version to use.
$ pipenv --python=python3.6
  1. Install requirements.
$ pipenv install 
  1. Run the server:
    • $ pipenv run python blockchain.py
    • $ pipenv run python blockchain.py -p 5001
    • $ pipenv run python blockchain.py --port 5002

Docker

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

Contributing

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