Skip to main content

How to run a feed relay

caution

If running a single node, there is no need to run a feed relay. When running more than one node, it is strongly recommended to run a single feed relay per data center, which will reduce ingress fees and improve stability.

Feed endpoints will soon require compression with a custom dictionary, so if connecting to a feed with anything other than a standard node, it is strongly suggested to run a local feed relay, which will provide an uncompressed feed by default.

Websocket connection stability

Websocket connections to feed endpoints may occasionally be reset by infrastructure providers. The feed client in the relay automatically restarts immediately on disconnect. For most users, a delay of several blocks is not noticeable.

For latency-sensitive applications, you can configure a redundant feed connection at the relay level by providing multiple comma-separated URLs to the same endpoint:

--node.feed.input.url=wss://arb1.arbitrum.io/feed,wss://arb1.arbitrum.io/feed

Important considerations:

  • This doubles the bandwidth usage at the relay
  • Excessive connections to feed endpoints may be rate-limited
  • This redundancy should be implemented at the relay level, not at individual nodes
  • Generally not recommended unless your application specifically requires minimal latency
  • Do not use more than one redundant feed connection

The feed relay is in the same Docker image as the Nitro node.

  • Here is an example of how to run the feed relay for Arbitrum One:
    docker run --rm -it  -p 0.0.0.0:9642:9642 --entrypoint relay offchainlabs/nitro-node:v3.7.2-42be4fe --node.feed.output.addr=0.0.0.0 --node.feed.input.url=wss://arb1-feed.arbitrum.io/feed --chain.id=42161
  • Here is an example of how to run nitro-node for Arbitrum One with a custom relay:
    docker run --rm -it  -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v3.7.2-42be4fe --parent-chain.connection.url=https://l1-mainnet-node:8545 --chain.id=42161 --http.api=net,web3,eth --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=* --node.feed.input.url=ws://local-relay-address:9642

Note that Arbitrum Classic does not communicate with Nitro sequencer, so classic relay is no longer used.

Helm charts (Kubernetes)

If you are using Kubernetes to run your feed relay, a helm chart is available at ArtifactHUB. It supports running a Nitro relay by providing the feed input URL. Find more information in the OCL community Helm charts repository.