Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit f9d747b

Browse files
authored
solana: use docker compose to host nats and beacon for solvers (#140)
Signed-off-by: bingyuyap <[email protected]>
1 parent d369fbf commit f9d747b

File tree

3 files changed

+62
-13
lines changed

3 files changed

+62
-13
lines changed

solana/Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,22 @@ lint:
8080
NETWORK=localnet $(MAKE) clippy
8181
NETWORK=testnet $(MAKE) clippy
8282

83-
.PHONY: run-spy
84-
wormhole-spy:
83+
.PHONY: wormhole-spy-up
84+
wormhole-spy-up:
8585
ifdef SPY_NETWORK_$(NETWORK)
86-
docker run \
87-
--platform=linux/amd64 \
88-
-p 7073:7073 \
89-
--entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest spy \
90-
--nodeKey /node.key \
91-
--spyRPC "[::]:7073" \
92-
--network $(SPY_NETWORK_$(NETWORK)) \
93-
--bootstrap $(SPY_BOOTSTRAP_$(NETWORK))
86+
WORMHOLE_NETWORK_ID=$(SPY_NETWORK_$(NETWORK)) \
87+
WORMHOLE_BOOTSTRAP=$(SPY_BOOTSTRAP_$(NETWORK)) \
88+
NATS_STREAM="${NETWORK}-vaas" \
89+
docker-compose -f docker-compose.yml up -d
9490
endif
9591

92+
.PHONY: wormhole-spy-down
93+
wormhole-spy-down:
94+
docker-compose -f docker-compose.yml down
95+
96+
.PHONY: wormhole-spy-restart
97+
wormhole-spy-restart: wormhole-spy-down wormhole-spy-up
98+
9699
ts/tests/artifacts:
97100
mkdir ts/tests/artifacts
98101

solana/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,28 @@ associated with the auction's `FastMarketOrder` VAA. For the `vaaAuctionRelayer`
8787
fast transfers and execute the `settle_auction_complete` instruction, add the owner's public key to the
8888
`knownAtaOwners` array field in the configuration file.
8989

90-
The `vaaAuctionRelayer` relies on the `VaaSpy` to listen for `FastMarketOrder` VAAs. To set up the
91-
`VaaSpy`, make sure Docker is running and execute the following command:
90+
The `vaaAuctionRelayer` relies on the [Beacon](https://github.com/pyth-network/beacon) as the `VaaSpy` to listen for `FastMarketOrder` VAAs. To set up the
91+
Beacon, increase the UDP buffer size for the OS:
9292

9393
```sh
94-
make wormhole-spy NETWORK=testnet
94+
# for linux
95+
sudo sysctl -w net.core.rmem_max=2097152
96+
sudo sysctl -w net.core.rmem_default=2097152
97+
# for macos
98+
sudo sysctl -w net.inet.udp.recvspace=2097152
99+
```
100+
101+
Then, make sure Docker is running and execute the following command to run Beacon in a detached mode:
102+
103+
```sh
104+
make wormhole-spy-up NETWORK=testnet
105+
```
106+
107+
To stop or restart the beacon
108+
109+
```sh
110+
make wormhole-spy-down
111+
make wormhole-spy-restart NETWORK=testnet
95112
```
96113

97114
To run the `vaaAuctionRelayer` execute the following command:

solana/docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3.7"
2+
services:
3+
nats:
4+
container_name: solana-nats-1
5+
image: nats:latest
6+
command: --jetstream
7+
ports:
8+
- "4222:4222"
9+
10+
beacon:
11+
container_name: solana-beacon-1
12+
image: public.ecr.aws/pyth-network/beacon:v1.1.3
13+
platform: linux/amd64
14+
environment:
15+
WORMHOLE_NETWORK_ID: ${WORMHOLE_NETWORK_ID}
16+
WORMHOLE_BOOTSTRAP: ${WORMHOLE_BOOTSTRAP}
17+
WORMHOLE_LISTEN_PORT: "8999"
18+
NATS_URL: "solana-nats-1:4222"
19+
NATS_STREAM: ${NATS_STREAM}
20+
SERVER_URL: "0.0.0.0:7073"
21+
LOG_LEVEL: "info"
22+
WRITER_BATCH_SIZE: "1000"
23+
ports:
24+
- "7073:7073"
25+
# required to let the container to increase UDP buffer size
26+
# without giving it full root priviledges
27+
cap_add:
28+
- "NET_ADMIN"
29+

0 commit comments

Comments
 (0)