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
v0.5 — feature-complete. 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file exec_rest_api-0.5.0.tar.gz.
File metadata
- Download URL: exec_rest_api-0.5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
323150ddd8fa39c7ba2a8cd9b476c345b4caa0e60cd49de3415da6425e828048
|
|
| MD5 |
065e9b1813f699d3a6f47d3ac405c111
|
|
| BLAKE2b-256 |
4e51d9c35675bd07c0236674db13ba5c9dfc46a5ad2a44bae1b26d0989ea7cae
|
Provenance
The following attestation bundles were made for exec_rest_api-0.5.0.tar.gz:
Publisher:
release.yml on ajsutton/exec-rest-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exec_rest_api-0.5.0.tar.gz -
Subject digest:
323150ddd8fa39c7ba2a8cd9b476c345b4caa0e60cd49de3415da6425e828048 - Sigstore transparency entry: 1654387854
- Sigstore integration time:
-
Permalink:
ajsutton/exec-rest-api@d4792bb3f8ff95949d5dd02b6d12f003617143dc -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/ajsutton
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d4792bb3f8ff95949d5dd02b6d12f003617143dc -
Trigger Event:
push
-
Statement type:
File details
Details for the file exec_rest_api-0.5.0-py3-none-any.whl.
File metadata
- Download URL: exec_rest_api-0.5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f77c8a9e9b7c995e110a802270345844f0854d8166a6cf3f9a520c7e165a088
|
|
| MD5 |
4eef1bfd1950edc910e0148145f3901d
|
|
| BLAKE2b-256 |
de61b67ae8a7dfac8d3ebe0e7ae08640cd4ef3130b9330715ec83b8385e36fd2
|
Provenance
The following attestation bundles were made for exec_rest_api-0.5.0-py3-none-any.whl:
Publisher:
release.yml on ajsutton/exec-rest-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exec_rest_api-0.5.0-py3-none-any.whl -
Subject digest:
7f77c8a9e9b7c995e110a802270345844f0854d8166a6cf3f9a520c7e165a088 - Sigstore transparency entry: 1654388109
- Sigstore integration time:
-
Permalink:
ajsutton/exec-rest-api@d4792bb3f8ff95949d5dd02b6d12f003617143dc -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/ajsutton
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d4792bb3f8ff95949d5dd02b6d12f003617143dc -
Trigger Event:
push
-
Statement type: