Skip to content
Building a Blockchain with Python from Zero to Hero.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
db_postgresql
db_sqlite
nginx
.gitignore
Dockerfile
Kubernetes.yaml
LICENSE
Pipfile
README.md
blockchain.py
coverage.sh
docker-compose.yml
requirements.txt
sql_block.py
sqlite_backend.py
view_controller.py

README.md

Python Blockchain

Commands

To create a new transaction to a block POST

/transactions/new 

To tell our server to mine a new block GET

/mine

To return the full Blockchain GET

/chain

Nodes

To accept a list of new nodes in the form of URLs

/nodes/register

Example for body POST:

{
	"nodes": "192.168.15.69:5001"
}

To implement our Consensus Algorithm, which resolves any conflicts—to ensure a node has the correct chain. GET:

/nodes/resolve

Requests

This is what the request for a transaction will look like. It’s what the user sends to the server:

{
 "sender": "my address",
 "recipient": "someone else's address",
 "amount": 5
}

Database

Necessary setup a postgres database, with db.ini with credentials:

[postgresql]
host=localhost
database=db_name
user=example_user
password=example_pass

Docker

Build personalized images from Dockerfile

docker build -t "blockchain:v3" .
docker build -t "block_nginx" nginx/Dockerfile
You can’t perform that action at this time.