forked from NoteGio/openrelay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-aws-stack.yml
320 lines (318 loc) · 9.78 KB
/
docker-compose-aws-stack.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
318
319
320
version: "3"
services:
ingest:
build:
context: ./
dockerfile: Dockerfile.ingest
image: openrelay/ingest
logging:
driver: awslogs
options:
awslogs-group: ingest
# awslogs-create-group: "true"
ports:
- "8080:8080"
command: ["/ingest", "${REDIS_HOST:-redis:6379}", "C22d5b2951DB72B44CFb8089bb8CD374A3c354eA"]
deploy:
mode: global
# endpoint_mode: dnsrr
placement:
constraints:
- engine.labels.enginetype == External
fillupdate:
build:
context: ./
dockerfile: Dockerfile.fillupdate
image: openrelay/fillupdate
logging:
driver: awslogs
options:
awslogs-group: fillupdate
# awslogs-create-group: "true"
command: ["/fillupdate", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://ingest", "queue://fundcheck"]
deploy:
mode: global
# endpoint_mode: dnsrr
placement:
constraints:
- engine.labels.enginetype == Internal
fundcheckrelay:
build:
context: ./
dockerfile: Dockerfile.fundcheckrelay
image: openrelay/fundcheckrelay
logging:
driver: awslogs
options:
awslogs-group: fundcheckrelay
# awslogs-create-group: "true"
command: ["/fundcheckrelay", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://fundcheck", "queue://delay1", "topic://instant-broadcast"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
delayrelay1:
build:
context: ./
dockerfile: Dockerfile.delayrelay
image: openrelay/delayrelay
logging:
driver: awslogs
options:
awslogs-group: delayrelay1
# awslogs-create-group: "true"
command: ["/delayrelay", "${REDIS_HOST:-redis:6379}", "queue://delay1", "queue://delay2", "topic://delay1trigger"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
delayrelay2:
build:
context: ./
dockerfile: Dockerfile.delayrelay
image: openrelay/delayrelay
logging:
driver: awslogs
options:
awslogs-group: delayrelay2
# awslogs-create-group: "true"
command: ["/delayrelay", "${REDIS_HOST:-redis:6379}", "queue://delay2", "queue://released", "topic://newblocks", "topic://delay1trigger"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
blockmonitor:
build:
context: ./
dockerfile: Dockerfile.blockmonitor
image: openrelay/blockmonitor
logging:
driver: awslogs
options:
awslogs-group: blockmonitor
# awslogs-create-group: "true"
command: ["./node_modules/.bin/truffle", "exec", "blockMonitor.js", "redis://${REDIS_HOST:-redis:6379}", "topic://newblocks", "--network", "main"]
environment:
ETHEREUM_URL: "${ETHEREUM_URL:-http://ethnode:8545}"
USE_FILTER_PROVIDER: "1"
deploy:
replicas: 1
placement:
constraints:
- engine.labels.enginetype == Internal
exchangemonitor:
build:
context: ./
dockerfile: Dockerfile.fillmonitor
image: openrelay/fillmonitor
logging:
driver: awslogs
options:
awslogs-group: fillmonitor
# awslogs-create-group: "true"
command: ["./node_modules/.bin/truffle", "exec", "exchangeMonitor.js", "redis://${REDIS_HOST:-redis:6379}", "queue://ordersfilled", "0xC22d5b2951DB72B44CFb8089bb8CD374A3c354eA", "--network", "main"]
environment:
ETHEREUM_URL: "${ETHEREUM_URL:-http://ethnode:8545}"
USE_FILTER_PROVIDER: "1"
deploy:
replicas: 1
placement:
constraints:
- engine.labels.enginetype == Internal
fillindexer:
build:
context: ./
dockerfile: Dockerfile.fillindexer
image: openrelay/fillindexer
logging:
driver: awslogs
options:
awslogs-group: fillindexer
# awslogs-create-group: "true"
command: ["python", "/project/fill_indexer.py", "${REDIS_HOST:-redis:6379}", "ordersfilled"]
environment:
ORDER_TABLE_NAME: ${ORDER_TABLE_NAME:-Order}
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
simplerelay2:
build:
context: ./
dockerfile: Dockerfile.simplerelay
image: openrelay/simplerelay
logging:
driver: awslogs
options:
awslogs-group: simplerelay2
# awslogs-create-group: "true"
command: ["/simplerelay", "${REDIS_HOST:-redis:6379}", "queue://released", "queue://recheck", "topic://released-broadcast"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
fillupdate2:
build:
context: ./
dockerfile: Dockerfile.fillupdate
image: openrelay/fillupdate
logging:
driver: awslogs
options:
awslogs-group: fillupdate2
# awslogs-create-group: "true"
command: ["/fillupdate", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://recheck", "queue://recheck2"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
fundcheckrelay2:
build:
context: ./
dockerfile: Dockerfile.fundcheckrelay
image: openrelay/fundcheckrelay
logging:
driver: awslogs
options:
awslogs-group: fundcheckrelay2
# awslogs-create-group: "true"
command: ["/fundcheckrelay", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://recheck2", "queue://indexer"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
initialize:
build:
context: ./
dockerfile: Dockerfile.initialize
image: openrelay/initialize
logging:
driver: awslogs
options:
awslogs-group: initialize
# awslogs-create-group: "true"
command: ["/initialize", "${REDIS_HOST:-redis:6379}", "${ZRX_FEE:-500000000000000000}", "${RELAY_ADDRESS:-C22d5b2951DB72B44CFb8089bb8CD374A3c354eA}"]
deploy:
restart_policy:
condition: none
indexer:
build:
context: ./
dockerfile: Dockerfile.indexer
image: openrelay/indexer
logging:
driver: awslogs
options:
awslogs-group: indexer
# awslogs-create-group: "true"
command: ["python", "/project/indexer.py", "${REDIS_HOST:-redis:6379}", "indexer"]
environment:
ORDER_TABLE_NAME: ${ORDER_TABLE_NAME:-Order}
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
api:
build:
context: ./
dockerfile: Dockerfile.searchapi
image: openrelay/searchapi
logging:
driver: awslogs
options:
awslogs-group: searchapi
# awslogs-create-group: "true"
command: ["python", "/project/api.py", "${REDIS_HOST:-redis:6379}", "newblocks", "-l", "debug"]
ports:
- "8888:8888"
environment:
ORDER_TABLE_NAME: ${ORDER_TABLE_NAME:-Order}
deploy:
mode: global
# endpoint_mode: dnsrr
placement:
constraints:
- engine.labels.enginetype == External
ordercheckenqueue:
# This node uses dynamodb to continuously requeue orders to be checked
# again on an ongoing basis
build:
context: ./
dockerfile: Dockerfile.queueorders
image: openrelay/queueorders
logging:
driver: awslogs
options:
awslogs-group: queueorders
# awslogs-create-group: "true"
environment:
ORDER_TABLE_NAME: ${ORDER_TABLE_NAME:-Order}
command: ["python", "/project/queue_orders.py", "${REDIS_HOST:-redis:6379}", "continuous_recheck", "-r"]
deploy:
replicas: 1
placement:
constraints:
- engine.labels.enginetype == Internal
fillupdate_continous:
# This node makes sure filled / cancelled values are up to date. Any
# changes get forwarded to the indexer, and all orders get forwarded to the
# inverted fund checker
build:
context: ./
dockerfile: Dockerfile.fillupdate
image: openrelay/fillupdate
logging:
driver: awslogs
options:
awslogs-group: fillupdate-continuous
# awslogs-create-group: "true"
command: ["/fillupdate", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://continuous_recheck", "queue://fund_continuous_recheck", "queue://indexer"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
fundcheckrelay_continuous:
# This fund checker passes on orders that have insufficient funds to be
# removed from the index
build:
context: ./
dockerfile: Dockerfile.fundcheckrelay
image: openrelay/fundcheckrelay
logging:
driver: awslogs
options:
awslogs-group: fundcheckrelay-continuous
# awslogs-create-group: "true"
command: ["/fundcheckrelay", "${REDIS_HOST:-redis:6379}", "${ETHEREUM_URL:-http://state-haproxy:8545}", "queue://fund_continuous_recheck", "queue://unindexer", "--invert"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal
unindexer:
build:
context: ./
dockerfile: Dockerfile.indexer
image: openrelay/indexer
logging:
driver: awslogs
options:
awslogs-group: unindexer
# awslogs-create-group: "true"
environment:
ORDER_TABLE_NAME: ${ORDER_TABLE_NAME:-Order}
command: ["python", "/project/indexer.py", "${REDIS_HOST:-redis:6379}", "unindexer", "--unindex"]
deploy:
mode: global
placement:
constraints:
- engine.labels.enginetype == Internal