Deployment
Railway

Railway installation

Railway (opens in a new tab) provides a quick and easy way to deploy eRPC. To get started, please ensure that you have signed up or logged in to Railway and connected your GitHub account.

Deploy

Click the Deploy on Railway button below to get started. This will take you to our eRPC template, which includes proxy and monitoring services.

Deploy on Railway (opens in a new tab)

This template comes with a default erpc.yaml (opens in a new tab) configuration file. If you need further customization, you can fork the template's repository (opens in a new tab).

After forking and adjustments, you can either connect your forked repository to your existing deployment or create a new service linked to this forked repository.

Set environment variables

The eRPC template includes pre-configured environment variables to simplify the deployment process. While some variables are optional and can be set later, we highly recommend setting at least one of the following to ensure additional upstreams for the eRPC proxy:

  • ALCHEMY_API_KEY: API key from alchemy.com
  • BLASTAPI_API_KEY: API key from balastapi.io
  • DRPC_API_KEY: API key from drpc.org

Usage in your services

To reduce cost and overhead use private network (.railway.internal) to connect to eRPC, from your backend services (such as indexers or mev bots):

const result = await fetch("https://my-erpc.railway.internal/main/evm/1", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    method: "eth_getBlockByNumber",
    params: ["0x1203319"],
  }),
});

Send your first request

Within your erpc service, find the proxy URL under Settings > Networking > Public Networking.

curl --location 'https://erpc-xxxxxxx.up.railway.app/main/evm/1' \
--header 'Content-Type: application/json' \
--data '{
    "method": "eth_getBlockByNumber",
    "params": [
        "0x1203319",
        false
    ],
    "id": 9199,
    "jsonrpc": "2.0"
}'

image

Monitoring

After sending more requests, click on monitoring service and find your Grafana url under Settings > Networking > Public Networking

You can login with the following credentials:

  • username: admin
  • password: admin

image