Skip to content

Commit ff17e9a

Browse files
authored
Merge pull request #514 from EspressoSystems/ak/integrate
Timeboost Integration via Docker Compose
2 parents 6bd7cb4 + 4f2f8d2 commit ff17e9a

File tree

20 files changed

+888
-485
lines changed

20 files changed

+888
-485
lines changed

docker-compose.yml

Lines changed: 124 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,239 @@
11
services:
2+
demo-l1-network:
3+
image: ghcr.io/espressosystems/geth-l1:main
4+
command: --dev --dev.period=1
5+
ports:
6+
- 8545:8545
7+
- 8546:8546
8+
volumes:
9+
- "./geth-config/genesis-default.json:/genesis.json"
10+
- "./geth-config/test-jwt-secret.txt:/config/test-jwt-secret.txt"
11+
networks:
12+
timeboost:
13+
ipv4_address: 172.20.0.11
14+
healthcheck:
15+
test: ["CMD", "curl", "-s", "-X", "POST", "--data", '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}', "-H", "Content-Type: application/json", "http://localhost:8545"]
16+
interval: 5s
17+
timeout: 3s
18+
retries: 10
19+
deploy-contract:
20+
image: timeboost:latest
21+
environment:
22+
- RUST_LOG=debug
23+
entrypoint: ["/app/deploy-contract-docker"]
24+
depends_on:
25+
demo-l1-network:
26+
condition: service_healthy
27+
networks:
28+
- timeboost
229
node0:
330
image: timeboost:latest
431
command:
532
[
633
"/app/timeboost",
734
"--committee-id", "0",
835
"--config", "node_0.toml",
36+
"--https-only", "false",
937
]
1038
networks:
1139
timeboost:
1240
ipv4_address: 172.20.0.2
1341
environment:
14-
- RUST_LOG=timeboost=info,sailfish=info,cliquenet=info
15-
- TIMEBOOST_SAILFISH_PORT=8000
16-
- TIMEBOOST_DECRYPT_PORT=8001
17-
- TIMEBOOST_CERTIFIER_PORT=8002
18-
- TIMEBOOST_RPC_PORT=8800
19-
- TIMEBOOST_METRICS_PORT=9000
42+
- RUST_LOG=timeboost=info,sailfish=warn,cliquenet=warn,timeboost-builder=debug,robusta=info,block_checker=info
2043
ports:
2144
- "8000:8000"
2245
- "8030:8001"
2346
- "8060:8002"
47+
- "8080:8003"
48+
- "8100:8004"
2449
- "8800:8800"
2550
- "9000:9000"
2651
depends_on:
27-
nitro-dev:
28-
condition: service_healthy
52+
deploy-contract:
53+
condition: service_completed_successfully
2954
node1:
3055
image: timeboost:latest
3156
command:
3257
[
3358
"/app/timeboost",
3459
"--committee-id", "0",
3560
"--config", "node_1.toml",
61+
"--https-only", "false",
3662
]
3763
networks:
3864
timeboost:
3965
ipv4_address: 172.20.0.3
4066
environment:
41-
- RUST_LOG=timeboost=info,sailfish=info,cliquenet=info
42-
- TIMEBOOST_SAILFISH_PORT=8000
43-
- TIMEBOOST_DECRYPT_PORT=8001
44-
- TIMEBOOST_CERTIFIER_PORT=8002
45-
- TIMEBOOST_RPC_PORT=8800
46-
- TIMEBOOST_METRICS_PORT=9000
67+
- RUST_LOG=timeboost=info,sailfish=warn,cliquenet=warn,timeboost-builder=debug,robusta=info,block_checker=info
4768
ports:
4869
- "8001:8000"
4970
- "8031:8001"
5071
- "8061:8002"
72+
- "8081:8003"
73+
- "8101:8004"
5174
- "8801:8800"
5275
- "9001:9000"
5376
depends_on:
54-
nitro-dev:
55-
condition: service_healthy
77+
deploy-contract:
78+
condition: service_completed_successfully
5679
node2:
5780
image: timeboost:latest
5881
command:
5982
[
6083
"/app/timeboost",
6184
"--committee-id", "0",
6285
"--config", "node_2.toml",
86+
"--https-only", "false",
6387
]
6488
networks:
6589
timeboost:
6690
ipv4_address: 172.20.0.4
6791
environment:
68-
- RUST_LOG=timeboost=info,sailfish=info,cliquenet=info
69-
- TIMEBOOST_SAILFISH_PORT=8000
70-
- TIMEBOOST_DECRYPT_PORT=8001
71-
- TIMEBOOST_CERTIFIER_PORT=8002
72-
- TIMEBOOST_RPC_PORT=8800
73-
- TIMEBOOST_METRICS_PORT=9000
92+
- RUST_LOG=timeboost=info,sailfish=warn,cliquenet=warn,timeboost-builder=debug,robusta=info,block_checker=info
7493
ports:
7594
- "8002:8000"
7695
- "8032:8001"
7796
- "8062:8002"
97+
- "8082:8003"
98+
- "8102:8004"
7899
- "8802:8800"
79100
- "9002:9000"
80101
depends_on:
81-
nitro-dev:
82-
condition: service_healthy
102+
deploy-contract:
103+
condition: service_completed_successfully
83104
node3:
84105
image: timeboost:latest
85106
command:
86107
[
87108
"/app/timeboost",
88109
"--committee-id", "0",
89110
"--config", "node_3.toml",
111+
"--https-only", "false",
90112
]
91113
networks:
92114
timeboost:
93115
ipv4_address: 172.20.0.5
94116
environment:
95-
- RUST_LOG=timeboost=info,sailfish=info,cliquenet=info
96-
- TIMEBOOST_SAILFISH_PORT=8000
97-
- TIMEBOOST_DECRYPT_PORT=8001
98-
- TIMEBOOST_CERTIFIER_PORT=8002
99-
- TIMEBOOST_RPC_PORT=8800
100-
- TIMEBOOST_METRICS_PORT=9000
117+
- RUST_LOG=timeboost=info,sailfish=warn,cliquenet=warn,timeboost-builder=debug,robusta=info,block_checker=info
101118
ports:
102119
- "8003:8000"
103120
- "8033:8001"
104121
- "8063:8002"
122+
- "8083:8003"
123+
- "8103:8004"
105124
- "8803:8800"
106125
- "9003:9000"
107126
depends_on:
108-
nitro-dev:
109-
condition: service_healthy
127+
deploy-contract:
128+
condition: service_completed_successfully
110129
node4:
111130
image: timeboost:latest
112131
command:
113132
[
114133
"/app/timeboost",
115134
"--committee-id", "0",
116135
"--config", "node_4.toml",
136+
"--https-only", "false",
117137
]
118138
networks:
119139
timeboost:
120140
ipv4_address: 172.20.0.6
121141
environment:
122-
- RUST_LOG=timeboost=info,sailfish=info,cliquenet=info
123-
- TIMEBOOST_SAILFISH_PORT=8000
124-
- TIMEBOOST_DECRYPT_PORT=8001
125-
- TIMEBOOST_CERTIFIER_PORT=8002
126-
- TIMEBOOST_RPC_PORT=8800
127-
- TIMEBOOST_METRICS_PORT=9000
142+
- RUST_LOG=timeboost=info,sailfish=warn,cliquenet=warn,timeboost-builder=warn,robusta=info,block_checker=info
128143
ports:
129144
- "8004:8000"
130145
- "8034:8001"
131146
- "8064:8002"
147+
- "8084:8003"
148+
- "8104:8004"
132149
- "8804:8800"
133150
- "9004:9000"
134151
depends_on:
135-
nitro-dev:
136-
condition: service_healthy
137-
nitro-dev:
138-
image: offchainlabs/nitro-node:v3.2.1-d81324d
152+
deploy-contract:
153+
condition: service_completed_successfully
154+
block-maker:
155+
image: timeboost:latest
139156
ports:
140-
- "8547:8547"
157+
- "55000:55000"
158+
command:
159+
[
160+
"/app/block-maker",
161+
"--port", "55000",
162+
"--committee", "committee.toml",
163+
]
164+
environment:
165+
- RUST_LOG=info
141166
networks:
142167
timeboost:
143168
ipv4_address: 172.20.0.12
144-
command: --dev --http.addr 0.0.0.0 --http.api=net,web3,eth,debug
145-
healthcheck:
146-
test: ["CMD", "curl", "-s", "-X", "POST", "--data", '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}', "-H", "Content-Type: application/json", "http://localhost:8547"]
147-
interval: 5s
148-
timeout: 3s
149-
retries: 10
169+
block-checker:
170+
image: timeboost:latest
171+
command:
172+
[
173+
"/app/block-checker",
174+
"--config", "node_0.toml",
175+
"--committee", "committee.toml",
176+
"--committee-id", "0",
177+
"--blocks", "10000",
178+
"--https-only", "false",
179+
]
180+
environment:
181+
- RUST_BACKTRACE=1
182+
- RUST_LOG=trace
183+
networks:
184+
timeboost:
185+
ipv4_address: 172.20.0.15
186+
depends_on:
187+
deploy-contract:
188+
condition: service_completed_successfully
150189
yapper:
151-
image: yapper:latest
190+
image: timeboost:latest
152191
command:
153192
[
154193
"/app/yapper",
155-
"--tps",
156-
"1",
157-
"--keyset-file",
158-
"committee.json",
194+
"--keyset-file", "committee.toml",
159195
]
196+
environment:
197+
- RUST_LOG=info
160198
networks:
161199
timeboost:
162200
ipv4_address: 172.20.0.13
163-
201+
espresso-dev-node:
202+
pid: host
203+
image: ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:latest
204+
ports:
205+
- "41000:41000"
206+
- "41003:41003"
207+
- "20000:20000"
208+
environment:
209+
- ESPRESSO_BUILDER_PORT=41003
210+
- ESPRESSO_DEPLOYER_ACCOUNT_INDEX=5
211+
- ESPRESSO_DEV_NODE_PORT=20000
212+
- ESPRESSO_SEQUENCER_API_PORT=41000
213+
- ESPRESSO_SEQUENCER_ETH_MNEMONIC=indoor dish desk flag debris potato excuse depart ticket judge file exit
214+
- ESPRESSO_SEQUENCER_L1_PROVIDER=http://172.20.0.11:8545
215+
- ESPRESSO_SEQUENCER_DATABASE_MAX_CONNECTIONS=25
216+
- ESPRESSO_DEV_NODE_EPOCH_HEIGHT=1000000
217+
- ESPRESSO_DEV_NODE_MAX_BLOCK_SIZE=10485760
218+
- ESPRESSO_SEQUENCER_STORAGE_PATH=/data/espresso
219+
- RUST_LOG=INFO
220+
- RUST_LOG_FORMAT
221+
- ESPRESSO_DEV_NODE_VERSION=0.4
222+
volumes:
223+
- espresso_storage:/data/espresso
224+
depends_on:
225+
demo-l1-network:
226+
condition: service_healthy
227+
networks:
228+
timeboost:
229+
ipv4_address: 172.20.0.14
164230
networks:
165231
timeboost:
166232
driver: bridge
167233
ipam:
168234
driver: default
169235
config:
170236
- subnet: 172.20.0.0/16
237+
238+
volumes:
239+
espresso_storage:

