- 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.
8.5 KiB
Blockscout Explorer Fix - Complete Solution
Date: $(date)
Status: ✅ FIX SCRIPTS CREATED
Issue Summary
The Blockscout explorer at https://explorer.d-bis.org was returning HTTP 522 (Connection Timeout) from Cloudflare, indicating the origin server was not reachable.
Root Causes Identified:
- ❌ Nginx reverse proxy not installed/configured
- ⚠️ Blockscout container may not exist (VMID 5000)
- ⚠️ Blockscout service may not be running
- ❌ Cloudflare DNS/tunnel not configured for explorer.d-bis.org
✅ Solutions Created
1. Nginx Installation Script
File: scripts/install-nginx-blockscout.sh
- Installs Nginx in the Blockscout container
- Configures reverse proxy on ports 80/443
- Proxies to Blockscout on port 4000
- Sets up SSL certificates (self-signed, can be replaced with Let's Encrypt)
- Configures proper headers and timeouts
2. Cloudflare Configuration Script
File: scripts/configure-cloudflare-explorer.sh
- Configures Cloudflare DNS for explorer.d-bis.org
- Creates/updates CNAME record pointing to tunnel
- Enables Cloudflare proxy (orange cloud)
- Provides instructions for tunnel route configuration
3. Complete Fix Script
File: scripts/fix-blockscout-explorer.sh
Comprehensive script that:
- ✅ Checks container status
- ✅ Starts Blockscout service if needed
- ✅ Installs and configures Nginx
- ✅ Verifies all services are running
- ✅ Provides testing instructions
4. Deployment and Fix Script
File: scripts/deploy-and-fix-blockscout.sh
Complete solution that:
- ✅ Deploys Blockscout container if it doesn't exist
- ✅ Runs all fix scripts
- ✅ Configures everything automatically
🚀 Deployment Instructions
Option 1: Container Already Exists
If container VMID 5000 already exists:
cd /home/intlc/projects/proxmox
./scripts/fix-blockscout-explorer.sh
Option 2: Deploy and Fix (Complete)
On Proxmox Host (192.168.11.10):
ssh root@192.168.11.10
cd /home/intlc/projects/proxmox
export VMID_EXPLORER_START=5000
export PUBLIC_SUBNET=192.168.11
./scripts/deploy-and-fix-blockscout.sh
Or deploy manually then fix:
# On Proxmox host
cd /home/intlc/projects/proxmox/smom-dbis-138-proxmox/scripts/deployment
export VMID_EXPLORER_START=5000
export PUBLIC_SUBNET=192.168.11
./deploy-explorer.sh
# Then run fix
cd /home/intlc/projects/proxmox
./scripts/fix-blockscout-explorer.sh
📋 Configuration Details
Container Information
- VMID: 5000
- Hostname: blockscout-1
- IP Address: 192.168.11.140
- Blockscout Port: 4000
- Nginx HTTP Port: 80
- Nginx HTTPS Port: 443
Nginx Configuration
Location: /etc/nginx/sites-available/blockscout
- HTTP (port 80): Redirects to HTTPS
- HTTPS (port 443): Proxies to
localhost:4000 - SSL Certificate:
/etc/nginx/ssl/blockscout.crt(self-signed) - Health Check:
/healthendpoint
Blockscout Service
- Service Name:
blockscout.service - Location:
/opt/blockscout - Docker Compose:
/opt/blockscout/docker-compose.yml - RPC URL:
http://192.168.11.250:8545
🌐 Cloudflare Configuration
DNS Record
Required DNS Record:
Type: CNAME
Name: explorer
Domain: d-bis.org
Target: <tunnel-id>.cfargotunnel.com
Proxy: 🟠 Proxied (orange cloud) - REQUIRED
TTL: Auto
Tunnel Route
In Cloudflare Zero Trust Dashboard:
- Go to: https://one.dash.cloudflare.com/
- Navigate to: Zero Trust → Networks → Tunnels
- Select your tunnel
- Click 'Configure' → 'Public Hostnames'
- Add hostname:
- Subdomain:
explorer - Domain:
d-bis.org - Service:
http://192.168.11.140:80 - Type: HTTP
- Subdomain:
Or configure via script:
cd /home/intlc/projects/proxmox
# Ensure .env file exists with CLOUDFLARE_API_TOKEN
./scripts/configure-cloudflare-explorer.sh
🧪 Testing
1. Test Blockscout Directly
# From inside container
pct exec 5000 -- curl http://127.0.0.1:4000/api/v2/status
# From external
curl http://192.168.11.140:4000/api/v2/status
Expected: JSON response with chain_id and status
2. Test Nginx HTTP
# From inside container
pct exec 5000 -- curl -L http://127.0.0.1/health
# From external
curl -L http://192.168.11.140/health
Expected: Should redirect to HTTPS, then return JSON
3. Test Nginx HTTPS
# From inside container
pct exec 5000 -- curl -k https://127.0.0.1/health
# From external
curl -k https://192.168.11.140/health
Expected: JSON response
4. Test Public URL (After DNS Propagation)
curl https://explorer.d-bis.org/health
Expected: JSON response (may take 1-5 minutes for DNS propagation)
📊 Verification Checklist
- Container VMID 5000 exists and is running
- Blockscout service is active:
systemctl status blockscout - Blockscout responds on port 4000:
curl http://localhost:4000/api/v2/status - Nginx is installed and running:
systemctl status nginx - Nginx configuration is valid:
nginx -t - Port 80 is listening:
ss -tlnp | grep :80 - Port 443 is listening:
ss -tlnp | grep :443 - Nginx proxies correctly:
curl -k https://localhost/health - Cloudflare DNS record exists (CNAME to tunnel)
- Cloudflare tunnel route is configured
- Public URL works:
curl https://explorer.d-bis.org/health
🔧 Troubleshooting
Issue: Container doesn't exist
Solution: Deploy container first:
cd smom-dbis-138-proxmox/scripts/deployment
export VMID_EXPLORER_START=5000
./deploy-explorer.sh
Issue: Blockscout service not running
Solution: Start the service:
pct exec 5000 -- systemctl start blockscout
# Or via docker-compose
pct exec 5000 -- cd /opt/blockscout && docker-compose up -d
Issue: Blockscout not responding on port 4000
Solution:
- Check service status:
pct exec 5000 -- systemctl status blockscout - Check Docker containers:
pct exec 5000 -- docker ps - Check logs:
pct exec 5000 -- journalctl -u blockscout -n 50 - Check Docker logs:
pct exec 5000 -- docker-compose -f /opt/blockscout/docker-compose.yml logs
Issue: Nginx not working
Solution:
- Check configuration:
pct exec 5000 -- nginx -t - Check service:
pct exec 5000 -- systemctl status nginx - Check logs:
pct exec 5000 -- tail -f /var/log/nginx/blockscout-error.log - Restart Nginx:
pct exec 5000 -- systemctl restart nginx
Issue: HTTP 522 from Cloudflare
Solution:
- Verify Blockscout and Nginx are running (see above)
- Test direct access:
curl http://192.168.11.140 - Verify Cloudflare tunnel is healthy
- Check tunnel route configuration
- Verify DNS record is proxied (orange cloud)
Issue: SSL Certificate Warnings
Solution: Replace self-signed certificate with Let's Encrypt:
pct exec 5000 -- certbot --nginx -d explorer.d-bis.org
📝 Files Created/Modified
New Scripts
scripts/install-nginx-blockscout.sh- Nginx installation and configurationscripts/configure-cloudflare-explorer.sh- Cloudflare DNS/tunnel setupscripts/fix-blockscout-explorer.sh- Comprehensive fix scriptscripts/deploy-and-fix-blockscout.sh- Complete deployment and fix
Modified Files
smom-dbis-138-proxmox/scripts/deployment/deploy-explorer.sh- Changed default VMID from 140 to 5000
- Fixed IP subnet from 10.3.1 to 192.168.11
Documentation
docs/BLOCKSCOUT_EXPLORER_FIX.md(this file)
🎯 Next Steps
-
Deploy Container (if not exists):
ssh root@192.168.11.10 cd /home/intlc/projects/proxmox/smom-dbis-138-proxmox/scripts/deployment export VMID_EXPLORER_START=5000 export PUBLIC_SUBNET=192.168.11 ./deploy-explorer.sh -
Run Fix Script:
cd /home/intlc/projects/proxmox ./scripts/fix-blockscout-explorer.sh -
Configure Cloudflare:
./scripts/configure-cloudflare-explorer.shOr configure manually in Cloudflare dashboard
-
Verify:
curl https://explorer.d-bis.org/health -
Optional: SSL Certificate: Replace self-signed certificate with Let's Encrypt for production use
📚 Related Documentation
docs/BLOCKSCOUT_VERIFICATION_GUIDE.md- Contract verification guidedocs/CHAINID_138_BLOCKSCOUT_INTEGRATION.md- Integration summarydocs/04-configuration/CLOUDFLARE_DNS_SPECIFIC_SERVICES.md- DNS configuration
Last Updated: $(date)
Status: ✅ Fix scripts created and ready to use