Blockchain cryptocurrency application created for Cryptography classes. This application offers both GUI and API interfaces for interaction with the blockchain.
YoinkCoin allows users to create new transactions and save them in mined blocks in a blockchain architecture.
- Python 3.10
- Flask 3.0.3,
- requests 2.31.0,
- JavaScript,
- Bootstrap5 5.3.3
- gunicorn 22.0.0,
- Docker
Create Python virtual environment, for example:
virtualenv venv
Activate virtual environment:
source venv/bin/activate
Run this command to install required dependencies
pip install -r requirements.txt
To start application run in development mode:
flask --app app run --debug
Instead, to start gunicorn production server use:
gunicorn -b 0.0.0.0:5000 app:app
Block mining
Transaction creation
Nodes registration
Sync blockchain
Subpage overview
METHOD | ENDPOINT | ACTION | Parameters |
---|---|---|---|
/api |
GET |
Returns list of avaible endpoints. | N/A |
/api/transactions |
GET |
Returns list of currently pending transactions. | N/A |
/api/nodes |
GET |
Returns list of registered endpoints. | N/A |
/api/nodes/resolve |
GET |
Syncs this nodes blockchain with registered nodes. | N/A |
/api/chain |
GET |
Returns full blockchain. | N/A |
/api/wallet |
GET |
Returns wallet state of this node. | N/A |
/api/mine |
GET |
Mines new block. | N/A |
/api/transactions/new |
POST |
Adds new pending transaction to the blockchain. | sender , recipient , amount |
/api/nodes/register |
POST |
Registers new node address. | nodes |
/api/testing/grant |
POST |
TESTING Grants 100 YoinkCoins to this node. | N/A |
YoinkCoin is available in a form of Docker image at Dockerhub repository.
To use it, install Docker on your system and run following commands:
docker pull kamsaf42/yoinkcoin:latest
docker run --name yoinkcon -p 5000:5000 kamsaf42/yoinkcoin:latest
YoinkCoin image when started runs with gunicorn production server on port 5000.
Created by Kamil Safaryjski 2024