Files
proxmox/COINGECKO_API_KEY_SETUP_COMPLETE.md

198 lines
4.7 KiB
Markdown
Raw Normal View History

# CoinGecko API Key Setup - Complete ✅
**Date:** 2026-01-26
**Status:** ✅ **API Key Configured and Verified**
---
## ✅ API Key Verification
**Key:** `CG-LxMsQ7jp3Jd6he3VFzP1uUXA`
**Status:** ✅ **VERIFIED WORKING**
**Test Results:**
- ✅ Bitcoin price fetch: Success ($88,400 USD)
- ✅ Ethereum price fetch: Success ($2,937.31 USD)
- ✅ API key accepted by CoinGecko
---
## 📋 Files Updated
### 1. Root `.env` ✅
**Location:** `/.env`
**Added:**
```bash
# ============================================
# Price Feed & Market Data APIs
# ============================================
# CoinGecko API Key (for Oracle Publisher and Token Aggregation services)
# Provides higher rate limits (500+ calls/min vs 10-50 without key)
COINGECKO_API_KEY=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
```
**Status:** ✅ Updated
---
### 2. Token Aggregation Service `.env` ✅
**Location:** `smom-dbis-138/services/token-aggregation/.env`
**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=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
```
**Status:** ✅ Updated
---
### 3. Root `.env.example` ✅
**Location:** `/.env.example`
**Status:** ✅ Already updated (from previous step)
---
### 4. Token Aggregation `.env.example` ✅
**Location:** `smom-dbis-138/services/token-aggregation/.env.example`
**Status:** ✅ Already updated (from previous step)
---
## 🔧 Oracle Publisher Service
### Automated Update Script Created ✅
**Script:** `scripts/update-oracle-publisher-coingecko-key.sh`
**What it does:**
- Connects to Proxmox host (192.168.11.10)
- Accesses Oracle Publisher container (VMID 3500)
- Updates `/opt/oracle-publisher/.env` with:
- `COINGECKO_API_KEY=CG-LxMsQ7jp3Jd6he3VFzP1uUXA`
- `DATA_SOURCE_1_URL` with API key in URL
- `DATA_SOURCE_1_PARSER=ethereum.usd`
- Restarts oracle-publisher service
**To run:**
```bash
cd /home/intlc/projects/proxmox
./scripts/update-oracle-publisher-coingecko-key.sh
```
**Or manually:**
```bash
ssh root@192.168.11.10
pct exec 3500 -- bash
cd /opt/oracle-publisher
nano .env
# Add/update:
# COINGECKO_API_KEY=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
# DATA_SOURCE_1_URL=https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
# DATA_SOURCE_1_PARSER=ethereum.usd
systemctl restart oracle-publisher
```
---
## ✅ Verification Steps
### 1. Verify Root .env
```bash
grep COINGECKO_API_KEY .env
# Should show: COINGECKO_API_KEY=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
```
### 2. Verify Token Aggregation .env
```bash
cd smom-dbis-138/services/token-aggregation
grep COINGECKO_API_KEY .env
# Should show: COINGECKO_API_KEY=CG-LxMsQ7jp3Jd6he3VFzP1uUXA
```
### 3. Test API Key
```bash
# Test Bitcoin price
curl -s "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&x_cg_demo_api_key=CG-LxMsQ7jp3Jd6he3VFzP1uUXA" | jq .
# Test Ethereum price
curl -s "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=CG-LxMsQ7jp3Jd6he3VFzP1uUXA" | jq .
```
### 4. Verify Oracle Publisher (if accessible)
```bash
ssh root@192.168.11.10 "pct exec 3500 -- grep COINGECKO /opt/oracle-publisher/.env"
# Should show the API key
```
---
## 🚀 Next Steps
### Completed ✅
- [x] API key verified working
- [x] Root `.env` updated
- [x] Token Aggregation `.env` updated
- [x] Update script created for Oracle Publisher
### Pending Actions ⚠️
1. **Update Oracle Publisher Service** (if VMID 3500 exists)
```bash
./scripts/update-oracle-publisher-coingecko-key.sh
```
2. **Restart Token Aggregation Service** (if running)
```bash
cd smom-dbis-138/services/token-aggregation
# If using Docker:
docker-compose restart
# If using systemd:
systemctl restart token-aggregation
```
3. **Verify Services**
- Check Token Aggregation logs for CoinGecko API calls
- Check Oracle Publisher logs for successful price fetches
- Verify no 429 rate limit errors
---
## 📊 API Key Benefits
| Feature | Before (No Key) | After (With Key) |
|---------|-----------------|------------------|
| **Rate Limit** | 10-50 calls/min | 500+ calls/min |
| **Endpoint** | `api.coingecko.com` | `pro-api.coingecko.com` (token-aggregation) |
| **Reliability** | Frequent 429 errors | Stable service |
| **Oracle Publisher** | Rate limited | No rate limits |
---
## 📝 Summary
**API Key:** Verified working
**Root .env:** Updated
**Token Aggregation .env:** Updated
**Update Script:** Created
⚠️ **Oracle Publisher:** Script ready (run when accessible)
---
**Last Updated:** 2026-01-26
**Status:** ✅ Configuration complete, ready for service updates