01ffc80ef2
flaky test
2.8 KiB
2.8 KiB
Custom transformers
When the capabilities of the generic contractWatcher
are not sufficient, custom transformers tailored to a specific
purpose can be leveraged.
Individual transformers can be composed together from any number of external repositories and executed as a single process using
the compose
and execute
commands or the composeAndExecute
command.
Writing custom transformers
For help with writing different types of custom transformers for the composeAndExecute
set of commands, please see the below:
Storage Transformers
Event Transformers
Contract Transformers
Preparing custom transformers to work as part of a plugin
To plug in an external transformer we need to:
- Create a package that exports a variable
TransformerInitializer
,StorageTransformerInitializer
, orContractTransformerInitializer
that are of type TransformerInitializer or StorageTransformerInitializer, or ContractTransformerInitializer, respectively - Design the transformers to work in the context of their event, storage, or contract watcher execution modes
- Create db migrations to run against vulcanizeDB so that we can store the transformer output
- Do not
goose fix
the transformer migrations, this is to ensure they are always ran after the core vulcanizedb migrations which are kept in their fixed form - Specify migration locations for each transformer in the config with the
exporter.transformer.migrations
fields - If the base vDB migrations occupy this path as well, they need to be in their
goose fix
ed form as they are here
- Do not
To update a plugin repository with changes to the core vulcanizedb repository, run dep ensure
to update its dependencies.