> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uatu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Requirements, environment variables and how config is loaded.

## Requirements

* Go 1.26+
* PostgreSQL
* Redis
* An RPC endpoint per chain you intend to support

## How config is loaded

Configuration comes from two places: a `.env` file and the process environment. Both
are read, and **environment variables win** where a key is defined in both.

The `.env` file is a convenience for local development and is entirely optional.
Anywhere the environment already supplies these values, such as a container or a
systemd unit using `EnvironmentFile=`, no file needs to exist on disk.

<Warning>
  All fields are validated at startup. The process exits if any required value is
  missing, rather than starting in a half-configured state.
</Warning>

## Variables

| Variable                                        | Purpose                                               |
| ----------------------------------------------- | ----------------------------------------------------- |
| `PORT`                                          | HTTP listen port                                      |
| `POSTGRES_DSN`                                  | Postgres connection string                            |
| `REDIS_DSN`                                     | Redis connection URL, e.g. `redis://localhost:6379/`  |
| `<CHAIN>_RPC_URL`                               | RPC endpoint per chain, e.g. `ETHEREUM_RPC_URL`       |
| `OTEL_ENABLED`                                  | Toggle OpenTelemetry export                           |
| `OTEL_ENDPOINT`, `OTEL_USE_TLS`, `OTEL_HEADERS` | OTLP exporter settings                                |
| `RATE_LIMIT_TOKENS`                             | Requests allowed per client per interval (default 60) |
| `RATE_LIMIT_INTERVAL`                           | Budget interval, e.g. `1m` (default `1m`)             |
| `RATE_LIMIT_TRUSTED_HEADER`                     | Client-IP header set by a trusted reverse proxy       |
| `RATE_LIMIT_TRUSTED_PROXY_CIDRS`                | Comma-separated CIDRs allowed to supply that header   |

`PORT` has no default, so set it explicitly.

## RPC endpoints

Each chain needs its own `<CHAIN>_RPC_URL`, named after the chain. Only configure the
ones you intend to serve: seeding makes live RPC calls per chain, and an endpoint that
doesn't respond produces a non-fatal warning and leaves that chain without pools.

```env theme={null}
ETHEREUM_RPC_URL=https://…
BASE_RPC_URL=https://…
ARBITRUM_RPC_URL=https://…
```

See [Supported chains](/concepts/chains) for the full set.

## Observability

OpenTelemetry export is off unless `OTEL_ENABLED` is set. With it on, `OTEL_ENDPOINT`,
`OTEL_USE_TLS` and `OTEL_HEADERS` configure the OTLP exporter. The repository ships a
`docker-compose.otel.yml` and an `otel-collector-config.yaml` for running a collector
locally.

<Card title="Rate limiting" icon="gauge-high" href="/self-hosting/rate-limiting">
  The proxy-related variables need care: both must be set together, or startup fails.
</Card>
