Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
138 lines (124 loc) · 4.2 KB
/
Copy pathcompose.yaml
File metadata and controls
138 lines (124 loc) · 4.2 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
136
137
138
# Local anvil fork + public cloudflared tunnel, one profile per network.
#
# docker compose --env-file fork.env --profile hoodi up -d --wait # start
# docker compose --env-file fork.env run --rm hoodi-url # local and public URLs
# docker compose --env-file fork.env --profile hoodi logs -f # follow logs
# docker compose --env-file fork.env --profile hoodi down # stop
# docker compose --env-file fork.env ps # every running fork
#
# Every module of a network (CSM, CSM_02, CM) is already deployed in that
# network, so one fork per network serves them all — the module only decides
# which contract addresses the calls go to.
#
# The IPFS node the tests pin merkle trees to has its own profile, so it can be
# started once and left running next to any fork:
#
# docker compose --env-file fork.env --profile ipfs up -d --wait
# docker compose --env-file fork.env run --rm ipfs-url
#
# fork.env holds the ports; `export COMPOSE_ENV_FILES=fork.env` drops the flag.
# The fork URL and the test wallet come from .env.local.
#
# Profiles: mainnet, hoodi, ipfs.
# Each one also has a <profile>-url service printing its local and public URL.
# Fixed, so the containers are named the same from any checkout of the repo —
# a second worktree talks to the same forks instead of starting its own.
name: csm-widget-forks
x-anvil: &anvil
image: ghcr.io/foundry-rs/foundry:${FOUNDRY_TAG:-v1.7.1}
restart: unless-stopped
env_file:
- path: .env.local
required: false
healthcheck:
test: ['CMD', 'cast', 'block-number', '--rpc-url', 'http://127.0.0.1:8545']
interval: 2s
timeout: 10s
retries: 60
x-tunnel: &tunnel
image: cloudflare/cloudflared
restart: unless-stopped
x-url: &url
image: curlimages/curl
restart: 'no'
entrypoint: ['sh', '-c']
command:
- |
until host=$$(curl -sf "http://$$TUNNEL:2000/quicktunnel" | cut -d'"' -f4); [ -n "$$host" ]; do sleep 1; done
echo ""
echo " local: http://127.0.0.1:$$PORT"
echo " public: https://$$host"
echo ""
services:
ipfs:
image: ipfs/kubo:${KUBO_TAG:-v0.43.0}
container_name: ipfs
profiles: [ipfs]
restart: unless-stopped
ports:
- '4001:4001'
- '4001:4001/udp'
- '127.0.0.1:5001:5001'
- '127.0.0.1:8080:8080'
volumes:
- ipfs_data:/data/ipfs
- ipfs_staging:/export
healthcheck:
test: ['CMD', 'ipfs', '--api=/ip4/127.0.0.1/tcp/5001', 'id']
interval: 2s
timeout: 10s
retries: 60
# The gateway only: the API on 5001 is unauthenticated admin access to the node.
ipfs-tunnel:
<<: *tunnel
container_name: ipfs-tunnel
profiles: [ipfs]
depends_on: [ipfs]
command: tunnel --no-autoupdate --protocol http2 --metrics 0.0.0.0:2000 --url http://ipfs:8080
ipfs-url:
<<: *url
profiles: [ipfs-url]
environment:
TUNNEL: ipfs-tunnel
PORT: 8080
mainnet:
<<: *anvil
container_name: mainnet-fork
profiles: [mainnet]
ports: ['127.0.0.1:${MAINNET_PORT}:8545']
command:
- 'exec anvil --host 0.0.0.0 -f "$$EL_RPC_URLS_1" --mnemonic "$$WALLET_SECRET_PHRASE" --retries 15 --fork-retry-backoff 1000 --timeout 90000 $${ANVIL_ARGS:-}'
mainnet-tunnel:
<<: *tunnel
container_name: mainnet-tunnel
profiles: [mainnet]
depends_on: [mainnet]
command: tunnel --no-autoupdate --protocol http2 --metrics 0.0.0.0:2000 --url http://mainnet:8545
mainnet-url:
<<: *url
profiles: [mainnet-url]
environment:
TUNNEL: mainnet-tunnel
PORT: ${MAINNET_PORT}
hoodi:
<<: *anvil
container_name: hoodi-fork
profiles: [hoodi]
ports: ['127.0.0.1:${HOODI_PORT}:8545']
command:
- 'exec anvil --host 0.0.0.0 -f "$$EL_RPC_URLS_560048" --mnemonic "$$WALLET_SECRET_PHRASE" --retries 15 --fork-retry-backoff 1000 --timeout 90000 $${ANVIL_ARGS:-}'
hoodi-tunnel:
<<: *tunnel
container_name: hoodi-tunnel
profiles: [hoodi]
depends_on: [hoodi]
command: tunnel --no-autoupdate --protocol http2 --metrics 0.0.0.0:2000 --url http://hoodi:8545
hoodi-url:
<<: *url
profiles: [hoodi-url]
environment:
TUNNEL: hoodi-tunnel
PORT: ${HOODI_PORT}
volumes:
ipfs_data:
ipfs_staging: