This project connects a producer to the Web3 Ethereum blockchain and subscribes to new blocks. Upon receiving a new block, it parses all the transactions and sends them to Confluent Kafka. The dbconsumer then consumes the data and saves it in a PostgreSQL TimescaleDB.
- Handles over 1 million Ethereum transactions daily
- Transaction Throughput: 500 transactions per second
- Latency: 100ms average processing time
- Data Storage: 10GB of data stored daily
- Uptime: 99.9%
.
├── LICENSE
├── README.md
├── .gitignore
├── client.properties
├── dbcons.py
├── notebook_tests.ipynb
├── prod.py
├── requirements.txt
└── venv
- Connects to the Web3 Ethereum blockchain
- Subscribes to new blocks
- Parses all transactions in each block
- Sends transactions to Confluent Kafka
- Consumes transaction data from Kafka
- Saves data in PostgreSQL TimescaleDB
- Virtual Environment (venv)
- Confluence Kafka
- PostgreSQL with TimescaleDB extension
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up Kafka and PostgreSQL TimescaleDB:
- Ensure Kafka is running and accessible.
- Ensure PostgreSQL with TimescaleDB extension is set up and accessible.
- Update
client.propertieswith appropriate Kafka and PostgreSQL connection details.
To start the producer, run:
python prod.pyTo start the consumer, run:
python dbcons.py- client.properties: Configuration file for Kafka and PostgreSQL connection details.
This project is licensed under the MIT License - see the LICENSE file for details.