The Flow local event indexer is available on github and docker and can be used during development before set up your Graffle projects. It is a trimmed down version of the event indexers on the Projects page within the Graffle management dashboard.
We recommend using the Docker image and running the local indexer using docker, but you can pull the code from GitHub and debug it in your IDE or run it with docker-compose.
FlowNode: MainNet, TestNet, or Emulator. Note: Emulator support is currently limited to running from VS Code.
MaximumBlockScanRange: Block size to scan when catching up after falling behind, should normally be set to 200.
WebhookUrl: Your url which will receive POST requests containing your processed events.
EventId: Flow event Id of the event type you want to process. ex: A.c1e4f4f4c4257510.Market.MomentPurchased
Verbose: Log found events to the console when posting to WebhookUrl.
HMACToken: Base-64 encoded string for HMAC authentication headers.
docker pull graffle/flow-event-processor
docker run -e "FlowNode=TestNet" -e "WebhookUrl=url" -e "EventId=A.c1e4f4f4c4257510.TopShotMarketV3.MomentPurchased" graffle/flow-event-processor
docker run -e "FlowNode=MainNet" -e "WebhookUrl=url" -e "EventId=A.c1e4f4f4c4257510.TopShotMarketV3.MomentPurchased" graffle/flow-event-processor
Note: When using the HMAC variable to set a token, this application always adds the following headers to the request.
See "Securing Indexer Webhooks" for information about decoding/validating HMAC auth headers.
Create a .env.local file in the root of your repository, next to docker-compose.yml:
Open a terminal window in the root of your repository and run one of the following: