Skip to content

Latest commit

Β 

History

History
334 lines (246 loc) Β· 6.33 KB

File metadata and controls

334 lines (246 loc) Β· 6.33 KB

πŸš€ Launch Guide - Pump.fun Trading Indicator

Quick Start (5 minutes)

1. Prerequisites Installation

macOS:

# Install Homebrew if not installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Docker Desktop
brew install --cask docker

# Install Python 3.11+
brew install python@3.11

Ubuntu/Debian:

# Update packages
sudo apt update

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Install Docker Compose
sudo apt install docker-compose

# Install Python 3.11+
sudo apt install python3.11 python3-pip

Windows:

  1. Download and install Docker Desktop for Windows
  2. Download and install Python 3.11+

2. 🎯 Automated Setup (Recommended)

# Clone the repository (or use existing)
cd /Users/snacky/PycharmProjects/indicator

# Make setup script executable
chmod +x setup.sh

# Run automated setup
./setup.sh

The script will:

  • βœ… Check prerequisites
  • βœ… Create .env configuration
  • βœ… Generate secure keys
  • βœ… Pull Docker images
  • βœ… Start all services
  • βœ… Initialize database

3. πŸ”§ Manual Setup (Alternative)

Step 1: Configure Environment

# Copy environment template
cp .env.example .env

# Generate secrets
echo "SECRET_KEY=$(openssl rand -hex 32)" >> .env
echo "JWT_SECRET=$(openssl rand -hex 32)" >> .env

# Edit .env file
nano .env  # or use your preferred editor

Required in .env:

PUMP_FUN_API_KEY=your_actual_api_key_here

Step 2: Create Directories

mkdir -p models data logs ssl
mkdir -p monitoring/grafana/dashboards
mkdir -p monitoring/grafana/datasources

Step 3: Launch Services

# Start all services
docker-compose up -d

# Check status
docker-compose ps

# View logs
docker-compose logs -f

4. 🌐 Access the System

Once running, access:

Service URL Credentials
Dashboard http://localhost None required
API http://localhost:8000 None required
API Docs http://localhost:8000/docs None required
WebSocket ws://localhost:8080/ws None required
Grafana http://localhost:3000 admin / admin
Prometheus http://localhost:9090 None required

5. πŸ§ͺ Test the System

Test API Health:

curl http://localhost:8000/api/health

Test Token Analysis:

# Get recent tokens
curl http://localhost:8000/api/tokens/recent

# Analyze specific token (replace with actual address)
curl http://localhost:8000/api/tokens/YOUR_TOKEN_ADDRESS

Test WebSocket Connection:

// In browser console or Node.js
const ws = new WebSocket('ws://localhost:8080/ws');
ws.onopen = () => console.log('Connected!');
ws.onmessage = (e) => console.log('Data:', JSON.parse(e.data));

Test Dashboard:

  1. Open http://localhost in browser
  2. Enter a token address in search bar
  3. Click "Analyze"

6. πŸ›  Common Operations

View Logs:

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f api
docker-compose logs -f websocket
docker-compose logs -f ml_trainer

Restart Services:

# Restart all
docker-compose restart

# Restart specific service
docker-compose restart api

Stop System:

# Stop services (preserves data)
docker-compose down

# Stop and remove volumes (DELETES DATA)
docker-compose down -v

Update Code:

# The API runs with --reload flag in development
# Changes to src/ are auto-reloaded

# For production updates:
docker-compose build api
docker-compose up -d api

7. πŸ”’ Production Deployment

Enable HTTPS:

# Generate SSL certificates
certbot certonly --standalone -d yourdomain.com

# Update nginx.conf with SSL configuration
# Restart nginx
docker-compose restart nginx

Security Checklist:

  • Change default passwords in .env
  • Update Grafana admin password
  • Enable firewall rules
  • Set DEBUG=false in .env
  • Use private Solana RPC endpoint
  • Enable rate limiting
  • Set up backup strategy

Scale for Production:

# Scale API workers
docker-compose up -d --scale api=3

# Increase resource limits in docker-compose.yml

8. πŸ› Troubleshooting

Issue: Services won't start

# Check Docker is running
docker info

# Check port conflicts
netstat -an | grep -E '(8000|8080|5432|6379|3000)'

# Check logs
docker-compose logs

Issue: Database connection failed

# Check postgres is running
docker-compose ps postgres

# Test connection
docker-compose exec postgres psql -U pump_user -d pump_indicator -c "SELECT 1;"

Issue: WebSocket disconnects

# Check websocket service
docker-compose logs websocket

# Restart service
docker-compose restart websocket

Issue: No data showing

# Check API key is set
grep PUMP_FUN_API_KEY .env

# Test API directly
docker-compose exec api python -c "from src.config import config; print(config.api.pump_fun_base_url)"

9. πŸ“Š Monitor Performance

View System Metrics:

  1. Open Grafana: http://localhost:3000
  2. Import dashboard from monitoring/grafana/dashboards/
  3. View real-time metrics

Check API Metrics:

curl http://localhost:8000/metrics

Database Performance:

docker-compose exec postgres pg_stat_activity

10. 🚦 Quick Commands Reference

# Start everything
./setup.sh

# Stop everything  
docker-compose down

# View status
docker-compose ps

# Follow logs
docker-compose logs -f

# Enter container
docker-compose exec api bash

# Run tests
docker-compose exec api pytest tests/

# Database console
docker-compose exec postgres psql -U pump_user -d pump_indicator

# Redis console
docker-compose exec redis redis-cli

# Rebuild after code changes
docker-compose build && docker-compose up -d

# Full reset (DELETES DATA)
docker-compose down -v && ./setup.sh

Need Help?


πŸŽ‰ You're Ready!

Your Pump.fun Trading Indicator is now running. Open http://localhost to start analyzing tokens!