Files
proxmox/docs/archive/root-cleanup-20260220/COINGECKO_API_KEY_ADDED.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

189 lines
4.5 KiB
Markdown

# CoinGecko API Key Added ✅
**Date:** 2026-01-26
**Status:****API Key Configured**
---
## ✅ API Key Information
**Key:** `your-coingecko-api-key`
**Type:** Demo API Key (Free tier)
**Format:** `CG-...` prefix indicates CoinGecko demo API key
---
## 📋 Files Updated
### 1. Root `.env.example` ✅
**Location:** `/.env.example`
**Added:**
```bash
# ----------------------------------------------------------------------------
# Price Feed & Market Data APIs
# ----------------------------------------------------------------------------
# CoinGecko API Key (for Oracle Publisher and Token Aggregation services)
# Get free key at: https://www.coingecko.com/en/api/pricing
COINGECKO_API_KEY=your-coingecko-api-key
```
---
### 2. Token Aggregation Service `.env.example` ✅
**Location:** `smom-dbis-138/services/token-aggregation/.env.example`
**Updated:**
```bash
# External API Keys (optional)
# CoinGecko API Key - Provides higher rate limits and better reliability
# Get free key at: https://www.coingecko.com/en/api/pricing
COINGECKO_API_KEY=your-coingecko-api-key
```
**Usage:**
- Automatically used by `CoinGeckoAdapter`
- Enables Pro API endpoint: `https://pro-api.coingecko.com/api/v3`
- Provides 500+ calls/minute (vs 10-50 without key)
---
## 🔧 Services Using CoinGecko API Key
### 1. Token Aggregation Service
**Service:** `smom-dbis-138/services/token-aggregation/`
**Adapter:** `src/adapters/coingecko-adapter.ts`
**How it works:**
- Reads `COINGECKO_API_KEY` from environment
- Uses Pro API endpoint when key is present
- Sends key in header: `x-cg-pro-api-key`
**Benefits:**
- Higher rate limits
- More reliable token data fetching
- Better market data enrichment
---
### 2. Oracle Publisher Service
**Service:** VMID 3500 (Oracle Publisher Container)
**Location:** `/opt/oracle-publisher/.env`
**Configuration:**
```bash
COINGECKO_API_KEY=your-coingecko-api-key
DATA_SOURCE_1_URL=https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=your-coingecko-api-key
DATA_SOURCE_1_PARSER=ethereum.usd
```
**Note:** Oracle Publisher uses the key in the URL parameter format (`x_cg_demo_api_key`).
---
## 🚀 Next Steps
### Immediate Actions
1. **Copy to Actual .env Files**
```bash
# Root .env
cp .env.example .env
# Edit .env and ensure COINGECKO_API_KEY is set
# Token Aggregation .env
cd smom-dbis-138/services/token-aggregation
cp .env.example .env
# Edit .env and ensure COINGECKO_API_KEY is set
```
2. **Update Oracle Publisher Service**
```bash
ssh root@192.168.11.10
pct exec 3500 -- bash
cd /opt/oracle-publisher
nano .env
# Add: COINGECKO_API_KEY=your-coingecko-api-key
# Update DATA_SOURCE_1_URL to include key
systemctl restart oracle-publisher
```
3. **Restart Services**
```bash
# Token Aggregation (if running)
cd smom-dbis-138/services/token-aggregation
docker-compose restart
# OR
systemctl restart token-aggregation
```
---
## 🔍 Verification
### Verify Token Aggregation
```bash
cd smom-dbis-138/services/token-aggregation
grep COINGECKO_API_KEY .env
# Should show: COINGECKO_API_KEY=your-coingecko-api-key
```
### Verify Oracle Publisher
```bash
ssh root@192.168.11.10 "pct exec 3500 -- grep COINGECKO /opt/oracle-publisher/.env"
# Should show the API key
```
### Test API Key
```bash
# Test CoinGecko API with key
curl "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=your-coingecko-api-key"
```
---
## 📊 API Key Benefits
| Feature | Without Key | With Key |
|---------|-------------|----------|
| **Rate Limit** | 10-50 calls/min | 500+ calls/min |
| **Endpoint** | `api.coingecko.com` | `pro-api.coingecko.com` |
| **Reliability** | Frequent 429 errors | Stable service |
| **Support** | Limited | Better support |
---
## 📚 Documentation
1. **Complete Setup Guide:**
- `docs/04-configuration/COINGECKO_API_KEY_SETUP.md`
- Full configuration instructions
2. **Quick Reference:**
- `COINGECKO_API_KEY_QUICK_REFERENCE.md`
- Quick lookup guide
3. **Oracle Setup:**
- `docs/04-configuration/metamask/ORACLE_PRICE_FEED_SETUP.md`
- Updated with API key configuration
---
## ✅ Summary
- ✅ API key added to root `.env.example`
- ✅ API key added to token-aggregation `.env.example`
- ✅ Documentation created
- ⚠️ **Action Required:** Copy to actual `.env` files and update Oracle Publisher service
---
**Last Updated:** 2026-01-26
**Status:** ✅ API key configured in example files