Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lzpump/blockchain-in-python

 
 

Repository files navigation

Blockchain in Python

This work is based on adilmoujahid/blockchain-python-tutorial.

Novel Features

Compared with the original one, we now introduce:

  • PKC (coin name).
  • Constant wealth (1e8 coin in total).
  • Setting miner's information.
  • Balance check before every transaction.
  • Transaction failure alert.
  • Dynamic difficulty update every 2 weeks.
  • SSL support.
  • Save running states.

(Risky, not recommended) If you need SSL support, add certificate(inside certificates folder) to your system(cert.pem) or your browser(cert.p12).

Requirements

In order to run this code, you'll need:

  • Python 3
  • pycrypto
  • Flask

To install the pycrypto and Flask, run:

pip instal pycrypto
pip install -U Flask

Usage

To run blockchain node:

python blockchain/blockchain.py -p 5000

which we also support restoring to previous state with -r path\to\file.pkl. The default file of state is stored in states\blockchain.pkl.

To run blockchain client:

python blockchain_client/blockchain_client.py -p 8080

About

More features than the original one.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 64.0%
  • Python 35.9%
  • CSS 0.1%