Files
explorer-monorepo/QUICK_FIX.md

1.2 KiB

Quick Fix: Database Connection

The Issue

You tried to connect with blockscout user, but the custom explorer backend uses the explorer user.

Correct Command

# ✅ Correct - for custom explorer backend
PGPASSWORD='***REDACTED-LEGACY-PW***' psql -h localhost -U explorer -d explorer -c "SELECT 1;"

Quick Steps

  1. Test connection:

    PGPASSWORD='***REDACTED-LEGACY-PW***' psql -h localhost -U explorer -d explorer -c "SELECT 1;"
    
  2. Run migration:

    cd explorer-monorepo
    PGPASSWORD='***REDACTED-LEGACY-PW***' psql -h localhost -U explorer -d explorer \
      -f backend/database/migrations/0010_track_schema.up.sql
    
  3. Restart server:

    pkill -f api-server
    cd explorer-monorepo/backend
    export DB_PASSWORD='***REDACTED-LEGACY-PW***'
    ./bin/api-server
    
  4. Verify:

    curl http://localhost:8080/health
    

Two Separate Systems

  • Blockscout: User blockscout, Password blockscout, DB blockscout
  • Custom Explorer: User explorer, Password ***REDACTED-LEGACY-PW***, DB explorer

See docs/DATABASE_CONNECTION_GUIDE.md for full details.