- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
5.1 KiB
5.1 KiB
Oracle Publisher Service - Setup Complete
Date: $(date)
VMID: 3500
Status: ✅ Configured and Started
✅ Completed Tasks
1. Configuration Files
- ✅ Fixed corrupted
.envfile - ✅ Configured all oracle addresses
- ✅ Set data sources (CoinGecko, Binance)
- ✅ Configured update intervals and thresholds
- ✅ Set PRIVATE_KEY (transmitter account)
2. Python Script
- ✅ Copied
oracle_publisher.pyto container - ✅ Set correct permissions (755)
- ✅ Fixed ownership (oracle:oracle)
3. Python Environment
- ✅ Verified virtual environment exists
- ✅ Installed required packages (web3, eth-account, requests, etc.)
4. Systemd Service
- ✅ Created service file
- ✅ Enabled service
- ✅ Started service
📋 Current Configuration
# Oracle Contracts
AGGREGATOR_ADDRESS=0x99b3511a2d315a497c8112c1fdd8d508d4b1e506
ORACLE_ADDRESS=0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6
# Network
RPC_URL=http://192.168.11.250:8545
WS_URL=ws://192.168.11.250:8546
CHAIN_ID=138
# Update Settings
UPDATE_INTERVAL=60
HEARTBEAT_INTERVAL=60
DEVIATION_THRESHOLD=0.5
# Data Sources
DATA_SOURCE_1_URL=https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd
DATA_SOURCE_1_PARSER=coingecko
DATA_SOURCE_2_URL=https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT
DATA_SOURCE_2_PARSER=binance
# Metrics
METRICS_PORT=8000
METRICS_ENABLED=true
🔍 Service Status
Check Status
ssh root@192.168.11.10 "pct exec 3500 -- systemctl status oracle-publisher"
View Logs
# Follow logs in real-time
ssh root@192.168.11.10 "pct exec 3500 -- journalctl -u oracle-publisher -f"
# View recent logs
ssh root@192.168.11.10 "pct exec 3500 -- journalctl -u oracle-publisher -n 50"
Verify Oracle Updates
# Query oracle for latest price
cast call 0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6 \
"latestRoundData()" \
--rpc-url https://rpc-http-pub.d-bis.org
# The answer field (in 8 decimals) represents the ETH/USD price
# Divide by 1e8 to get USD price
Check Metrics
# Access Prometheus metrics
ssh root@192.168.11.10 "pct exec 3500 -- curl -s http://localhost:8000/metrics | grep oracle"
🔄 Service Management
Start Service
ssh root@192.168.11.10 "pct exec 3500 -- systemctl start oracle-publisher"
Stop Service
ssh root@192.168.11.10 "pct exec 3500 -- systemctl stop oracle-publisher"
Restart Service
ssh root@192.168.11.10 "pct exec 3500 -- systemctl restart oracle-publisher"
Enable Auto-Start
ssh root@192.168.11.10 "pct exec 3500 -- systemctl enable oracle-publisher"
📊 Expected Behavior
The Oracle Publisher service will:
-
Fetch Prices every 60 seconds from:
- CoinGecko API (primary)
- Binance API (fallback)
-
Calculate Median Price from multiple sources
-
Check Deviation - Only update if price change > 0.5%
-
Update Oracle Contract with new price if needed
-
Expose Metrics on port 8000 for monitoring
🐛 Troubleshooting
Service Not Running
# Check status
ssh root@192.168.11.10 "pct exec 3500 -- systemctl status oracle-publisher"
# Check logs for errors
ssh root@192.168.11.10 "pct exec 3500 -- journalctl -u oracle-publisher -n 50"
Authorization Errors
If you see "Aggregator: only transmitter":
- Verify PRIVATE_KEY account is authorized as transmitter
- Check account has sufficient ETH for gas fees
Price Not Updating
- Check service is running
- Check logs for errors
- Verify data sources are accessible
- Check deviation threshold (only updates if change > 0.5%)
- Verify oracle contract is being updated
Python Errors
# Test Python script manually
ssh root@192.168.11.10 "pct exec 3500 -- su - oracle -c 'cd /opt/oracle-publisher && source venv/bin/activate && python oracle_publisher.py'"
📈 Monitoring
Key Metrics
oracle_updates_sent_total- Total updates sent to blockchainoracle_update_errors_total- Total errors encounteredoracle_current_price- Current oracle price (USD)oracle_price_deviation- Price deviation from last update (%)
Log Monitoring
Monitor logs for:
- Successful price updates
- Transaction confirmations
- API errors from data sources
- Authorization errors
✅ Verification Checklist
- Service file created and configured
- .env file configured with all settings
- PRIVATE_KEY set (transmitter account)
- Python script copied and has correct permissions
- Python packages installed
- Service started and running
- Service logs show successful operation
- Oracle contract receiving price updates
- Metrics endpoint accessible
📚 Related Documentation
docs/ORACLE_UPDATE_AUTHORIZATION.md- Authorization requirementsdocs/METAMASK_USD_PRICE_FIX.md- MetaMask integrationdocs/UPDATE_ALL_ORACLE_PRICES.md- Manual update guidedocs/ORACLE_PUBLISHER_SERVICE_STATUS.md- Status and troubleshooting
Last Updated: $(date)
Status: ✅ Service configured and started