Crane-Mocker / Py-Block-Chain

A python block chain demo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Py-Block-Chain

A python block chain demo.

Use

python3 blockchain.py

GET Mine: curl http://127.0.0.1:5000/mine

GET full chain: curl http://127.0.0.1:5000/chain

POST new transaction:

curl -X POST -H "Content-Type: application/json" -d '{
    "sender": "<sender>",
    "recipient": "<recipient>",
    "amount": <amount>
}' "<node_url>/transactions/new"

POST resigster node:

curl -X POST -H "Content-Type: application/json" -d '{
    "nodes": ["<node_url>"]
}' "<node_url>/nodes/register"

GET nodes resolve: curl http://127.0.0.1:5000/nodes/resolve

Ref

A blockchain in 200 lines of code

About

A python block chain demo.

License:MIT License


Languages

Language:Python 100.0%