Skip to content

Commit fda3d4f

Browse files
authored
remove duplicate spy content and reformat (#39)
* remove duplicate spy content and reformat * grammar * reorder sections
1 parent 752d053 commit fda3d4f

File tree

3 files changed

+38
-72
lines changed

3 files changed

+38
-72
lines changed

.pages

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ nav:
22
- index.md
33
- build
44
- infrastructure
5-
- learn
6-
- infrastructure
75
- tutorials
6+
- learn

infrastructure/spy/run-spy.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ description: Learn how to run a Spy locally to listen for and forward messages (
77

88
## Introduction
99

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.
1111

1212
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}.
1313

1414
## How to Start a Spy
1515

1616
To start a Spy locally, run the following Docker command:
1717

18-
=== "TestNet"
18+
=== "MainNet"
1919

2020
```sh
2121
docker run --platform=linux/amd64 \
@@ -24,16 +24,10 @@ To start a Spy locally, run the following Docker command:
2424
spy \
2525
--nodeKey /node.key \
2626
--spyRPC "[::]:7073" \
27-
--env testnet
28-
```
29-
Optionally, add the following flags to skip any VAAs with invalid signatures:
30-
```sh
31-
--ethRPC https://sepolia.drpc.org/
32-
--ethContract 0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78
27+
--env mainnet
3328
```
3429

35-
36-
=== "MainNet"
30+
=== "TestNet"
3731

3832
```sh
3933
docker run --platform=linux/amd64 \
@@ -42,23 +36,42 @@ To start a Spy locally, run the following Docker command:
4236
spy \
4337
--nodeKey /node.key \
4438
--spyRPC "[::]:7073" \
45-
--env mainnet
39+
--env testnet
4640
```
47-
Optionally, add the following flags to skip any VAAs with invalid signatures:
41+
42+
Optionally, add the following flags to skip any VAAs with invalid signatures:
43+
44+
=== "MainNet"
45+
4846
```sh
4947
--ethRPC https://eth.drpc.org
5048
--ethContract 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
5149
```
5250

53-
Once running, a [gRPC](https://grpc.io/){target=\_blank} client (i.e., your program) can subscribe to a filtered stream of messages.
51+
=== "TestNet"
52+
53+
```sh
54+
--ethRPC https://sepolia.drpc.org/
55+
--ethContract 0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78
56+
```
57+
58+
## Subscribe to Filtered VAAs
59+
60+
Once running, a [gRPC](https://grpc.io/){target=\_blank} client (i.e., your program) can subscribe to a filtered stream of messages (VAAs).
5461

5562
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.
5663

5764
!!! note
5865
If using JavaScript/TypeScript, the [Spydk](https://www.npmjs.com/package/@certusone/wormhole-spydk){target=\_blank} makes setting up a client easier.
5966

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+
6073
## See Also
6174

6275
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.
6376

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.

learn/infrastructure/spy.md

+10-56
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,20 @@ description: Discover Wormhole's Spy daemon, which subscribes to gossiped messag
55

66
# Spy
77

8-
In the Wormhole context, a _Spy_ is a daemon that subscribes to the gossiped messages in the Guardian Network.
9-
10-
The messages available over gossip are things like:
11-
12-
- [VAAs](/learn/infrastructure/vaas/){target=\_blank}
13-
- [Observations](/learn/glossary/#observation){target=\_blank}
14-
- [Guardian heartbeats](/learn/glossary/#heartbeat){target=\_blank}
15-
16-
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}.
17-
18-
!!! note
19-
The Spy has no persistence layer built in, so typically, it is paired with something like Redis or an SQL database to record relevant messages.
20-
21-
## How to Start a Spy
8+
## Introduction
229

23-
To start a Spy locally, run the following Docker command:
24-
25-
=== "TestNet"
26-
27-
```sh
28-
docker run --platform=linux/amd64 \
29-
-p 7073:7073 \
30-
--entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest \
31-
spy \
32-
--nodeKey /node.key \
33-
--spyRPC "[::]:7073" \
34-
--env testnet
35-
```
36-
Optionally, add the following flags to skip any VAAs with invalid signatures:
37-
```sh
38-
--ethRPC https://sepolia.drpc.org/
39-
--ethContract 0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78
40-
```
41-
42-
=== "MainNet"
43-
44-
```sh
45-
docker run --platform=linux/amd64 \
46-
-p 7073:7073 \
47-
--entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest \
48-
spy \
49-
--nodeKey /node.key \
50-
--spyRPC "[::]:7073" \
51-
--env mainnet
52-
```
53-
Optionally, add the following flags to skip any VAAs with invalid signatures:
54-
```sh
55-
--ethRPC https://eth.drpc.org
56-
--ethContract 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
57-
```
10+
In the Wormhole context, a _Spy_ is a daemon that subscribes to the gossiped messages in the Guardian Network.
5811

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.
6013

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
6215

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:
6517

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
6721

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
6923

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

Comments
 (0)