bayneri / basic-blockchain

Basic blockchain implementation to learn logic behind blockchains

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

basic blockchain

This is a basic blockchain implementation written in python. API structure is created with Python Flask Framework.

This project is based on a tutorial.

Installation

  1. Make sure Python 3.6+ is installed.
  2. Install pipenv.
$ pip install pipenv 
  1. Create a virtual environment and specify the Python version to use.
$ pipenv --python=python3.6
  1. Install requirements.
$ pipenv install 
  1. Run the server:
$ pipenv run python blockchain.py

Endpoints

  1. /mine to tell our server to mine a new block. [GET]
  2. /transactions/new to create a new transaction to a block [POST]
  3. /chain to return the full Blockchain. [GET]
  4. /nodes/register to accept a list of new nodes in the form of URLs. [POST]
  5. /nodes/resolve to implement our Consensus Algorithm, which resolves any conflicts—to ensure a node has the correct chain. [GET]

About

Basic blockchain implementation to learn logic behind blockchains


Languages

Language:Python 100.0%