Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit a877576

Browse files
authored
Refactor profiles and env file
1 parent f9cf5fc commit a877576

File tree

4 files changed

+70
-10
lines changed

4 files changed

+70
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
data/
22
.DS_Store
3+
.env

sandbox/.env renamed to sandbox/.env.example

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
COMPOSE_PROFILES=wasp,monitoring,toolkit
1+
# This is an example configuration file.
2+
# Keep this file as an example and make a working file with the following command:
3+
#
4+
# cp .env.example .env
5+
#
6+
# You can edit the .env file with a command like:
7+
#
8+
# nano .env
9+
#
10+
# The .env file is your personal configuration and is used by Docker.
11+
# Uncomment and edit the lines to fit your needs
12+
13+
COMPOSE_PROFILES=wasp,monitoring,inx
214

315
# Uncomment the following line to enable the API endpoint for historical data of the legacy network.
416
# Legacy API will be available under localhost/api/core/v0
@@ -16,8 +28,8 @@ COMPOSE_PROFILES=wasp,monitoring,toolkit
1628
# If needed you can change the port of the explorer. The default port is 8081 for the explorer and 4000 for the API.
1729
# EXPLORER_PORT=8081
1830

19-
# If needed you can change the port of the toolkit. The default port is 8082.
20-
# TOOLKIT_PORT=8082
31+
# If needed you can change the port of the evm-toolkit. The default port is 8082.
32+
# EVM_TOOLKIT_PORT=8082
2133

2234
# The default port for the HTTP setup is 80. If you want to change that, uncomment the following line.
2335
# HTTP_PORT=8080

sandbox/bootstrap.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,21 @@ if [[ "$OSTYPE" != "darwin"* ]]; then
5555
chown -R 65532:65532 data
5656
fi
5757

58+
source .env
59+
echo ${COMPOSE_PROFILES}
60+
61+
# Check if compose profiles contains wasp
62+
if [[ ${COMPOSE_PROFILES} != *"wasp"* ]]; then
63+
echo "Setup done, run docker compose up -d to start the network."
64+
exit
65+
fi
66+
5867
# Bootstrap chain
5968
echo "Bootstrap chain..."
60-
docker compose --profile wasp --profile bootstrap-chain up -d && docker compose logs bootstrap-chain -f && docker compose logs fund-chain-account -f
69+
docker compose --profile wasp-node --profile inx-indexer --profile bootstrap-chain up -d && docker compose logs bootstrap-chain -f && docker compose logs fund-chain-account -f
6170
echo "Configuring toolkit..."
6271
chain_address=$(jq -r '.chains."glass-chain"' data/sandboxdb/wasp-cli/config.json)
63-
source .env
6472
sed -e "s/<httpPort>/${HTTP_PORT:-80}/g" -e "s/<chainAddress>/$chain_address/g" assets/evm-toolkit/networks.json > data/sandboxdb/evm-toolkit/networks.json
6573
echo "Bootstraping and funding chain done. Cleaning up..."
66-
docker compose --profile wasp --profile bootstrap-chain down
74+
docker compose --profile wasp-node --profile inx-indexer --profile bootstrap-chain down
6775
echo "Cleanup done, run docker compose up -d to start the network."

sandbox/docker-compose.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ services:
140140

141141
mongodb-exporter:
142142
image: percona/mongodb_exporter:0.34
143-
profiles:
144-
- metrics
145143
depends_on:
146144
- mongo
147145
container_name: mongodb-exporter
@@ -154,6 +152,8 @@ services:
154152
- "--log.level=info"
155153
- "--discovering-mode"
156154
- "--collect-all"
155+
profiles:
156+
- chronicle
157157

158158
##################################################################
159159
# INX Extensions #
@@ -175,6 +175,13 @@ services:
175175
- "--restAPI.bindAddress=inx-indexer:9091"
176176
- "--prometheus.enabled=true"
177177
- "--prometheus.bindAddress=inx-indexer:9312"
178+
profiles:
179+
- inx
180+
- inx-indexer
181+
# faucet, spammer and wasp depend on indexer
182+
- inx-faucet
183+
- inx-spammer
184+
- wasp
178185

179186
inx-mqtt:
180187
container_name: inx-mqtt
@@ -189,6 +196,10 @@ services:
189196
- "--mqtt.websocket.bindAddress=inx-mqtt:1888"
190197
- "--prometheus.enabled=true"
191198
- "--prometheus.bindAddress=inx-mqtt:9312"
199+
profiles:
200+
- inx
201+
- inx-mqtt
202+
- explorer
192203

193204
inx-participation:
194205
container_name: inx-participation
@@ -207,6 +218,9 @@ services:
207218
command:
208219
- "--inx.address=hornet:9029"
209220
- "--restAPI.bindAddress=inx-participation:9892"
221+
profiles:
222+
- inx
223+
- inx-participation
210224

211225
inx-spammer:
212226
container_name: inx-spammer
@@ -225,6 +239,9 @@ services:
225239
- "--restAPI.bindAddress=inx-spammer:9092"
226240
- "--prometheus.enabled=true"
227241
- "--prometheus.bindAddress=inx-spammer:9312"
242+
profiles:
243+
- inx
244+
- inx-spammer
228245

229246
inx-poi:
230247
container_name: inx-poi
@@ -237,6 +254,9 @@ services:
237254
command:
238255
- "--inx.address=hornet:9029"
239256
- "--restAPI.bindAddress=inx-poi:9687"
257+
profiles:
258+
- inx
259+
- inx-poi
240260

241261
inx-dashboard:
242262
container_name: inx-dashboard
@@ -262,6 +282,9 @@ services:
262282
- "--dashboard.auth.passwordSalt=11ed024b8f74191c8484579db15623435c994ae4c28d9ad1b2ad8c1807bf7469"
263283
- "--prometheus.enabled=true"
264284
- "--prometheus.bindAddress=inx-dashboard:9312"
285+
profiles:
286+
- inx
287+
- inx-dashboard
265288

266289
inx-faucet:
267290
container_name: inx-faucet
@@ -291,6 +314,10 @@ services:
291314
- "--faucet.rateLimit.enabled=false"
292315
- "--profiling.enabled=true"
293316
- "--profiling.bindAddress=inx-faucet:6060"
317+
profiles:
318+
- inx
319+
- inx-faucet
320+
- evm-toolkit
294321

295322
##################################################################
296323
# Historic Data #
@@ -375,6 +402,7 @@ services:
375402
- "--users=/app/waspdb/users.json"
376403
profiles:
377404
- wasp
405+
- wasp-node
378406

379407
wasp-dashboard:
380408
container_name: wasp-dashboard
@@ -397,6 +425,7 @@ services:
397425
- L1_API_URL=http://localhost:${HTTP_PORT:-80}
398426
profiles:
399427
- wasp
428+
- wasp-dashboard
400429

401430
##################################################################
402431
# EVM Toolkit #
@@ -411,11 +440,12 @@ services:
411440
wasp:
412441
condition: service_healthy
413442
ports:
414-
- "${TOOLKIT_PORT:-8082}:80"
443+
- "${EVM_TOOLKIT_PORT:-8082}:80"
415444
volumes:
416445
- ./data/sandboxdb/evm-toolkit/networks.json:/usr/share/nginx/html/networks.json:ro
417446
profiles:
418-
- toolkit
447+
- wasp
448+
- evm-toolkit
419449

420450
##################################################################
421451
# Chronicle #
@@ -445,6 +475,9 @@ services:
445475
- "--influxdb-url=http://influx:8086"
446476
- "--inx-url=http://hornet:9029"
447477
- "--public-route=*"
478+
profiles:
479+
- chronicle
480+
- explorer
448481

449482
mongo:
450483
image: mongo:latest
@@ -453,13 +486,19 @@ services:
453486
command: ["--quiet", "--logpath", "/dev/null"]
454487
volumes:
455488
- ./data/sandboxdb/chronicle/mongodb:/data/db
489+
profiles:
490+
- chronicle
491+
- explorer
456492

457493
influx:
458494
image: influxdb:1.8
459495
container_name: influx
460496
volumes:
461497
- ./data/sandboxdb/chronicle/influxdb:/var/lib/influxdb
462498
- ./assets/influxdb/init.iql:/docker-entrypoint-initdb.d/influx_init.iql
499+
profiles:
500+
- chronicle
501+
- explorer
463502

464503
##################################################################
465504
# Explorer #

0 commit comments

Comments
 (0)