Naive block chain implementation in Python.
To create initial database in file chain.db
with genesis block call:
python main.py init --file chain.db
To call operations on chain start local http server. To start server on address
http://localhost:8888
call:
python main.py run --port 8888
To create new block:
curl --data 'data=Test' http://localhost:8888/blocks
Name | Method | Parameters | Description |
---|---|---|---|
/blocks |
GET |
List blocks in chain | |
/blocks |
POST |
data -- data to use in blockchain | Mine new block with test data |
- python => 3.6