A Go-based market data fetcher agent with caching and an Nginx proxy for efficient data delivery.
This project consists of two main components:
- Market Fetcher: A Go service that fetches and caches market data from CoinGecko and price updates from Binance.
- Nginx Proxy: A reverse proxy that provides caching, ETag optimization, and compression for efficient delivery of market data.
- Docker and Docker Compose
- Create a
config.yaml
file in themarket-fetcher
directory:
coingecko_fetcher:
update_interval: 10800 # seconds (3 hours)
tokens_file: "coingecko_api_tokens.json"
limit: 500 # number of tokens to fetch
- (Optional) Create
coingecko_api_tokens.json
in thesecrets
directory for Pro API access:
{
"api_tokens": ["your-api-key-here"]
}
If you don't provide this file, the service will use the public API without authentication.
Run the following command to start all services:
./start-local.sh
This will:
- Create necessary configuration files if they don't exist
- Build and start the following services:
- market-fetcher: Fetches market data (port 8081)
- market-proxy: Nginx proxy with caching (port 8080)
- market-frontend: Test frontend application (port 3000)
- Set up a Docker network for communication between services
- API Proxy: http://localhost:8080
- Frontend: http://localhost:3000
Go application that caches token lists from CoinGecko and price updates from Binance, providing a REST API for accessing token and price data.
A proxy that performs caching, ETag optimization, and compression for displaying market data from market-fetcher.