Skip to content

global

Global YAML.

etherscan_api_key

We advise you to put the etherscan API key in an environment variable.

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global: 
  etherscan_api_key: ${ETHERSCAN_API_KEY}

contracts

The contracts section of the global YAML config allows you to define contracts which can be used in the indexers. You can define many contracts in a single YAML file.

name

The name of the contract, it should be unique to the YAML file.

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global: 
  contracts: 
    - name: USDT

details

The details of the contract.

address

The address of the contract.

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global:
  contracts:
    - name: USDT
      details: 
        - address: 0xdac17f958d2ee523a2206206994597c13d831ec7

network

The network the contract is on, this should match the network name in the networks section of the YAML file.

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global:
  contracts:
    - name: USDT
      details:
        - address: 0xdac17f958d2ee523a2206206994597c13d831ec7
          network: ethereum

abi

The path to the ABI file for the contract. It can be a relative or full path.

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global:
  contracts:
    - name: USDT
      details:
        - address: 0xdac17f958d2ee523a2206206994597c13d831ec7
          network: ethereum
      abi: ./abis/erc20.abi.json

Multiple Contracts

rindexer.yaml
name: rETHIndexer
description: My first rindexer project
repository: https://github.com/joshstevens19/rindexer
project_type: rust
networks:
- name: ethereum
  chain_id: 1
  rpc: https://mainnet.gateway.tenderly.co
- name: base
  chain_id: 8453
  rpc: https://mainnet.base.org
storage:
  postgres:
    enabled: true
contracts:
- name: RocketPoolETH
  details:
  - network: ethereum
    address: "0xae78736cd615f374d3085123a210448e74fc6393"
    start_block: 18900000
    end_block: 19000000
  abi: ./abis/RocketTokenRETH.abi.json
  include_events:
    - Transfer
    - Approval
global: 
  contracts: 
    - name: USDT
      details: 
        - address: 0xdac17f958d2ee523a2206206994597c13d831ec7
          network: ethereum
        - address: 0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2
          network: base
      abi: ./abis/erc20.abi.json