forked from LayerZero-Labs/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
136 lines (128 loc) · 5.06 KB
/
docker-compose.yaml
File metadata and controls
136 lines (128 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Docker compose for running E2E tests
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
services:
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# The Aptos local node
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
# TODO This node is not yet made a dependency of the tests container
# since we don't have any tests running against Aptos
network-aptos:
extends:
file: docker-compose.templates.yaml
service: aptos-node
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# EVM Network nodes, one for every hardhat network
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
network-vengaboys:
extends:
file: docker-compose.templates.yaml
service: evm-node
network-britney:
extends:
file: docker-compose.templates.yaml
service: evm-node
network-tango:
extends:
file: docker-compose.templates.yaml
service: evm-node
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# The TON local node
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
network-ton:
extends:
file: docker-compose.templates.yaml
service: ton-node
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# The HyperLiquid local fork node
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
network-hyperliquid:
build:
context: .
dockerfile: Dockerfile.hyperliquid
environment:
- FORK_URL=${RPC_URL_HYPERLIQUID_UPSTREAM:-https://rpc.hyperliquid.xyz/evm}
- HOST=0.0.0.0
- PORT=8545
- FOUNDRY_DISABLE_NIGHTLY_WARNING=1
ports:
- "8546:8545"
healthcheck:
test: ["CMD", "sh", "-c", "curl -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_chainId\",\"params\":[],\"id\":1}' http://localhost:8545"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
# The actual tests
#
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.
tests:
extends:
file: docker-compose.templates.yaml
service: project
depends_on:
network-vengaboys:
condition: service_healthy
network-britney:
condition: service_healthy
network-tango:
condition: service_healthy
network-ton:
condition: service_healthy
network-hyperliquid:
condition: service_healthy
logging:
driver: none
# The default containerized setup will specify the network URLs
# for the internal networks
#
# This works in conjunction with hardhat configs in the test projects.
#
# If these environment variables are not specified, the exposed networks are used
# that need to be started using docker compose up:
#
# docker compose -f docker-compose.yaml -f docker-compose.local.yaml up network-britney network-vengaboys
environment:
- NETWORK_URL_BRITNEY=http://network-britney:8545
- NETWORK_URL_VENGABOYS=http://network-vengaboys:8545
- NETWORK_URL_TANGO=http://network-tango:8545
- NETWORK_URL_TON=http://network-ton:8081/jsonRPC
- NETWORK_URL_HYPERLIQUID=http://network-hyperliquid:8546
- DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS=$DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS
# Passing environment variables that control the solana tests
- RPC_URL_SOLANA_MAINNET=${RPC_URL_SOLANA_MAINNET}
- RPC_URL_SOLANA_TESTNET=${RPC_URL_SOLANA_TESTNET}
- LZ_DEVTOOLS_ENABLE_SOLANA_TESTS=${LZ_DEVTOOLS_ENABLE_SOLANA_TESTS}
- FOUNDRY_PROFILE=${FOUNDRY_PROFILE}
- RPC_URL_HYPERLIQUID=${RPC_URL_HYPERLIQUID}
volumes:
- ./node_modules/.cache/turbo:/app/node_modules/.cache/turbo
# Hardhat has an issue with caching compilers inside a docker container,
# failing with EACCES -13 error, pointing to a permissions issue with the cache folder.
#
# The workaround is to provide an outside volume to work
# as a cache directory for hardhat so that the permissions
# don't clash
- ./.cache/hardhat:/root/.cache/hardhat-nodejs
# This is required because anchor build tries to rebuild rustup.
# We build stuff in parallel to be fast.
# This would normally be fine, but if we have more than 1 solana examples anchor tries building them in parallel.
# Anchor does not respect file locks on the rustup directory, so the builds fail as it can't overwrite the other example's rustup.
# Running rustup default before pnpm test ensures that the rustup directory is present and up to date.
command: "pnpm test"