Run a Spy
Introduction
The Spy is a lightweight component in the Wormhole infrastructure designed to listen for and forward messages (Verifiable Action Approvals (VAAs)) published on the Wormhole network. Running a Spy locally allows developers to subscribe to a filtered stream of these messages, facilitating the development of custom relayers or other integrations with Wormhole.
For a more comprehensive understanding of the Spy and its role within the Wormhole ecosystem, refer to the Spy Documentation.
How to Start a Spy
To start a Spy locally, run the following Docker command:
Optionally, add the following flags to skip any VAAs with invalid signatures:
Subscribe to Filtered VAAs
Once running, a gRPC client (i.e., your program) can subscribe to a filtered stream of messages (VAAs).
Use this proto-spec file to generate a client for the gRPC service.
Note
If using JavaScript/TypeScript, the Spydk makes setting up a client easier.
Data Persistence
The Spy does not have a built-in persistence layer, so it is typically paired with something like Redis or an SQL database to record relevant messages.
The persistence layer needs to implement the appropriate interface. For example, you can check out the Redis interface used by the Relayer Engine, a package that implements a client and persistence layer for messages received from a Spy subscription.