Releases: enviodev/hyperindex
v2.16.1
v2.16.0
v2.15.0
What's Changed
Topic Filtering goes Multichain ⛓️
Now the eventFilters
option can also accept a callback, allowing for building different filters depending on chainId
:
import { ERC20 } from "generated";
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
const WHITELISTED_ADDRESSES = {
1: [
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
],
100: ["0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"],
};
ERC20.Transfer.handler(
async ({ event, context }) => {
//... your handler logic
},
{
wildcard: true,
eventFilters: ({ chainId }) => [
{ from: ZERO_ADDRESS, to: WHITELISTED_ADDRESSES[chainId] },
{ from: WHITELISTED_ADDRESSES[chainId], to: ZERO_ADDRESS },
],
}
);
Stricter chainId
type 🔐
The chainId
type on event
is now a union of chain ids the event belongs to. This is much safer than a number
type used before.
Polishing 🧹
- Pass HyperSync api token to JSON api calls by @DZakh in #493
- Update HyperSync chain list by @DZakh in #494
- Add more links to the README by @moose-code in #488
Full Changelog: v2.14.3...v2.15.0
v2.14.3
What's Changed
- Update readme by @moose-code in #484
- Use lodash temporarily for deep cloning by @JonoPrest in #489
Full Changelog: v2.14.2...v2.14.3
v2.14.2
What's Changed
- Improved README for generated indexers by @DenhamPreen in #475
- Log as trace instead of warn on the first HyperSync query retry by @DZakh in #482
- Fix edge case for processing batch creation in unordered multichain mode by @DZakh in #483
- Sync chain list by @DZakh in #486
Full Changelog: v2.14.1...v2.14.2
v2.14.1
What's Changed
- Fix casting
chain_metadata
db types as nullable rather than optional. (Fixes edge-case crash whennull
is passed to a function expectingundefined | number
) by @JonoPrest in #474
Full Changelog: v2.14.0...v2.14.1
v2.14.0
What's Changed
Enhanced Reliability with RPC Data Sources
You can now specify RPC providers for redundancy and failover, ensuring 100% uptime for your indexer. If HyperSync becomes unavailable, your indexer will automatically switch to an RPC provider.
To enable this, add an rpc
field to your network configuration. It can be a URL or a list of RPC configuration objects:
networks:
- id: 137 # Polygon
start_block: 0
+ rpc: https://eth-mainnet.your-rpc-provider.com?API_KEY={ENVIO_MAINNET_API_KEY}
contracts:
- name: PolygonGreeter
address: 0x9D02A17dE4E68545d3a58D3a20BbBE0399E05c9c
🧠 The fallback RPC is triggered if the primary data source does not receive a new block within 20 seconds.
New RPC Configuration Syntax
Adding an RPC provider is now as simple as setting a single URL:
networks:
- id: 137 # Polygon
start_block: 0
+ rpc: https://eth-mainnet.your-rpc-provider.com?API_KEY={ENVIO_MAINNET_API_KEY}
contracts:
- name: PolygonGreeter
address: 0x9D02A17dE4E68545d3a58D3a20BbBE0399E05c9c
- If HyperSync is available for a chain, it remains the primary data source, with RPC as a fallback.
- For chains without HyperSync support, RPC becomes the primary data source.
Advanced Configuration
Gain more control over your RPC setup by specifying it explicitly as a primary source:
networks:
- id: 137 # Polygon
start_block: 0
+ rpc:
+ url: https://eth-mainnet.your-rpc-provider.com?API_KEY={ENVIO_MAINNET_API_KEY}
+ for: sync
contracts:
- name: PolygonGreeter
address: 0x9D02A17dE4E68545d3a58D3a20BbBE0399E05c9c
Or define multiple RPC endpoints with custom settings:
networks:
- id: 137 # Polygon
start_block: 0
+ rpc:
+ - url: https://eth-mainnet.your-rpc-provider.com?API_KEY={ENVIO_MAINNET_API_KEY}
+ for: fallback
+ - url: https://eth-mainnet.your-free-rpc-provider.com
+ for: fallback
+ initial_block_interval: 1000
contracts:
- name: PolygonGreeter
address: 0x9D02A17dE4E68545d3a58D3a20BbBE0399E05c9c
Bug Fixes
- Improved historical sync performance by fixing a critical issue related to reorg detection mode. #470 (@DZakh)
- Fixed raw events that had empty parameters. #460 (@DZakh)
- Fixed Docker Compose file for self-hosting, ensuring Hasura connects correctly to Postgres when using a custom user or database. #459 (@JasoonS)
- Added support for nested ABIs in contract imports. #472 (@diyahir, @DZakh)
Other Changes
- Defaulted
unordered_multichain_mode
totrue
for new projects. #462 (@manusoman) - Cleaned up the project
README.md
. #461 (@DZakh) - Fixed all Clippy warnings. #463 (@JonoPrest)
- Improved wording for multi-chain indexer errors. #471 (@DZakh)
New Contributors
- @diyahir made their first contribution in #472.
- @manusoman made their first contribution in #462.
Full Changelog: v2.13.0...v2.14.0
v2.13.0
What's Changed
- Allow to customise database schema with
ENVIO_PG_PUBLIC_SCHEMA
environment variable by @pavlovdog and @DZakh in #445, #457 - Add CLA by @moose-code in #452
- Update stale readme by @DenhamPreen in #454
- Fix events with empty params by @DZakh in #456
- Enable rollback on reorg in initial templates by @DZakh in #458
New Contributors
- @pavlovdog made their first contribution in #445
Full Changelog: v2.12.4...v2.13.0
v2.12.4
What's Changed
- Initialize indexer with the Unordered Multichain Mode on by default by @DenhamPreen in #292
- Improve Reorg detection logic and fix rollback edge case bugs by @DZakh in #447, #450
- Improve logging on Reorg and Rollback by @DZakh in #449
- Fix invalid indexer state on restart after pre-registration by @JonoPrest in #451
- Chore code changes by @DZakh in #448, #453
Full Changelog: v2.12.3...v2.12.4
v2.12.3
What's Changed
- Fix db saves as false @DenhamPreen & @DZakh in #440
Full Changelog: v2.12.2...v2.12.3