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_
std - Augmenting modules for standard library to support Chaindexing’s operations
- states
- Houses traits and structs for implementing states that can be indexed.
Structs§
- Chain
- Represents an EVM chain network
- Config
- Configuration for indexing states
- Contract
- Represents the template/specification/interface for a given contract.
- Contract
Address - Helps manage subscription of ingesting and handling events per contract address
- Event
- Events, aka. provider logs, are emitted from smart contracts to help infer their states.
- Event
Context - Event’s context in a pure event handler
- Event
Param - Represents the parameters parsed from an event/log. Contains convenient parsers to convert or transform into useful primitives as needed.
- Heartbeat
- 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.
- I256
- Little-endian 256-bit signed integer.
- Optimization
Config - Used to configure managing a chaindexing’s node heartbeat to cut down JSON-RPC’s (Alchemy, Infura, etc.) cost.
- Side
Effect Context - Event’s context in a side effect handler
- U256
- Little-endian large integer type 256-bit unsigned integer.
Enums§
- Chaindexing
Error - Errors from mis-configurations, database connections, internal errors, etc.
Traits§
- Event
Handler - Pure handlers do not contain any side effects. They are simple reducers that derive or index states deterministically.
- Side
Effect Handler - 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§
- include_
contract - Includes runtime-discovered contract addresses for indexing.
- index_
states - Starts processes for ingesting events and indexing states as configured.
Type Aliases§
- Address
- Hexadecimal representation of addresses (such as contract addresses)
- Bytes
- Represents bytes
- ChainId
- Represents the network ID for an EVM Chain
For example,
ChainId::Mainnet
,ChainId::Polygon
, etc. - Event
Abi - Human Readable ABI defined for ingesting events.
For example,
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)