Skip to content

Railway

Deploy an example project

https://github.com/joshstevens19/rrelayer/tree/master/providers/railway

  1. Clone the relevant directory
# this will clone the railway directory
mkdir rrelayer-railway && cd rrelayer-railway
git clone \
  --depth=1 \
  --no-checkout \
  --filter=tree:0 \
  https://github.com/joshstevens19/rrelayer .
git sparse-checkout set --no-cone providers/railway .
git checkout && cp -r providers/railway/* . && rm -rf providers
  1. Initialize a new Railway project

Install Railway CLI if not already installed.

railway login
railway init --name rrelayer-example
  1. Create a service and link it to the project
railway up --detach
railway link
? Select a project
> rrelayer-example
? Select an environment
> production
? Select a service
> rrelayer-example
  1. Create a Postgres database
railway add --database postgres
  1. Configure environment variables
railway open
  • Open the service "Variables" tab:

    • Select "Add Variable Reference" and add a reference for DATABASE_URL and append ?sslmode=disable to the end of the value. The result should look like ${{Postgres.DATABASE_URL}}?sslmode=disable.

    • Select "Add Variable Reference" and add a reference for POSTGRES_PASSWORD.

    • Select "New Variable" with name RRELAYER_AUTH_USERNAME and value admin (or your chosen username).

    • Select "New Variable" with name RRELAYER_AUTH_PASSWORD and set a strong password.

    • Select "New Variable" with name RAW_DANGEROUS_MNEMONIC and paste a development mnemonic (use a secure signing provider in production).

    • Select "New Variable" with name PORT and value 3000 (this matches the port exposed in rrelayer.yaml).

  • Hit "Deploy" or press Shift+Enter.

  1. Create a domain to access the API
railway domain
  1. Redeploy the service
railway up

Health Monitoring

rrelayer exposes a lightweight health endpoint that mirrors the service readiness status. The endpoint runs on the same port as the API.

Accessing the Health Endpoint

  • GET /health — Returns JSON describing the service status.

Example response:

{
  "status": "healthy"
}

Health Status Types

  • healthy — rrelayer is serving requests normally
  • unhealthy — rrelayer returns a non-200 status when it cannot start or has stopped responding

Monitoring in Production

  1. Use Railway's built-in health checks configured in railway.toml:
    healthcheckPath = "/health"
    healthcheckTimeout = 100
  2. Create alerts for non-200 responses from /health
  3. Expose the endpoint via your Railway domain, e.g. https://your-app.railway.app/health

Custom Health Port

The health endpoint listens on the port defined in rrelayer.yaml:

api_config:
  port: 3000