2.5 KiB
2.5 KiB
Quick Start Guide
Prerequisites
- Docker and Docker Compose
- Go 1.21+
- Node.js 20+
- PostgreSQL 16+ (or use Docker)
- Elasticsearch/OpenSearch (or use Docker)
Setup
-
Clone and navigate to project
cd explorer-monorepo -
Configure environment
cp .env.example .env # Edit .env with your configuration -
Install dependencies
make install # Or manually: # cd backend && go mod download # cd ../frontend && npm install -
Start infrastructure
docker-compose -f deployment/docker-compose.yml up -d postgres elasticsearch redis -
Run migrations
cd backend go run database/migrations/migrate.go cd .. -
Check requirements
./scripts/check-requirements.sh -
Start development services
./scripts/run-dev.shNote: Make sure you're in the
explorer-monorepodirectory when running scripts.Or manually:
# Terminal 1: Indexer cd backend/indexer && go run main.go # Terminal 2: API cd backend/api/rest && go run main.go # Terminal 3: Frontend cd frontend && npm run dev
Access
- Frontend: http://localhost:3000
- API: http://localhost:8080
- API Gateway: http://localhost:8081
- Search Service: http://localhost:8082
Configuration
Edit .env file with your settings:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=explorer
DB_PASSWORD=changeme
DB_NAME=explorer
# RPC
RPC_URL=http://localhost:8545
WS_URL=ws://localhost:8546
CHAIN_ID=138
# Search
SEARCH_URL=http://localhost:9200
Next Steps
- Index blocks: The indexer will start processing blocks automatically
- Browse explorer: Visit http://localhost:3000 to see blocks and transactions
- Check API: Test endpoints at http://localhost:8080/api/v1/blocks
- Review documentation: See
docs/specs/for detailed specifications
Troubleshooting
Database connection errors
- Ensure PostgreSQL is running:
docker ps - Check connection string in
.env - Verify migrations ran successfully
Indexer not processing blocks
- Check RPC URL is correct and accessible
- Verify database connection
- Check logs for errors
Frontend not loading
- Ensure API server is running
- Check API_URL in frontend
.env - Verify CORS settings
Production Deployment
See deployment/ directory for:
- Kubernetes manifests
- Docker Compose files
- CI/CD configurations