Mapping Filters
The manifest file allows granular and coerce filters on the mappings
Range Filter Syntax
A range is an interval of integers that may or may not be infinite and may or may not include the endpoints. The string representation follows the following convention:
[
or]
means the enpoints are included in the ranges,(
and)
mean the endponts are excluded. Ex:[3,5]
means3, 4, 5
and(3, 5)
includes only4
Semi-open ranges include all integers from an endpoint (either inclusively or exclusively), up to infinity:
(4, )
means all integer from5
up to infinity.[5, )
means all integers from5
up to infinity. Left-sided semi-open ranges start from zero, e.g.(, 5]
means0, 1
, etc. up to5
(inclusive).
Global Range Filter
The whole processing pipeline can be constrained to a range of block heights, via the top-level range
property. The following example will process mappings starting from height 100000
Mapping Filter
All mappings (event- and extrinsic handers and block hooks) support an optional filter
property allowing constraints for
height
block height rangerspecVersion
runtime spec version as defined in the runtime at the block header
The latter option is incredibly useful when dealing with runtime upgrades and handling different versions of the same event. For example, the following mapping definitions will handle transfers differently depending on the specVersion
Setting height filters for blockHooks is convenient for one-off initializations of the database. For example
Last updated