You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: infrastructure/spy/run-spy.md
+27-14
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ description: Learn how to run a Spy locally to listen for and forward messages (
7
7
8
8
## Introduction
9
9
10
-
The `Spy` is a lightweight component in the Wormhole infrastructure designed to listen for and forward messages (Verifiable Action Approvals, or 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.
10
+
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.
11
11
12
12
For a more comprehensive understanding of the Spy and its role within the Wormhole ecosystem, refer to the [Spy Documentation](/learn/infrastructure/spy/){target=\_blank}.
13
13
14
14
## How to Start a Spy
15
15
16
16
To start a Spy locally, run the following Docker command:
17
17
18
-
=== "TestNet"
18
+
=== "MainNet"
19
19
20
20
```sh
21
21
docker run --platform=linux/amd64 \
@@ -24,16 +24,10 @@ To start a Spy locally, run the following Docker command:
24
24
spy \
25
25
--nodeKey /node.key \
26
26
--spyRPC "[::]:7073" \
27
-
--env testnet
28
-
```
29
-
Optionally, add the following flags to skip any VAAs with invalid signatures:
Once running, a [gRPC](https://grpc.io/){target=\_blank} client (i.e., your program) can subscribe to a filtered stream of messages (VAAs).
54
61
55
62
Use this [proto-spec file](https://github.com/wormhole-foundation/wormhole/blob/main/proto/spy/v1/spy.proto){target=\_blank} to generate a client for the gRPC service.
56
63
57
64
!!! note
58
65
If using JavaScript/TypeScript, the [Spydk](https://www.npmjs.com/package/@certusone/wormhole-spydk){target=\_blank} makes setting up a client easier.
59
66
67
+
## Data Persistence
68
+
69
+
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.
70
+
71
+
The persistence layer needs to implement the appropriate interface. For example, you can check out the [Redis interface](https://github.com/wormhole-foundation/relayer-engine/blob/main/relayer/storage/redis-storage.ts){target=\_blank} used by the Relayer Engine, a package that serves as a starting point for a custom relaying service.
72
+
60
73
## See Also
61
74
62
75
The [Pyth Beacon](https://github.com/pyth-network/beacon){target=\_blank} provides an alternate Spy implementation that is highly available for improved performance and reliability.
63
76
64
-
The [relayer engine](https://github.com/wormhole-foundation/relayer-engine){target=\_blank} implements a client and persistence layer for messages received from a Spy subscription.
77
+
The [Relayer Engine](https://github.com/wormhole-foundation/relayer-engine){target=\_blank} implements a client and persistence layer for messages received from a Spy subscription.
In the Wormhole context, a _Spy_ is a daemon that subscribes to the gossiped messages in the Guardian Network.
58
11
59
-
Once running, a [gRPC](https://grpc.io/){target=\_blank} client (i.e., your program) can subscribe to a filtered stream of messages.
12
+
They don’t do any validation work. Instead, they watch the Guardian Network and act as an interface to allow users and applications to check on the Spy-accessible messages.
60
13
61
-
To generate a client for the gRPC service use [this proto spec file](https://github.com/wormhole-foundation/wormhole/blob/main/proto/spy/v1/spy.proto){target=\_blank}.
14
+
## Spy-Accessible Messages
62
15
63
-
!!! note
64
-
If using JavaScript/TypeScript, the [Spydk](https://www.npmjs.com/package/@certusone/wormhole-spydk){target=\_blank} makes setting up a client easier.
16
+
The messages available over gossip are things like:
65
17
66
-
## See Also
18
+
-[Verifiable Action Approvals (VAAs)](/learn/infrastructure/vaas/){target=\_blank} - packets of cross-chain data. A Spy can see whether a VAA has been approved by the Guardian Network
19
+
-[Observations](/learn/glossary/#observation){target=\_blank} - messages emitted by Core Contracts that the Guardians have picked up
20
+
-[Guardian heartbeats](/learn/glossary/#heartbeat){target=\_blank} - the liveness of a Guardian
67
21
68
-
The [Pyth Beacon](https://github.com/pyth-network/beacon){target=\_blank} provides an alternate Spy implementation that is highly available for improved performance and reliability.
22
+
## Source Code
69
23
70
-
The [relayer engine](https://github.com/wormhole-foundation/relayer-engine){target=\_blank} implements a client and persistence layer for messages received from a Spy subscription.
24
+
The source code for the Spy is available on [GitHub](https://github.com/wormhole-foundation/wormhole/blob/main/node/cmd/spy/spy.go){target=\_blank}.
0 commit comments