Crate chaindexing

source ·
Expand description

§Chaindexing

Index any EVM chain and query in SQL.

View working examples here: https://github.com/chaindexing/chaindexing-examples/tree/main/rust.

Modules§

  • Augmenting modules for standard library to support Chaindexing’s operations
  • Houses traits and structs for implementing states that can be indexed.

Structs§

  • Represents an EVM chain network
  • Configuration for indexing states
  • Represents the template/specification/interface for a given contract.
  • Helps manage subscription of ingesting and handling events per contract address
  • Events, aka. provider logs, are emitted from smart contracts to help infer their states.
  • Event’s context in a pure event handler
  • Represents the parameters parsed from an event/log. Contains convenient parsers to convert or transform into useful primitives as needed.
  • A chaindexing node’s heartbeat. In a distributed environment, this is useful for managing the indexer’s processes manually. A popular motivation to do is to reduce RPC’s cost.
  • Little-endian 256-bit signed integer.
  • Used to configure managing a chaindexing’s node heartbeat to cut down JSON-RPC’s (Alchemy, Infura, etc.) cost.
  • Event’s context in a side effect handler
  • Little-endian large integer type 256-bit unsigned integer.

Enums§

  • Errors from mis-configurations, database connections, internal errors, etc.

Traits§

  • Pure handlers do not contain any side effects. They are simple reducers that derive or index states deterministically.
  • SideEffectHandlers are event handlers that help handle side-effects for events. This is useful for handling events only ONCE and can rely on a non-deterministic shared state. Some use-cases are notifications, bridging etc. Chaindexing ensures that the side-effect handlers are called once immutably regardless of resets. However, one can dangerously reset including side effects with the reset_including_side_effects exposed in the Config API.

Functions§

  • Includes runtime-discovered contract addresses for indexing.
  • Starts processes for ingesting events and indexing states as configured.

Type Aliases§

  • Hexadecimal representation of addresses (such as contract addresses)
  • Represents bytes
  • Represents the network ID for an EVM Chain For example, ChainId::Mainnet, ChainId::Polygon, etc.
  • Human Readable ABI defined for ingesting events. For example, event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)