Skip to content

Commit 366e9f5

Browse files
Ilaria EnacheIlaria Enache
Ilaria Enache
authored and
Ilaria Enache
committed
grammarly check
1 parent fe09348 commit 366e9f5

File tree

1 file changed

+54
-3
lines changed

1 file changed

+54
-3
lines changed

learn/infrastructure/spy.md

+54-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ description:
1414

1515
# SPY
1616

17-
A Spy, in the wormhole context, is a daemon that subscribes to the gossiped messages in the Guardian Network.
17+
In the wormhole context, a _spy_ is a daemon that subscribes to the gossiped messages in the Guardian Network.
1818

19-
The messages available on over gossip are things like
19+
The messages available over gossip are things like
2020

2121
- [VAAs](#){target=\_blank} <!-- link to VAAs page -->
2222
- [Observations](#){target=\_blank} <!-- link to glossary -->
@@ -25,4 +25,55 @@ The messages available on over gossip are things like
2525
The source for the Spy is available on [Github](https://github.com/wormhole-foundation/wormhole/blob/main/node/cmd/spy/spy.go){target=\_blank}
2626

2727
!!! note
28-
The Spy has no persistence layer built in, so typically its paired with something like Redis or a SQL database to record relevant messages
28+
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
29+
30+
## Use
31+
32+
To start a Spy locally, run the following docker command.
33+
34+
=== "Testnet"
35+
36+
```sh
37+
docker run --platform=linux/amd64 \
38+
-p 7073:7073 \
39+
--entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest \
40+
spy \
41+
--nodeKey /node.key \
42+
--spyRPC "[::]:7073" \
43+
--env testnet
44+
```
45+
Optionally, add the flags to skip any VAAs with invalid signatures
46+
```sh
47+
--ethRPC https://sepolia.drpc.org/
48+
--ethContract 0x4a8bc80Ed5a4067f1CCf107057b8270E0cC11A78
49+
```
50+
51+
=== "Mainnet"
52+
53+
```sh
54+
docker run --platform=linux/amd64 \
55+
-p 7073:7073 \
56+
--entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest \
57+
spy \
58+
--nodeKey /node.key \
59+
--spyRPC "[::]:7073" \
60+
--env mainnet
61+
```
62+
Optionally, add the flags to skip any VAAs with invalid signatures
63+
```sh
64+
--ethRPC https://eth.drpc.org
65+
--ethContract 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
66+
```
67+
68+
Once running, a [gRPC](https://grpc.io/){target=\_blank} client (i.e. your program) can subscribe to a filtered stream of messages.
69+
70+
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}.
71+
72+
!!! note
73+
If using JavaScript/TypeScript, the [Spydk](https://www.npmjs.com/package/@certusone/wormhole-spydk){target=\_blank} makes setting up a client easier.
74+
75+
## See Also
76+
77+
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.
78+
79+
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.

0 commit comments

Comments
 (0)