File Server Mode

The file server mode allows arb-assist to serve configuration files over HTTP, enabling centralized management of multiple bot instances.

Overview

When enabled, arb-assist creates a lightweight HTTP server that serves generated configuration files. This allows you to:

  • Run arb-assist on one powerful server

  • Deploy bots on multiple lightweight VPS instances

  • Centralize configuration management

  • Reduce resource usage on bot servers

Configuration

Enabling File Server

Set the port in your config.toml:

port = 8080  # Enable on port 8080
# or
port = 0     # Disable file server (default)

Available Endpoints

Once enabled, the following files are served:

Endpoint
Description
Mode Required

http://server:8080/smb-config.toml

SMB configuration

smb or both

http://server:8080/notarb-config.toml

NotArb configuration

na or both

http://server:8080/markets.json

NotArb markets

na or both

http://server:8080/lookup-tables.json

NotArb ALUTs

na or both

http://server:8080/notarb-attributes.json

NotArb attributes

na or both

Security Configuration

Firewall Rules

triangle-exclamation

UFW (Ubuntu Firewall)

Allow specific IPs only:

iptables

More granular control:

Cloud Provider Security Groups

AWS Security Group

Google Cloud Firewall

Reverse Proxy with Authentication

For additional security, use nginx with basic auth:

  1. Install nginx:

  1. Create password file:

  1. Configure nginx:

  1. Restart nginx:

Bot Configuration

SMB-Onchain Setup

  1. Create config fetcher script on bot server:

  1. Add to crontab:

  1. Configure PM2 to watch:

NotArb Setup

  1. Create multi-file fetcher:

  1. Setup auto-fetch:

Multi-Server Architecture

spinner

Benefits

  1. Resource Efficiency:

    • One powerful server for analysis

    • Multiple cheap VPS for execution

    • Reduced overall costs

  2. Scalability:

    • Easy to add/remove bot instances

    • No need to run GRPC on each bot

    • Centralized updates

  3. Reliability:

    • Bot servers can be in different regions

    • Main server failure doesn't stop existing bots

    • Easy disaster recovery

Monitoring

Server Monitoring

Monitor file server health:

Access Logging

Track which bots are fetching configs:

Bandwidth Monitoring

Track file server bandwidth:

Performance Optimization

Caching Headers

If using nginx, add caching headers:

Compression

Enable gzip compression:

Rate Limiting

Prevent abuse with rate limiting:

Troubleshooting

File Server Not Accessible

  1. Check if running:

  1. Test locally:

  1. Check firewall:

Bots Not Updating

  1. Verify fetch script:

  1. Check permissions:

  1. Verify PM2 watching:

High Bandwidth Usage

If bandwidth is excessive:

  1. Reduce fetch frequency

  2. Implement conditional fetching (If-Modified-Since)

  3. Use compression

  4. Consider push model instead of pull

Best Practices

  1. Security First:

    • Always use firewall rules

    • Consider VPN for bot network

    • Monitor access logs

    • Use HTTPS with authentication

  2. Reliability:

    • Implement health checks

    • Use multiple config servers

    • Cache last known good config

    • Alert on failures

  3. Performance:

    • Monitor bandwidth usage

    • Optimize fetch frequency

    • Use compression

    • Consider CDN for global bots

  4. Maintenance:

    • Document server IPs

    • Keep firewall rules updated

    • Monitor disk space

    • Regular security audits

Last updated