Skip to content

macwis/blockchain_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blockchain_demo

Basic BlockChain Demo App in Python (Flask)

This is a very simple proof of concept project which allows to run multiple blockchain Nodes and Clients. The Nodes can accept transactions, add to the blocks and chain the blocks. There is a basic functionality to resolve conflicts, mine and validate the chain. All features are accessible via a simple web interface.

Manual

Make sure you have virtualenv or pipenv. All required dependencies are in requirements.txt.

To load dependencies:

pip install -r requirements.txt

Easiest way to run the whole thing is to do it locally:

  1. To run couple of nodes - you can multiply them by e.g. setting various port numbers. E.g. python blockchain/blockchain.py -p 5001, python blockchain/blockchain.py -p 5002, etc.

  2. To run couple of clients - same trick: e.g. python blockchain_client/blockchain_client.py -p 8081, python blockchain_client/blockchain_client.py -p 8082, etc.

As a client:

E.g. http://127.0.0.1:8081/

Using UI you can:

  1. Generate Wallet (public/private key pair)
  2. Submit new transaction
  3. View the list of transactions in the blockchain

On the node:

E.g. http://127.0.0.1:5001/

Using IU you can:

  1. Mine new block
  2. Configure other nodes
  3. Resolve conflicts with known nodes and keep the blockchain up to date

Screenshots

Pic. 1 - Generate Wallet:

Pic. 2 - Make transaction:

Pic. 3 - Successful transaction submission:

Alt text

Pic. 4 - List of transactions and the blockchain (before mining):

Alt text

Pic. 5 - List of transactions and the blockchain on the first node (after mining):

Alt text

Pic. 6 - Configuration of the blockchain nodes:

Alt text

Pic. 7 - Blockchain on the second node after conflict resolution:

Alt text

About

Basic BlockChain Demo App in Python (Flask)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published