-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_optimized.sh
More file actions
88 lines (73 loc) · 2.49 KB
/
start_optimized.sh
File metadata and controls
88 lines (73 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Optimized Solana Token Security Scanner Startup Script
echo "🛡️ Starting Solana Token Security Scanner (Optimized Version)"
echo "=================================================="
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python3 is not installed. Please install Python 3.7+"
exit 1
fi
# Check if pip is available
if ! command -v pip &> /dev/null && ! command -v pip3 &> /dev/null; then
echo "❌ pip is not installed. Please install pip"
exit 1
fi
# Install dependencies if requirements.txt exists
if [ -f "requirements.txt" ]; then
echo "📦 Installing Python dependencies..."
pip3 install -r requirements.txt
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies"
exit 1
fi
echo "✅ Dependencies installed successfully"
else
echo "⚠️ requirements.txt not found. Make sure dependencies are installed manually."
fi
# Create logs directory
mkdir -p logs
# Set environment variables for optimal performance
export PYTHONUNBUFFERED=1
export CHECK_INTERVAL=30
export SECURITY_MODE=normal
echo ""
echo "🚀 Starting services..."
echo ""
# Start the optimized scanner
echo "Starting optimized token scanner..."
nohup python3 optimized_scanner.py > logs/scanner.log 2>&1 &
SCANNER_PID=$!
echo "✅ Scanner started (PID: $SCANNER_PID)"
# Wait a moment for scanner to initialize
sleep 3
# Start the enhanced dashboard
echo "Starting enhanced dashboard..."
nohup python3 enhanced_dashboard.py > logs/dashboard.log 2>&1 &
DASHBOARD_PID=$!
echo "✅ Dashboard started (PID: $DASHBOARD_PID)"
# Wait for services to fully start
sleep 5
echo ""
echo "🎉 Services started successfully!"
echo "=================================================="
echo "📊 Dashboard URL: http://localhost:8080"
echo "📈 Scanner PID: $SCANNER_PID"
echo "🖥️ Dashboard PID: $DASHBOARD_PID"
echo ""
echo "📋 Logs:"
echo " Scanner: logs/scanner.log"
echo " Dashboard: logs/dashboard.log"
echo ""
echo "🛑 To stop services:"
echo " kill $SCANNER_PID $DASHBOARD_PID"
echo ""
echo "💡 Pro Tips:"
echo " - Set SECURITY_MODE=conservative for stricter filtering"
echo " - Set SECURITY_MODE=aggressive for broader discovery"
echo " - Monitor logs/scanner.log for real-time activity"
echo ""
# Save PIDs for easy stopping
echo "$SCANNER_PID" > scanner.pid
echo "$DASHBOARD_PID" > dashboard.pid
echo "🔍 Scanner will begin finding tokens within 30 seconds..."
echo "🎯 Check the dashboard for real-time results!"