Skip to main content

REST + SSE proxy in front of Ethereum execution clients.

Project description

exec-rest-api

REST + SSE proxy in front of any Ethereum execution client. Talks JSON-RPC to your upstream node and serves a developer-friendly REST API (RFC 9457 problem details, RFC 8288 cursor pagination, SSE streams, content negotiation for raw RLP, no hex quantities).

Status

v1.0 — stable. Endpoints: /chain/*, /blocks/*, /accounts/*, /transactions/*, /logs, /traces/*, /gas/*, /utils/keccak256, /health/*, /streams/{blocks,logs,pending-transactions,sync-status}, /metrics.

Install

Four supported install methods. Pick the one that fits your environment:

pipx (recommended)

pipx install exec-rest-api

pip

pip install exec-rest-api

Single-file .pyz

Download from the latest release:

curl -LO https://github.com/ajsutton/exec-rest-api/releases/latest/download/exec-rest-api.pyz
chmod +x exec-rest-api.pyz
./exec-rest-api.pyz --upstream-http http://localhost:8545

OCI container

docker run --rm -p 8080:8080 \
  ghcr.io/ajsutton/exec-rest-api:latest \
  --upstream-http http://host.docker.internal:8545

All release artefacts (wheel attestations, .pyz, OCI image) are signed via cosign keyless using GitHub Actions OIDC. Verification commands and a hardened systemd unit are in docs/operations.md.

Run

exec-rest-api --upstream-http http://localhost:8545

Or from a source checkout, without any setup steps:

scripts/run.sh --upstream-http http://localhost:8545

(scripts/run.sh creates .venv/ and installs dependencies on first run.)

Then:

curl http://127.0.0.1:8080/chain
# → { "chainId": 1, "networkId": "1", "client": "Geth/v1.13.5...", "blockNumber": 18234567, "syncing": {"syncing": false} }

curl http://127.0.0.1:8080/health/ready
# → { "ready": true, "upstreamReachable": true, "syncing": false, "blockNumber": 18234567 }

curl http://127.0.0.1:8080/metrics
# → exec_rest_api_requests_total{method="GET",path_template="/chain",status="200"} 1
# → ...

Each response carries X-Request-ID, X-Upstream-Method (the JSON-RPC method(s) invoked), and X-Block-Height (current chain head when known) — useful for ad-hoc debugging without touching /metrics.

Configuration

Every CLI flag has an env-var equivalent: --upstream-http is also EXEC_REST_API_UPSTREAM_HTTP. Flags override env vars.

Flag Env var Default
--upstream-http URL EXEC_REST_API_UPSTREAM_HTTP required
--upstream-ws URL EXEC_REST_API_UPSTREAM_WS derived from http URL
--listen HOST:PORT EXEC_REST_API_LISTEN 127.0.0.1:8080
--upstream-timeout SECONDS EXEC_REST_API_UPSTREAM_TIMEOUT 30
--log-level LEVEL EXEC_REST_API_LOG_LEVEL info
--log-format FMT EXEC_REST_API_LOG_FORMAT auto (human on TTY, JSON otherwise)
--metrics on|off EXEC_REST_API_METRICS on

Full list: exec-rest-api --help.

Development

git clone https://github.com/ajsutton/exec-rest-api
cd exec-rest-api
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

Integration tests require anvil (from Foundry) on PATH; they are skipped otherwise.

Operations

See docs/operations.md for systemd, container hardening, and signature verification.

Design docs

  • docs/superpowers/specs/2026-05-28-execution-rest-api-design.md — API contract.
  • docs/superpowers/specs/2026-05-28-execution-rest-api-openapi.yaml — OpenAPI 3.1.
  • docs/superpowers/specs/2026-05-28-execution-rest-api-implementation-design.md — implementation strategy.

License

Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exec_rest_api-1.0.0.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exec_rest_api-1.0.0-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

Details for the file exec_rest_api-1.0.0.tar.gz.

File metadata

  • Download URL: exec_rest_api-1.0.0.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exec_rest_api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c267c1f2379b87e8e09ed3c99e8952a50d20b1e5244a5de59fc35bd86cad5c21
MD5 6c7ab518965d6914c32c2e22184a8b0e
BLAKE2b-256 548042a2c239f865c836d8e940abea9bf18b577c2a735286f6da2d33b5fe8591

See more details on using hashes here.

Provenance

The following attestation bundles were made for exec_rest_api-1.0.0.tar.gz:

Publisher: release.yml on ajsutton/exec-rest-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file exec_rest_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: exec_rest_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 64.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exec_rest_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46cca59c02d426093af1951acfa29169b8447695153fb152439e51840e8655f9
MD5 44372a403750be8d1bcbb7d272c702af
BLAKE2b-256 fc36df76c838f9b24e440d8459ddd4760895490af2718637398870c366dc50e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for exec_rest_api-1.0.0-py3-none-any.whl:

Publisher: release.yml on ajsutton/exec-rest-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page