-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.base.yml
317 lines (302 loc) · 7.7 KB
/
docker-compose.base.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
version: "3.9"
x-credentials: &postgres-config
POSTGRES_HOSTNAME: database
POSTGRES_PORT: "5432"
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
POSTGRES_MIGRATION_FOLDER: /usr/local/bin/migrations/
services:
hardhat:
image: cartesi/rollups-hardhat:0.8.2
command:
[
"node",
"--network",
"hardhat",
"--export",
"/opt/cartesi/share/blockchain/localhost.json",
]
init: true
ports:
- "8545:8545"
healthcheck:
test:
["CMD", "test", "-f", "/opt/cartesi/share/blockchain/localhost.json"]
interval: 30s
timeout: 30s
retries: 5
volumes:
- blockchain-data:/opt/cartesi/share/blockchain
- ./deployments:/app/rollups/deployments
rollups_dispatcher:
image: cartesi/rollups-dispatcher:0.8.2
command:
[
"--rd-dapp-contract-address-file",
"/deployments/localhost/dapp.json",
"--rd-initial-epoch",
"0",
"--sc-grpc-endpoint",
"http://state_server:50051",
"--sc-default-confirmations",
"1",
"--tx-provider-http-endpoint",
"http://hardhat:8545",
"--tx-mnemonic",
"test test test test test test test test test test test junk",
"--tx-chain-id",
"31337",
"--tx-chain-is-legacy",
"${TX_LEGACY:-false}",
"--tx-default-confirmations",
"2",
"--redis-endpoint",
"redis://redis:6379",
]
restart: always
depends_on:
hardhat:
condition: service_healthy
hardhat_set_interval:
condition: service_completed_successfully
state_server:
condition: service_healthy
redis:
condition: service_healthy
environment:
RUST_LOG: info
volumes:
- blockchain-data:/opt/cartesi/share/blockchain:ro
- ./deployments:/deployments
state_server:
image: cartesi/rollups-state-server:0.8.2
command: [
"--sf-genesis-block",
"0x1",
"--sf-safety-margin",
"1",
"--bh-http-endpoint",
"http://hardhat:8545",
"--bh-ws-endpoint",
"ws://hardhat:8545",
"--bh-block-timeout",
"8", # just a few seconds more than the configured automatic interval mining
]
restart: always
healthcheck:
test: ["CMD", "grpc-health-probe", "-addr=:50051"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
hardhat:
condition: service_healthy
volumes:
- blockchain-data:/opt/cartesi/share/blockchain:ro
environment:
RUST_LOG: info
server_manager_broker_proxy:
image: cartesi/rollups-server-manager-broker-proxy:0.8.2
command:
[
"--chain-id",
"31337",
"--dapp-contract-address-file",
"/deployments/localhost/dapp.json",
"--redis-endpoint",
"redis://redis:6379",
"--server-manager-endpoint",
"http://server_manager:5001",
"--session-id",
"default_rollups_id",
]
restart: always
healthcheck:
test: ["CMD", "curl", "--fail", "localhost:8080/healthz"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
redis:
condition: service_healthy
server_manager:
condition: service_healthy
deployer:
condition: service_completed_successfully
volumes:
- ./deployments:/deployments
environment:
RUST_LOG: info
server_manager:
restart: always
ports:
- "5001:5001"
healthcheck:
test: ["CMD", "grpc-health-probe", "-addr=:5001"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- machine:/opt/cartesi/share/dapp-bin
environment:
- SERVER_MANAGER_LOG_LEVEL=warning
- REMOTE_CARTESI_MACHINE_LOG_LEVEL=info
deployer:
image: cartesi/rollups-cli:0.8.2
restart: on-failure
depends_on:
hardhat:
condition: service_healthy
server_manager:
condition: service_healthy
command:
[
"create",
"--rpc",
"http://hardhat:8545",
"--deploymentFile",
"/opt/cartesi/share/blockchain/localhost.json",
"--mnemonic",
"test test test test test test test test test test test junk",
"--templateHashFile",
"/opt/cartesi/share/dapp-bin/hash",
"--outputFile",
"/deployments/localhost/dapp.json",
# epoch - default 1 day
"--inputDuration",
"30",
# challenge - default 7 days
"--challengePeriod",
"30",
]
volumes:
- blockchain-data:/opt/cartesi/share/blockchain
- machine:/opt/cartesi/share/dapp-bin:ro
- ./deployments:/deployments
hardhat_stop_automine:
image: curlimages/curl:7.84.0
restart: on-failure
depends_on:
hardhat:
condition: service_healthy
deployer:
condition: service_completed_successfully
command:
[
"--data",
'{"id":1337,"jsonrpc":"2.0","method":"evm_setAutomine","params":[false]}',
"http://hardhat:8545",
]
hardhat_set_interval:
image: curlimages/curl:7.84.0
restart: on-failure
depends_on:
hardhat:
condition: service_healthy
hardhat_stop_automine:
condition: service_completed_successfully
command:
[
"--data",
'{"id":1337,"jsonrpc":"2.0","method":"evm_setIntervalMining","params":[5000]}',
"http://hardhat:8545",
]
rollups_inspect_server:
image: cartesi/rollups-inspect-server:0.8.2
command:
[
"--inspect-server-address",
"0.0.0.0:5005",
"--server-manager-address",
"server_manager:5001",
"--session-id",
"default_rollups_id",
]
restart: always
ports:
- "5005:5005"
depends_on:
server_manager:
condition: service_healthy
environment:
RUST_LOG: info
rollups_indexer:
image: cartesi/rollups-indexer:0.8.2
command:
[
"--dapp-contract-address-file",
"/deployments/localhost/dapp.json",
"--session-id",
"default_rollups_id",
"--initial-epoch",
"0",
"--interval",
"10",
"--confirmations",
"1",
"--state-server-endpoint",
"http://state_server:50051",
"--mm-endpoint",
"http://server_manager:5001",
]
restart: always
depends_on:
hardhat:
condition: service_healthy
hardhat_set_interval:
condition: service_completed_successfully
state_server:
condition: service_healthy
server_manager:
condition: service_healthy
database:
condition: service_healthy
environment:
<<: *postgres-config
RUST_LOG: info
volumes:
- blockchain-data:/opt/cartesi/share/blockchain
- ./deployments:/deployments
query_server:
image: cartesi/query-server:0.8.2
ports:
- "4000:4000"
depends_on:
database:
condition: service_healthy
environment:
RUST_LOG: info
GRAPHQL_HOST: "0.0.0.0"
GRAPHQL_PORT: "4000"
<<: *postgres-config
database:
image: postgres:13-alpine
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=password
volumes:
- database-data:/var/lib/postgresql/data
redis:
image: redis:6-alpine
ports:
- 6379:6379
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- redis-data:/data
volumes:
blockchain-data: {}
machine: {}
database-data: {}
redis-data: {}