A simple Blockchain implemented in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Pavle Portic f75764b5a5
Refactor to fastapi
2 years ago
blockchain Refactor to fastapi 2 years ago
tests Preliminary Tests 5 years ago
.dockerignore Refactor to fastapi 2 years ago
.gitignore Added js blockchain class 3 years ago
Dockerfile Refactor to fastapi 2 years ago
LICENSE Initial commit 5 years ago
README.md Update readme 3 years ago
docker-compose.yml Refactor to fastapi 2 years ago
init Refactor to fastapi 2 years ago
poetry.lock Refactor to fastapi 2 years ago
pyproject.toml Refactor to fastapi 2 years ago
requirements.txt Refactor to fastapi 2 years ago
run.py Refactor and new features 3 years ago

README.md

Blockchain 101

Simple blockchain written in python

Installation

  1. Make sure Python 3.6+ is installed.
  2. Install poetry.
  3. Install requirements
$ poetry install
  1. Copy .env.example to .env

  2. Start some nodes:

    • $ poetry run flask run -p 5000
    • $ poetry run flask run -p 5001

Docker

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

  1. Build the docker image
$ docker-compose build
  1. Run the nodes
$ docker-compose up -d
  1. To add more nodes, add a new service to the docker-compose.yml file and adjust the port number.
node2:
	build: .
	ports:
		- 5002:80

Credits

dvf for the original blockchain code