This is a basic blockchain implementation written in python. API structure is created with Python Flask Framework.
This project is based on a tutorial.
- Make sure Python 3.6+ is installed.
- Install pipenv.
$ pip install pipenv
- Create a virtual environment and specify the Python version to use.
$ pipenv --python=python3.6
- Install requirements.
$ pipenv install
- Run the server:
$ pipenv run python blockchain.py
/mine
to tell our server to mine a new block. [GET]/transactions/new
to create a new transaction to a block [POST]/chain
to return the full Blockchain. [GET]/nodes/register
to accept a list of new nodes in the form of URLs. [POST]/nodes/resolve
to implement our Consensus Algorithm, which resolves any conflicts—to ensure a node has the correct chain. [GET]