-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
227 lines (208 loc) · 5.87 KB
/
docker-compose.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
name: 'evm-devnet'
secrets:
jwtsecret:
file: ./jwtsecret
configs:
chainweb-node:
file: ./chainweb-node.yaml
chainweb-chain0-spec:
file: ./chainweb-chain0-spec.json
chainweb-chain1-spec:
file: ./chainweb-chain1-spec.json
volumes:
chainweb-node_data:
chainweb-evm-chain0_data:
chainweb-evm-chain1_data:
logs:
prometheus_data:
grafana_data:
services:
# ########################################################################## #
# Chainweb Node
#
# This devnet has only single peer node. So, no need for boostrapping, p2p
# netnworking, etc.
chainweb-node:
container_name: chainweb-node
labels:
com.docker.lb.ip_hash: true
com.chainweb.devnet.description: "EVM Devnet Chainweb Node"
com.chainweb.devnet.chainweb-node: ""
image: ${CHAINWEB_NODE_IMAGE:-ghcr.io/kadena-io/evm-devnet-chainweb-node:latest}
restart: unless-stopped
stop_grace_period: 20s
stop_signal: SIGINT
ulimits:
nofile:
soft: 65535
hard: 65535
expose:
- "1789"
- "1848"
volumes:
- chainweb-node_data:/chainweb/db:rw
configs:
- source: chainweb-node
target: /chainweb/config/chainweb-node.yaml
mode: 0440
depends_on:
chainweb-evm-chain0:
condition: service_started
chainweb-evm-chain1:
condition: service_started
ports:
- "1848:1848"
entrypoint:
- /chainweb/chainweb-node
# Runtime Settings
- +RTS
- -T
- -H400M
- -A64M
- -RTS
- --config-file=config/chainweb-node.yaml
- --database-directory=/chainweb/db
command:
# Common Configuration
- --disable-pow
- --bootstrap-reachability=0
- --p2p-hostname=0.0.0.0
- --cluster-id=chainweb-node
- --enable-mining-coordination
- --chain-0-uri=http://chainweb-evm-chain0:8551/
- --chain-1-uri=http://chainweb-evm-chain1:8551/
environment:
- DISABLE_POW_VALIDATION
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 60s
order: stop-first
healthcheck:
test:
- 'CMD'
- '/bin/bash'
- '-c'
- 'exec 3<>/dev/tcp/localhost/1848; printf "GET /health-check HTTP/1.1\r\nhost: http://localhost:1848\r\nConnection: close\r\n\r\n" >&3; grep -q "200 OK" <&3 || exit 1'
interval: 30s
timeout: 30s
retries: 5
start_period: 2m
chainweb-evm-chain0:
container_name: chainweb-evm-chain0
hostname: chainweb-evm-chain0
extends:
file: ./reth-common.yaml
service: reth-common
configs:
- source: chainweb-chain0-spec
target: /config/chainweb-chain0-spec.json
mode: 0440
volumes:
- chainweb-evm-chain0_data:/root/.local/share/reth/1789/
command:
- --chain=/config/chainweb-chain0-spec.json
ports:
- "8545:8545"
- "8546:8546"
environment:
CHAINWEB_CHAIN_ID: 0
chainweb-evm-chain1:
container_name: chainweb-evm-chain1
hostname: chainweb-evm-chain1
extends:
file: ./reth-common.yaml
service: reth-common
configs:
- source: chainweb-chain1-spec
target: /config/chainweb-chain1-spec.json
mode: 0440
volumes:
- chainweb-evm-chain1_data:/root/.local/share/reth/1790/
command:
- --chain=/config/chainweb-chain1-spec.json
ports:
- "8555:8545"
- "8556:8546"
environment:
CHAINWEB_CHAIN_ID: 1
chainweb-miner:
container_name: chainweb-miner
image: "${MINING_CLIENT_IMAGE:-ghcr.io/kadena-io/chainweb-mining-client:latest}"
platform: linux/amd64
restart: unless-stopped
depends_on:
chainweb-node:
condition: service_healthy
entrypoint: "/chainweb-mining-client/chainweb-mining-client"
command:
- --node=chainweb-node:1848
# possible values are "constant-delay", "simulation", and "on-demand"
# It is also possible to run two miner containers using different worker
# type, for instance "simulation" and "on-demand".
- --worker=${MINING_WORKER:-constant-delay}
- --thread-count=2
- --no-tls
# --only used when worker is set to "simulation"
- --hash-rate=1000000
# only used when worker is set to "constant-delay"
- --constant-delay-block-time=${BLOCK_RATE:-2}
# only used when worker is set to "on-demand"
- --on-demand-port=1917
ports:
- "1917:1917"
# ########################################################################## #
# Genesis Allocations
allocations:
image: ${ALLOCATIONS_IMAGE:-ghcr.io/kadena-io/evm-devnet-allocations:latest}
build:
context: ../allocations
dockerfile: Dockerfile
depends_on:
- chainweb-evm-chain0
environment:
RPC_URL: http://chainweb-evm-chain0:8545
# ########################################################################## #
# Debugging Utils
curl:
labels:
com.chainweb.devnet.description: "Curl Into Network"
com.chainweb.devnet.debug: ""
image: curlimages/curl:latest
profiles: ["debug"]
# example usages
#
# Get info at block height:
# > docker compose run --rm -e 'HEIGHT=92094' debug | jq '.headers."1"' | jqp
#
# Scan block from block height for receipts:
# > docker compose run --rm debug -c "source ./functions.sh; list_receipts_from_height 1 90000"
#
debug:
build:
context: ./debug
dockerfile: Dockerfile
profiles: ["debug"]
entrypoint:
- /bin/bash
- -c
environment:
HEIGHT: ${HEIGHT:-latest}
command:
- |
source ./functions.sh
info $$HEIGHT
nginx:
container_name: chainweb-evm-nginx
image: nginx:alpine
ports:
- 8888:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- chainweb-evm-chain0
- chainweb-evm-chain1