Simulates real time cryptocurrency tradings in a microservice ecosystem.
It contists in 3 microservices:
- publisher: Generates random trades and sends them to Nats.
- subscriber: Receives trades and stores them in ClickHouse.
- api: Exposes a REST API with the trades from ClickHouse.
- Set up Nats and ClickHouse:
$ docker-compose -f docker-compose.services.yml up -d
- Start each microservice in a different tab by manually running:
$ make run
Install tmux and then:
$ ./scripts/run-dev.sh
$ ./scripts/run-docker.sh
Indicate the service is up and running.
Responses:
- 200 OK
Retrieves real time cryptocurrency trades.
Query params:
- groupBy: second | minute | hour
- crypto: btc | eth
- currency: eur | usd
- fromDate: 1970-01-01T00:00:00Z
- toDate: 2050-01-01T00:00:00Z
- limit: 100
Responses:
- 200 OK
- 404 Not Found
Body:
- Array of trades