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:

  1. Incorrect URL format

  2. Firewall blocking connection

  3. RPC endpoint down

  4. Invalid authentication

Troubleshooting Steps:

  1. 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
  1. Test connection:

  1. Check firewall:

Rate Limiting

Error:

Solutions:

  1. Use recommended RPC:

  1. Implement request distribution:

  1. Reduce request frequency:

SSL/TLS Errors

Error:

Solutions:

  1. Update certificates:

  1. Check system time:

  1. Use HTTP if appropriate (local/private networks only):

GRPC Connection Issues

Failed to Connect

Error:

Debugging Steps:

  1. Verify GRPC configuration:

  1. Test GRPC connectivity:

  1. Verify authentication:

    • Check token hasn't expired

    • Ensure token is correctly formatted

    • Verify engine type matches provider

Stream Interruptions

Error:

Common Causes:

  1. Network instability

  2. Provider-side timeout

  3. Resource limits

  4. Authentication expiry

Solutions:

  1. Implement reconnection logic (arb-assist handles this automatically)

  2. Monitor connection stability:

  1. Check provider status:

    • Visit provider status page

    • Check Discord/support channels

    • Try alternative endpoints

Authentication Failures

Error:

Solutions:

  1. Verify token format:

  1. Check token permissions:

    • Ensure token has streaming permissions

    • Verify IP whitelist if applicable

    • Check rate limits on token

  2. 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:

  1. Check outbound rules:

  1. iptables rules:

  1. Cloud provider firewalls:

    • AWS: Check Security Groups

    • GCP: Check VPC firewall rules

    • Azure: Check Network Security Groups

DNS Resolution

Error:

Solutions:

  1. Check DNS configuration:

  1. Add reliable DNS servers:

  1. Fix systemd-resolved (Ubuntu):

Proxy Configuration

If behind a corporate proxy:

  1. System proxy settings:

  1. Application-specific proxy:

Connection Pool Management

Too Many Connections

Symptoms:

  • Connection refused after running for a while

  • "Too many connections" errors

  • Resource exhaustion

Solutions:

  1. Reuse connections:

  1. Connection limits:

  1. Monitor connections:

Latency Optimization

High Latency Issues

Symptoms:

  • Slow responses

  • Timeouts despite connectivity

  • Missed opportunities

Solutions:

  1. Geographic optimization:

  1. Use regional endpoints:

  1. Connection timing:

Create curl-format.txt:

Connection Monitoring

Setup Monitoring

  1. Create connection monitor script:

  1. Run monitor:

Alert on Failures

Setup alerts for connection issues:

Best Practices

  1. Use multiple endpoints: Always have fallbacks

  2. Monitor continuously: Catch issues early

  3. Document endpoints: Keep a list of working endpoints

  4. Test before deploying: Verify all connections work

  5. Have emergency contacts: Provider support, Discord channels

  6. Keep credentials secure: Use environment variables or secure storage

Last updated