Welcome to the Shipathon! 🎉 This project is a simplified proof-of-work blockchain built in Python. Your task is to complete the missing components and get the blockchain up and running!
.
├── requirements.txt # Dependencies for the project
├── models.py # Data models for the blockchain
├── full_node.py # Full node implementation
├── blockchain/
│ ├── api.py # FastAPI methods (already implemented)
│ ├── blockchain.py # Core blockchain logic
│ ├── blocks.py # Block structure (to be completed)
│ ├── verifiers.py # Block validation logic
│ ├── db.py # Database layer (to be completed)
│ ├── wallet.py # Wallet implementation (to be completed)
You can use a virtual environment or an Anaconda environment for better dependency management.
Ensure you have Python 3.8+ installed. Then, install required packages:
pip install -r requirements.txt
Create and activate a new Anaconda environment:
conda create --name blockchain-env python=3.8
conda activate blockchain-env
pip install -r requirements.txt
Ensure you have Python 3.8+ installed. Then, install required packages:
pip install -r requirements.txt
Complete the following files in order:
wallet.py
- Implement wallet creation and digital signatures.db.py
- Implement persistent storage for the blockchain.blocks.py
- Define the structure of a block.blockchain.py
- Implement the blockchain class with proof-of-work logic.blockchain/api.py
- Connect blockchain logic with API endpoints.full_node.py
- Set up a full node to run the blockchain network.verifiers.py
- Implement block validation logic.
Open 3 terminals. In the first terminal, run:
python3 full_node.py --port=8000 -mine=1
After you see that the server is up and the sync process has finished, run the following commands in two additional terminals:
python3 full_node.py --port=8001 --node=127.0.0.1:8000 --mine=1
python3 full_node.py --port=8002 --node=127.0.0.1:8000 --mine=1
Access the interactive API documentation at http://127.0.0.1:8000/docs
.
By the end of this Shipathon, you'll have a working blockchain with: ✅ Blocks mined using Proof-of-Work (PoW) ✅ Secure digital wallets with public-private key encryption ✅ A REST API to interact with the blockchain
Good luck, and happy coding! 🚀