Skip to content

Latest commit

 

History

History
129 lines (87 loc) · 2.72 KB

File metadata and controls

129 lines (87 loc) · 2.72 KB

Gork Relay - Successfully Deployed! 🎉

Deployed: Mar 3, 2026 3:35 PM EST Status: ✅ LIVE


Relay Details

Peer ID: 12D3KooWA9CMq2VYF5dt6TvWGPKKyXEwnp5Q2zwGtmb7XAu2Z8fG

Public Address:

/dns4/gork-relay-production.up.railway.app/tcp/4001/p2p/12D3KooWA9CMq2VYF5dt6TvWGPKKyXEwnp5Q2zwGtmb7XAu2Z8fG

URL: https://gork-relay-production.up.railway.app

Ports:

  • 4001: P2P relay
  • 9090: Metrics

Connect to Relay

gork-agent daemon --bootstrap-peers /dns4/gork-relay-production.up.railway.app/tcp/4001/p2p/12D3KooWA9CMq2VYF5dt6TvWGPKKyXEwnp5Q2zwGtmb7XAu2Z8fG

Railway Dashboard

https://railway.com/project/78c74c9f-3e1d-4ad6-a09f-516dd89c31b1


What Was Fixed

The Journey (7 attempts)

  1. Attempt 1: Rust 1.80 → edition2024 incompatibility

    • Fix: Updated to Rust 1.86
  2. Attempt 2: Missing libclang for zstd-sys

    • Fix: Added clang and libclang-dev packages
  3. Attempt 3-5: Permission issues with agent init

    • Fix: Tried different user permission strategies
  4. Attempt 6: Config file format mismatch

    • Problem: Created JSON, but relay used RocksDB (now SQLite)
    • Fix: Runtime initialization
  5. Attempt 7: Entrypoint script not in container

    • Problem: Railway cached old build
    • Fix: Added CACHEBUST arg to force rebuild

Final Solution

Entrypoint script (docker-entrypoint.sh):

#!/bin/bash
set -e

# Initialize agent if not already initialized
if [ ! -f /home/gork/.gork-agent/LOCK ]; then
    echo "Initializing relay agent..."
    gork-agent init --account relay.gork.protocol --dev-mode
fi

# Start relay
exec gork-agent relay --port 4001 --max-circuits 1000 --metrics --metrics-port 9090

This initializes the database (now SQLite) on first run, then starts the relay.


Cost

Railway: ~$3-5/month

  • 512MB RAM
  • Minimal CPU
  • Always-on

Architecture

Agent A (NAT) → Railway Relay → Agent B (NAT)
     ↓                            ↓
  Connect to relay            Connect to relay
     ↓                            ↓
  Relay introduces peers
     ↓
  Direct P2P connection (hole punching)

Next Steps

  1. ✅ Relay deployed and running
  2. ⏳ Test with actual agents
  3. ⏳ Monitor performance
  4. ⏳ Add to Gork Protocol documentation

Files

  • Dockerfile.railway - Railway-optimized Docker image
  • docker-entrypoint.sh - Runtime initialization script
  • railway.json - Railway configuration

Success Metrics:

  • Build time: ~2 minutes (cached)
  • Startup time: ~3 seconds
  • Memory: ~50MB
  • Peer ID: Stable across restarts

This relay provides NAT traversal for all Gork Protocol agents, enabling true P2P communication.