This repository contains 2 clients:
basic_cli
: is put into the Docker image and it is a simple listener that connects to the Binance trade websocket stream and prints out a warning if the price exceeds the specified threshold. To run this client;- Specify the symbols and thresholds you want to listen to within the
.env
file in the directory - Either build and run the Dockerfile or use the docker-compose command.
- To build and run manually:
docker build . -t coinpanel-challenge && \ dokcker run --env-file=.env coinpanel-challenge
- To run using
docker-compose
\docker-compose up
- To build and run manually:
- Specify the symbols and thresholds you want to listen to within the
async_cli
: is a more advanced version of thebasic_cli
that demonstrates howasyncio
can be used to create a more efficient and real-time updatable client that listens to the websocket. This could be extended to an asynchronous Flask application to create a real-time websocket listener. To run it;pip install websockets && \ python3 async_cli.py