docker/timeboost.Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV PATH="/root/.foundry/bin:${PATH}"
1111
RUN forge --version
1212
RUN rustup component add rustfmt --toolchain nightly
1313

14-
RUN cargo build --release --bin timeboost
14+
RUN cargo build --release --bins
1515

1616
# Non-root app container stage
1717
FROM debian:bookworm-slim
@@ -25,10 +25,22 @@ RUN groupadd -r appgroup && useradd -r -g appgroup timeboostuser
2525

2626
# Copy binary
2727
COPY --from=builder /app/target/release/timeboost .
28+
COPY --from=builder /app/target/release/yapper .
29+
COPY --from=builder /app/target/release/register .
30+
COPY --from=builder /app/target/release/deploy .
31+
COPY --from=builder /app/target/release/block-maker .
32+
COPY --from=builder /app/target/release/block-checker .
33+
COPY --from=builder /app/scripts/deploy-contract-docker .
34+
2835
COPY --from=builder /app/test-configs/docker .
2936

37+
# Copy Foundry binaries from builder
38+
COPY --from=builder /root/.foundry/bin/forge /usr/local/bin/forge
39+
COPY --from=builder /root/.foundry/bin/cast /usr/local/bin/cast
40+
RUN chmod +x /usr/local/bin/forge /usr/local/bin/cast
41+
3042
# Set ownership of application files and make binary executable
31-
RUN chown -R timeboostuser:appgroup /app && chmod +x /app/timeboost
43+
RUN chown -R timeboostuser:appgroup /app && chmod +x /app/timeboost /app/yapper /app/register /app/deploy /app/deploy-contract-docker /app/block-maker /app/block-checker
3244

3345
# Switch to non-root user
3446
USER timeboostuser

docker/yapper.Dockerfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)