Skip to content

A simple blockchain implementation in Python with Flask and Hug

License

Notifications You must be signed in to change notification settings

Archento/Blockchain-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Blockchain Example

inspired by: https://github.com/satwikkansal/python_blockchain_app/

Implementation of a minimalistic blockchain P2P network and display/search via the provided blockchain explorer


Übersicht

Requirements

pip install hug Flask requests

  oder

pip install -r requirements.txt
  • hug - microframework for simplified API development
  • Flask - web development framework
  • requests - HTTP library for python

File Structure

Project/
|---Explorer/
|   |---static/img/
|   |   |---dice.svg
|   |---templates/
|   |   |---*.html
|   |---app.py
|---Node/
|   |---src/
|   |   |---blockchain.py
|   |   |---util.py
|   |---node.py
|---architecture.drawio.png
|---readme.md
|---requirements.txt

How To

Explorer

Navigate in a terminal to /Explorer and type python app.py to start the Flask server on localhost:5000.

Nodes

Navigate to /Node and type python node.py 8000 to start a node on localhost:8000. The port number can be changed but the initial Node has to be on 8000!

Why

The nodes represent and endpoint/app for mining and utilising the blockchain. The explorer is simply there to have a look at what is currently on the blockchain.

not found I guess