Skip to content

Uniswap/blocks-subgraph

 
 

Repository files navigation

Blocks Subgraph

A subgraph that indexes block data for EVM networks.

Setup

yarn install

Deploy Workflow

1. Generate subgraph manifest for your network

yarn generate <network>

Supported networks:

  • mainnet
  • arbitrum-one
  • optimism
  • polygon
  • base
  • etc.

2. Build the subgraph

yarn build

3. Deploy

yarn deploy --studio <subgraph-name> # or yarn deploy --product hosted-service <github-user>/<subgraph-name>

Example: Deploy to Arbitrum One

yarn generate arbitrum-one yarn build yarn deploy --studio arbitrum-one-blocks

Architecture

  • subgraph.template.yaml - Template with {{network}} placeholder
  • scripts/generate-subgraph.ts - Generates subgraph.yaml for a specific network
  • src/mappings/blocks.ts - Block handler that indexes all block data

Note

The ConverterRegistryContract in ABIs and subgraph.yaml is a dummy contract used to pass formatting checks. Each block is handled automatically via the blockHandlers configuration.

About

Subgraph to index all block data on Arbitrum One network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%