The project is used to display bit coin transaction retrieved from https://www.blockchain.com/api/api_websocket. There are three API calls made
- /show_transactions/ - Displays latest 100 transactions. The data will only change in every 1 minute .
- /transactions_count_per_minute/{min_value}/ - Displays number of transactions per minute for the last hour. The data will change every 1 minute
- /high_value_addr/ - Displays the bitcoin addresses which have the most aggregate value in transactions in the last 3 hours.
To run this application,
- Install kafka & zookeeper - Follow this guide https://tecadmin.net/install-apache-kafka-ubuntu/
- Install redis-server - sudo apt install redis-server
- Go into the environment (venv in the git root directory) by executing "source venv/bin/activate" and perform "pip install -r requirements.txt" .
- Open django shell "python manage.py shell" and execute the following commands
- from myapp import producer
- producer.connect()
- Open another django shell "python manage.py shell" and execute the following commands
- from myapp import consumer
- consumer.connect()
- Open another django shell "python manage.py shell" and execute the following commands
- from myapp import websocket_app
- websocket_app.connect()
- In new terminal, Go to bitcoins/bitcoins (where celery.py is present) and run the command "celery -A bitcoins worker -l info"
- In new terminal, go to bitcoins/ (where manage.py is present) and run "python manage.py runserver " (Use port only if 8000 is already registered with any other server)