Skip to content

Stream your first blocks

Create a Substreams API key and stream five Ethereum blocks with the standard Substreams CLI.

Stream five Ethereum blocks to see the output your consumer will receive. This quickstart runs the map_block_meta module of the ethereum-explorer package with the Substreams CLI. The command pins the v0.1.2 package from its upstream release, so the result does not change when the package is updated.

Expected result: five block-scoped map_block_meta messages printed as JSON.

Prerequisites

  • A GraphOps Platform account.
  • An organization with access to Substreams.
  • An Owner or Developer role to create a Substreams API key, or a key supplied by your team.
  • The standard Substreams CLI installed locally.

Create an API key

Create a Substreams API key

Choose your organization, create the key for Substreams, and store the plaintext value in your secret manager.

Choose the endpoint

Use the Ethereum mainnet endpoint:

https://1.evm.substreams.graphops.xyz

Endpoint preview

The CLI uses SUBSTREAMS_API_KEY.

Replace placeholders with your identifier and API key before making requests.

Stream five blocks

Run map_block_meta from the public ethereum-explorer package:

export SUBSTREAMS_API_KEY="<GRAPHOPS_API_KEY>"

substreams run \
  -e "https://1.evm.substreams.graphops.xyz" \
  "https://github.com/streamingfast/substreams-explorers/releases/download/v1.0.1/ethereum-explorer-v0.1.2.spkg" \
  "map_block_meta" \
  --start-block 18000000 \
  --stop-block +5 \
  -o json

Inspect the output

The CLI prints one JSON message per block, for blocks 18000000 through 18000004:

{  "@module": "map_block_meta",The output module you ran  "@block": 18000000,The block this message covers  "@type": "eth.block_meta.v1.BlockMeta",Protobuf type of the output  "@data": {The module output    "number": "18000000",    "hash": "…"  }}
The CLI puts each block's module output in @data. This illustrative excerpt shows number and hash; the complete payload depends on the package output type.

Move toward production

A production consumer saves each block's cursor in the same transaction as its output, then resumes from the latest committed cursor after reconnecting.

Next steps