Connection Problems
This guide helps resolve network and connection-related issues with arb-assist.
RPC Connection Issues
Connection Refused
Error:
Error: Connection refused to RPC endpoint
Common Causes:
Incorrect URL format
Firewall blocking connection
RPC endpoint down
Invalid authentication
Troubleshooting Steps:
Verify URL format:
# Correct formats
rpc_url = "https://api.mainnet-beta.solana.com"
rpc_url = "http://localhost:8899"
rpc_url = "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
# Common mistakes
rpc_url = "api.mainnet-beta.solana.com" # Missing protocol
rpc_url = "https://api.mainnet-beta.solana.com/" # Trailing slash
Test connection:
# Basic connectivity test
curl -I https://api.mainnet-beta.solana.com
# Test RPC method
curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}' \
YOUR_RPC_URL
Check firewall:
# Check if port is open
nc -zv api.mainnet-beta.solana.com 443
# Check firewall rules
sudo ufw status
Rate Limiting
Error:
Error: 429 Too Many Requests
Solutions:
Use recommended RPC:
# Helius (cheaper option, fine for starting out)
rpc_url = "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
# NFT-gated shared nodes (better performance)
rpc_url = "http://deez.top:80"
rpc_url = "http://shark.top:80"
rpc_url = "http://platinum.top:80"
Implement request distribution:
# Multiple RPCs for different purposes
rpc_url = "https://read-rpc.com" # For data fetching
config_rpc_url = "https://bot-rpc.com" # For bot config
sending_rpc_urls = [ # For transaction sending
"https://send1.com",
"https://send2.com",
"https://send3.com",
]
Reduce request frequency:
update_interval = 30000 # 30 seconds instead of 10
SSL/TLS Errors
Error:
Error: SSL certificate problem
Solutions:
Update certificates:
sudo apt update
sudo apt install ca-certificates
sudo update-ca-certificates
Check system time:
# Incorrect time can cause SSL errors
timedatectl status
sudo timedatectl set-ntp true
Use HTTP if appropriate (local/private networks only):
rpc_url = "http://10.0.0.5:8899" # Internal RPC
GRPC Connection Issues
Failed to Connect
Error:
Error: Failed to connect to GRPC endpoint
Debugging Steps:
Verify GRPC configuration:
# Yellowstone example
grpc_url = "http://grpc.example.com:10001" # Note: often HTTP not HTTPS
grpc_token = "" # May not need token
grpc_engine = "yellowstone"
# ThorStreamer example
grpc_url = "https://thor.example.com/stream"
grpc_token = "eyJ0eXAiOiJKV1QiLCJhbGc..." # Required token
grpc_engine = "thor"
Test GRPC connectivity:
# For HTTP/2
curl -I http://grpc.example.com:10001
# Check if port is open
telnet grpc.example.com 10001
Verify authentication:
Check token hasn't expired
Ensure token is correctly formatted
Verify engine type matches provider
Stream Interruptions
Error:
Error: GRPC stream disconnected
Common Causes:
Network instability
Provider-side timeout
Resource limits
Authentication expiry
Solutions:
Implement reconnection logic (arb-assist handles this automatically)
Monitor connection stability:
# Continuous ping test
ping -i 1 grpc.example.com | ts
# Monitor packet loss
mtr grpc.example.com
Check provider status:
Visit provider status page
Check Discord/support channels
Try alternative endpoints
Authentication Failures
Error:
Error: GRPC authentication failed
Solutions:
Verify token format:
# JWT token (common)
grpc_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
# API key
grpc_token = "sk_live_abcd1234..."
# Empty (some providers)
grpc_token = ""
Check token permissions:
Ensure token has streaming permissions
Verify IP whitelist if applicable
Check rate limits on token
Token rotation:
Some providers rotate tokens
Update token in config
Restart arb-assist
Network Configuration
Firewall Issues
Symptoms:
All external connections fail
Local connections work
Timeout errors
Solutions:
Check outbound rules:
# UFW (Ubuntu Firewall)
sudo ufw status verbose
# Allow outbound HTTPS
sudo ufw allow out 443/tcp
# Allow outbound HTTP
sudo ufw allow out 80/tcp
# Allow GRPC ports (common range)
sudo ufw allow out 10000:10010/tcp
iptables rules:
# List current rules
sudo iptables -L -n -v
# Allow outbound connections
sudo iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
Cloud provider firewalls:
AWS: Check Security Groups
GCP: Check VPC firewall rules
Azure: Check Network Security Groups
DNS Resolution
Error:
Error: Failed to resolve hostname
Solutions:
Check DNS configuration:
# View current DNS servers
cat /etc/resolv.conf
# Test DNS resolution
nslookup api.mainnet-beta.solana.com
dig api.mainnet-beta.solana.com
Add reliable DNS servers:
# Edit resolv.conf
sudo nano /etc/resolv.conf
# Add these lines
nameserver 8.8.8.8 # Google DNS
nameserver 1.1.1.1 # Cloudflare DNS
nameserver 8.8.4.4 # Google DNS backup
Fix systemd-resolved (Ubuntu):
# Disable and reconfigure
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
# Create static resolv.conf
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
Proxy Configuration
If behind a corporate proxy:
System proxy settings:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
export NO_PROXY=localhost,127.0.0.1
Application-specific proxy:
# Some configurations may support
proxy_url = "http://proxy.company.com:8080"
Connection Pool Management
Too Many Connections
Symptoms:
Connection refused after running for a while
"Too many connections" errors
Resource exhaustion
Solutions:
Reuse connections:
# For NotArb - use same RPC for multiple purposes
[notarb]
token_accounts_checker = { rpc_url = "" } # Empty = use main RPC
blockhash_updater = { rpc_url = "" }
Connection limits:
# Check current limits
ulimit -n
# Increase if needed
ulimit -n 65536
Monitor connections:
# Count connections to RPC
netstat -an | grep :443 | grep ESTABLISHED | wc -l
# Watch connections over time
watch 'netstat -an | grep :443 | grep ESTABLISHED | wc -l'
Latency Optimization
High Latency Issues
Symptoms:
Slow responses
Timeouts despite connectivity
Missed opportunities
Solutions:
Geographic optimization:
# Test latency to endpoints
ping -c 10 api.mainnet-beta.solana.com
ping -c 10 api.mainnet-beta.solana.com | grep avg
# Traceroute to identify slow hops
traceroute api.mainnet-beta.solana.com
Use regional endpoints:
# Choose endpoints near your server
# US East
rpc_url = "https://us-east.rpc.com"
# Europe
rpc_url = "https://eu.rpc.com"
# Asia
rpc_url = "https://asia.rpc.com"
Connection timing:
# Measure connection time
time curl -I https://api.mainnet-beta.solana.com
# Detailed timing
curl -w "@curl-format.txt" -o /dev/null -s https://api.mainnet-beta.solana.com
Create curl-format.txt
:
time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
time_total: %{time_total}s\n
Connection Monitoring
Setup Monitoring
Create connection monitor script:
#!/bin/bash
# monitor-connections.sh
while true; do
echo "=== $(date) ==="
# Test RPC
curl -s -o /dev/null -w "RPC Response: %{http_code} Time: %{time_total}s\n" \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}' \
YOUR_RPC_URL
# Test GRPC
timeout 5 nc -zv YOUR_GRPC_HOST YOUR_GRPC_PORT &>/dev/null
if [ $? -eq 0 ]; then
echo "GRPC: Connected"
else
echo "GRPC: Failed"
fi
# Count connections
echo "Active connections: $(netstat -an | grep ESTABLISHED | wc -l)"
echo ""
sleep 60
done
Run monitor:
chmod +x monitor-connections.sh
./monitor-connections.sh > connection-monitor.log 2>&1 &
Alert on Failures
Setup alerts for connection issues:
#!/bin/bash
# alert-on-failure.sh
check_connection() {
curl -s -f -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}' \
YOUR_RPC_URL > /dev/null
return $?
}
if ! check_connection; then
echo "RPC connection failed at $(date)" | mail -s "arb-assist Alert" your@email.com
# Or send to Discord webhook, Telegram, etc.
fi
Best Practices
Use multiple endpoints: Always have fallbacks
Monitor continuously: Catch issues early
Document endpoints: Keep a list of working endpoints
Test before deploying: Verify all connections work
Have emergency contacts: Provider support, Discord channels
Keep credentials secure: Use environment variables or secure storage
Last updated