hydra
Search…
FAQ
Common gotchas and how-tos

I try to run Hydra Indexer for my node but see Registry: ERROR: createType errors

This error indicates that the indexer type definitions are not properly set. Hydra Indexer v3 takes the default types from @polkadot/[email protected] which is compatible with runtimes built on Substrate 3.x but may cause errors when run against older versions of Substrate
Make sure that
  • All the custom types are properly defined in the type definition json and the indexer has picked them up
  • Adress and Signature are decoded properly. This page may be helpful for troubleshooting

How do I access extrinsic data in an event handler?

EventContext has an extrinsic field containing all the relevant extrinsic data if the event was emitted by an extrinsic. Further, one can create a type-safe extrinsic class using the constructor method generated by typegen.

I want to bootstrap some external data not available via events or extrinsics

Export the data into a json file and load into the database via a one-off preBlockHook at the desired height. See mapping filters for more details.

How do I deal with runtime upgrades?

To inject some new data, define a one-off block hook triggered at the block height with the upgrade. In order to have different versions of event/extrinsic handlers for pre- and post- upgrade, use specVersion filter.