/CryptoBlockChain

A direction in BlockChain

Primary LanguagePythonMIT LicenseMIT

CryptoBlockChain

A direction in BlockChain

This is the simplest implementation of blockchain. This blockchain has a Crypto-Currency use-case. This has many features and runs on an http server mechanism Some features are explained below

Commands to run on http Server

Use the following commands on Linux to run the Block Chain

$ python3 Source.py 
$ python3 Source.py -p 5000
$ python3 Source.py -p 5001

Commands to run on http server

If you are on localhost server use the following commands

$ curl -X POST -H "Content-Type: application/json" -d '{
 "sender": "d4ee26eee15148ee92c6cd394edd974e",
 "recipient": "someone-other-address",
 "amount": 5
}' "http://localhost:5000/transactions/new"
  • To register a new node to your peer - to - peer network refer following example
$ curl -X POST -H "Content-Type: application/json" -d '{
"nodes" : ["http://127.0.0.1:5001"]
}' "http://127.0.0.1:5000/nodes/register"

Dependencies

You must have the flask library and requests library installed Install them as following via pip

 pip install Flask==0.12.2 requests==2.18.4 

Under MIT License. Immense gratitude to Hackernoon and Daniel.

Leave a star and check out more amazing codes by Ankush Sharma

Leave a message at ankushors789@gmail.com