https://github.com/boatx/lamechain
Simple blockchain implementation
https://github.com/boatx/lamechain
aiohttp aiohttp-server asyncio blockchain python python-3 python-3-6
Last synced: 11 months ago
JSON representation
Simple blockchain implementation
- Host: GitHub
- URL: https://github.com/boatx/lamechain
- Owner: boatx
- License: lgpl-3.0
- Created: 2017-10-30T22:14:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-22T20:19:05.000Z (about 1 year ago)
- Last Synced: 2025-02-02T13:34:20.280Z (about 1 year ago)
- Topics: aiohttp, aiohttp-server, asyncio, blockchain, python, python-3, python-3-6
- Language: Python
- Size: 187 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lamechain
Naive block chain implementation in Python.
## Inspired by
* [naivechain](https://github.com/lhartikk/naivechain)
* [Big-Ish Data blog post](https://bigishdata.com/2017/10/17/write-your-own-blockchain-part-1-creating-storing-syncing-displaying-mining-and-proving-work/)
## Usage
To create initial database in file `chain.db` with [genesis block](https://en.bitcoin.it/wiki/Genesis_block) call:
```bash
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:
```bash
python main.py run --port 8888
```
To create new block:
```bash
curl --data 'data=Test' http://localhost:8888/blocks
```
## Endpoints
| Name | Method | Parameters | Description |
|-----------|--------|-----------------------------------|-------------------------------|
| `/blocks` | `GET` | | List blocks in chain |
| `/blocks` | `POST` | data -- data to use in blockchain | Mine new block with test data |
## Requirements
* python => 3.6