A Firehose gRPC server, written in Rust, that serves Ethereum block data to The Graph's graph-node using SQD Portal as the data source instead of a geth node.
graph-node can consume blockchain data through the StreamingFast Firehose gRPC interface. firehose-grpc implements that interface (the sf.firehose.v2 Stream and Fetch services) and answers requests by reading from a SQD Portal endpoint rather than from a running Ethereum node. The server requests blocks, logs, transactions, and traces from the Portal and maps them into the Ethereum Firehose block format (sf.ethereum.type.v2) that graph-node expects.
SQD Portal is the data API of SQD Network, an open data platform for Web3. See the SQD documentation for more on the Portal and the network.
- Exposes the Firehose v2 gRPC services on
0.0.0.0:13042:Stream.Blocks: streams blocks from a starting block (with cursor and stop-block support).Fetch.Block: returns a single block by number, hash, or cursor.
- gRPC server reflection is enabled.
- Reads block data from a SQD Portal endpoint over HTTP.
- Optionally uses an Ethereum JSON-RPC node as a source for recent ("hot") blocks near the chain head. When configured, it also tracks chain reorganizations and emits
STEP_UNDO/STEP_FINALsteps accordingly. - Serves Prometheus metrics on
0.0.0.0:3000/metrics.
Requires a Rust toolchain and the Protocol Buffers compiler (protoc).
cargo build --release
The binary is produced at target/release/firehose-grpc.
docker build -t firehose-grpc .
The image entrypoint is the firehose-grpc binary and exposes port 13042.
firehose-grpc --portal <PORTAL_URL> [--rpc <ETH_RPC_URL> --finality-confirmation <N>]
Arguments:
| Flag | Required | Description |
|---|---|---|
--portal |
yes | SQD Portal endpoint URL used as the data source. |
--rpc |
no | Ethereum JSON-RPC URL used as a source for recent blocks near the head. |
--finality-confirmation |
with --rpc |
Number of blocks after which a block is considered final. Required when --rpc is set. |
The gRPC server listens on port 13042 and Prometheus metrics are served on port 3000.
- SQD docs: https://docs.sqd.dev
- SQD Network: https://sqd.dev/network
- The Graph Firehose: https://thegraph.com/docs/en/indexing/tooling/firehose/
- graph-node: https://github.com/graphprotocol/graph-node