-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
245 lines (234 loc) · 7.33 KB
/
docker-compose.yml
File metadata and controls
245 lines (234 loc) · 7.33 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
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
# Una sola máquina: demo completo Lightning Network
#
# Uso:
# docker compose up --build
# INTERACTIVE=1 docker compose run --rm -it coordinator
#
# Para el demo multi-PC (varias máquinas en red local) ver deploy/
networks:
tanda-ln-net:
driver: bridge
volumes:
bitcoind-data:
cln-coordinator-data:
cln-p0-data:
cln-p1-data:
cln-p2-data:
services:
# ── Bitcoin Core ─────────────────────────────────────────────────────────────
bitcoind:
image: lncm/bitcoind:v27.0
networks:
- tanda-ln-net
volumes:
- bitcoind-data:/data/.bitcoin
- ./config/bitcoin-docker.conf:/data/.bitcoin/bitcoin.conf:ro
ports:
- "18443:18443"
healthcheck:
test: ["CMD", "bitcoin-cli", "-datadir=/data/.bitcoin", "getblockchaininfo"]
interval: 5s
timeout: 5s
retries: 12
start_period: 10s
# ── CLN coordinator node ──────────────────────────────────────────────────────
cln-coordinator:
build:
context: .
dockerfile: Dockerfile.cln
image: cln-tanda
networks:
- tanda-ln-net
volumes:
- cln-coordinator-data:/data
- ./configs/cln-coordinator.conf:/etc/cln-coordinator.conf:ro
ports:
- "9736:9735"
- "3010:3010"
entrypoint: ["sh", "-c"]
command:
- "rm -rf /data/regtest && exec lightningd --lightning-dir=/data --conf=/etc/cln-coordinator.conf"
depends_on:
bitcoind:
condition: service_healthy
healthcheck:
test: ["CMD", "lightning-cli", "--lightning-dir=/data", "--network=regtest", "getinfo"]
interval: 5s
timeout: 10s
retries: 24
start_period: 20s
# ── CLN participant nodes ─────────────────────────────────────────────────────
cln-p0:
build:
context: .
dockerfile: Dockerfile.cln
image: cln-tanda
networks:
- tanda-ln-net
volumes:
- cln-p0-data:/data
- ./configs/cln-participant.conf:/etc/cln-participant.conf:ro
entrypoint: ["sh", "-c"]
command:
- "rm -rf /data/regtest && exec lightningd --lightning-dir=/data --conf=/etc/cln-participant.conf"
depends_on:
bitcoind:
condition: service_healthy
healthcheck:
test: ["CMD", "lightning-cli", "--lightning-dir=/data", "--network=regtest", "getinfo"]
interval: 5s
timeout: 10s
retries: 24
start_period: 20s
cln-p1:
build:
context: .
dockerfile: Dockerfile.cln
image: cln-tanda
networks:
- tanda-ln-net
volumes:
- cln-p1-data:/data
- ./configs/cln-participant.conf:/etc/cln-participant.conf:ro
entrypoint: ["sh", "-c"]
command:
- "rm -rf /data/regtest && exec lightningd --lightning-dir=/data --conf=/etc/cln-participant.conf"
depends_on:
bitcoind:
condition: service_healthy
healthcheck:
test: ["CMD", "lightning-cli", "--lightning-dir=/data", "--network=regtest", "getinfo"]
interval: 5s
timeout: 10s
retries: 24
start_period: 20s
cln-p2:
build:
context: .
dockerfile: Dockerfile.cln
image: cln-tanda
networks:
- tanda-ln-net
volumes:
- cln-p2-data:/data
- ./configs/cln-participant.conf:/etc/cln-participant.conf:ro
entrypoint: ["sh", "-c"]
command:
- "rm -rf /data/regtest && exec lightningd --lightning-dir=/data --conf=/etc/cln-participant.conf"
depends_on:
bitcoind:
condition: service_healthy
healthcheck:
test: ["CMD", "lightning-cli", "--lightning-dir=/data", "--network=regtest", "getinfo"]
interval: 5s
timeout: 10s
retries: 24
start_period: 20s
# ── Participant FastAPI servers ────────────────────────────────────────────────
participant-p0:
build: .
networks:
- tanda-ln-net
environment:
CLN_RPC_PATH: /cln-data/regtest/lightning-rpc
volumes:
- cln-p0-data:/cln-data
command: uvicorn tanda.api_participant_ln:app --host 0.0.0.0 --port 8080
depends_on:
cln-p0:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"]
interval: 5s
timeout: 10s
retries: 12
start_period: 20s
participant-p1:
build: .
networks:
- tanda-ln-net
environment:
CLN_RPC_PATH: /cln-data/regtest/lightning-rpc
volumes:
- cln-p1-data:/cln-data
command: uvicorn tanda.api_participant_ln:app --host 0.0.0.0 --port 8080
depends_on:
cln-p1:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"]
interval: 5s
timeout: 10s
retries: 12
start_period: 20s
participant-p2:
build: .
networks:
- tanda-ln-net
environment:
CLN_RPC_PATH: /cln-data/regtest/lightning-rpc
volumes:
- cln-p2-data:/cln-data
command: uvicorn tanda.api_participant_ln:app --host 0.0.0.0 --port 8080
depends_on:
cln-p2:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"]
interval: 5s
timeout: 10s
retries: 12
start_period: 20s
# ── Coordinator demo script ───────────────────────────────────────────────────
coordinator:
build: .
profiles: [coordinator]
stdin_open: true
tty: true
networks:
- tanda-ln-net
environment:
BITCOIND_RPC_URL: "http://user:password@bitcoind:18443"
CLN_COORDINATOR_RPC: /cln/coordinator/regtest/lightning-rpc
CLN_P0_RPC: /cln/p0/regtest/lightning-rpc
CLN_P1_RPC: /cln/p1/regtest/lightning-rpc
CLN_P2_RPC: /cln/p2/regtest/lightning-rpc
P0_URL: "http://participant-p0:8080"
P1_URL: "http://participant-p1:8080"
P2_URL: "http://participant-p2:8080"
P0_CLN_HOST: cln-p0
P1_CLN_HOST: cln-p1
P2_CLN_HOST: cln-p2
P0_CLN_P2P_PORT: "9735"
P1_CLN_P2P_PORT: "9735"
P2_CLN_P2P_PORT: "9735"
CONTRIBUTION_SATS: "10000"
N_CYCLES: "${N_CYCLES:-1}"
INTERACTIVE: "${INTERACTIVE:-0}"
ROUND: "${ROUND:-}"
volumes:
- cln-coordinator-data:/cln/coordinator
- cln-p0-data:/cln/p0
- cln-p1-data:/cln/p1
- cln-p2-data:/cln/p2
command: python scripts/run_coordinator_ln.py
depends_on:
bitcoind:
condition: service_healthy
cln-coordinator:
condition: service_healthy
cln-p0:
condition: service_healthy
cln-p1:
condition: service_healthy
cln-p2:
condition: service_healthy
participant-p0:
condition: service_healthy
participant-p1:
condition: service_healthy
participant-p2:
condition: service_healthy