Transport configuration controls how the Edge Server communicates with other peers in the mesh network. You can enable or disable specific transport protocols based on your deployment environment.

Available Transports

Edge Server supports the following transport protocols:
  • LAN: Local Area Network connections over WiFi or Ethernet
  • Bluetooth LE: Bluetooth Low Energy
All transports are enabled by default where supported, with mDNS enabled for automatic peer discovery on LAN.

Basic Configuration

In the most basic use case, you can omit transport config and rely on defaults, this will enable all available P2P transports and turn on mDNS for peer discovery:
resources:
  my_ditto_db:
    resource_type: DittoDatabase
    db_id: "YOUR_APP_ID"
    device_name: "edge-device-1"
    auth:
      # ... auth configuration

Advanced Configuration

For fine-grained control over individual transports:
resources:
  my_ditto_db:
    resource_type: DittoDatabase
    db_id: "YOUR_APP_ID"
    device_name: "edge-device-1"
    transport_config:
      peer_to_peer:
        ble_enabled: false
        lan_enabled: true
        lan_mdns_enabled: false # Auto-discover peers with same db_id. Default true
    auth:
      # ... auth configuration

Direct Static Connections

This section describes how to configure direct static connections between peers. This can be thought of as a “hub-and-spoke” model where one or more central nodes (hubs) accept incoming connections from edge nodes (spokes). In the “spoke”, you set the transport configuration to connect directly to the IP address of the hub. For more information read the transport configuration SDK API Guide. Use Cases
  • Air-gapped networks: Secure facilities with no external connectivity
  • Edge computing: Factory floors, warehouses, or retail environments
  • Privacy-first deployments: Keep all data local to your network
For networks where mDNS is unavailable or blocked, configure known peers explicitly:
resources:
  # Central hub node
  hub_db:
    resource_type: DittoDatabase
    db_id: "YOUR_APP_ID"
    device_name: "central-hub"
    auth:
      small_peer_only:
        offline_license_token: "YOUR_OFFLINE_LICENSE"
    transport_config:
      # Accept incoming connections
      listen_config:
        tcp_listen:
          enable: true
          ip: "0.0.0.0"
          port: 4040
      peer_to_peer:
        lan_enabled: true
        lan_mdns_enabled: false  # Disable auto-discovery
    subscriptions:
      - "SELECT * FROM sensors"
      - "SELECT * FROM alerts WHERE priority >= 3"

  # HTTP API for local access
  hub_api:
    resource_type: HttpServer
    db_id: "87654321-4321-4123-4321-210987654321"
    base_path: "api"
    listen_addr: "0.0.0.0:8080"
    http_api: true

An example Edge Server “Spoke” configuration:
  # Edge node configuration (connect to hub)
  edge_db:
    resource_type: DittoDatabase
    db_id: "YOUR_APP_ID"  # Same ID to form mesh
    device_name: "edge-node-01"
    auth:
      small_peer_only:
        offline_license_token: "YOUR_OFFLINE_LICENSE"
    transport_config:
      connect_config:
        known_tcp_servers:
          - "192.168.1.100:4040"  # Hub IP address
        retry_interval_msec: 5000
      peer_to_peer:
        lan_enabled: true
        lan_mdns_enabled: false

Multi-Transport Mesh

Enable multiple transports for maximum control in challenging environments:
resources:
  resilient_db:
    resource_type: DittoDatabase
    db_id: "11111111-2222-4333-4444-555555555555"
    device_name: "multi-transport-node"
    auth:
      small_peer_only:
        offline_license_token: "YOUR_OFFLINE_LICENSE"
    transport_config:
      # Enable all peer-to-peer transports
      peer_to_peer:
        ble_enabled: true         # For mobile devices
        lan_enabled: true         # For network connectivity
        lan_mdns_enabled: true    # For automatic discovery
        lan_multicast_enabled: true
      # Also listen for TCP connections
      listen_config:
        tcp_listen:
          enable: true
          ip: "0.0.0.0"
          port: 4040
      # Connect to known peers
      connect_config:
        known_tcp_servers:
          - "gateway.local:4040"
        known_ws_servers:
          - "ws://backup.local:8080"
        retry_interval_msec: 10000
See the transport configuration reference for more details.

Platform-Specific Notes

Bluetooth LE

  • For Linux deployments, see the Deploying on Linux guide for BlueZ requirements and setup
  • May need elevated permissions
  • Range typically 10-30 meters depending on environment

mDNS Discovery

  • Uses Bonjour on macOS
  • Ensure firewall allows mDNS traffic (port 5353)
  • Automatically discovers peers on the same network
  • See Deploying on LAN guide for more details

Common Configurations

LAN-Only Configuration

For deployments within a single network:
transport_config:
  peer_to_peer:
    ble_enabled: false
    lan_enabled: true
    lan_mdns_enabled: true

Static Peer Configuration

For known, fixed deployments:
transport_config:
  listen_config:
    tcp_listen:
      enabled: true
      ip: "0.0.0.0"
      port: 4040
  connect:
    tcp_servers:
      - "192.168.1.100:4040"

Troubleshooting

Peers Not Discovering Each Other

If using mDNS discovery:
transport_config:
  peer_to_peer:
    lan_enabled: true
    lan_mdns_enabled: true  # Must be true
Check:
  • Firewall allows UDP port 5353
  • Nodes are on the same network segment
  • mDNS/Bonjour services are running

Connection Refused Errors

For TCP connections:
listen_config:
  tcp_listen:
    enable: true
    ip: "0.0.0.0"  # Accept from any interface
    port: 4040     # Ensure unique port
Verify:
  • Port is not already in use
  • Firewall allows the configured port
  • IP address is correct in known_tcp_servers