Search…
Local Event Indexer
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. https://hub.docker.com/r/graffle/flow-event-processor https://github.com/Graffle/flow-event-processor 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.

Configuration

  • 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

docker pull graffle/flow-event-processor

TestNet

docker run -e "FlowNode=TestNet" -e "WebhookUrl=url" -e "EventId=A.c1e4f4f4c4257510.TopShotMarketV3.MomentPurchased" graffle/flow-event-processor

MainNet

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. x-graffle-company-id: 00000000-0000-0000-0000-000000000000 x-graffle-project-id: 00000000-0000-0000-0000-000000000000 See "Securing Indexer Webhooks" for information about decoding/validating HMAC auth headers.

Docker-Compose

Create a .env.local file in the root of your repository, next to docker-compose.yml:
WEBHOOKURL=https://<your url>
EVENTID=A.c1e4f4f4c4257510.Market.MomentPurchased
VERBOSE=true
HMACTOKEN=[base64 string]
Open a terminal window in the root of your repository and run one of the following:
docker-compose build test_net_graffle_flow_event_processor
docker-compose --env-file .\.env.local up test_net_graffle_flow_event_processor
docker-compose build main_net_graffle_flow_event_processor
docker-compose --env-file .\.env.local up main_net_graffle_flow_event_processor
for test net or main net event processing.
Copy link
On this page
Configuration
Docker
Docker-Compose