Skip to content

Commit 21876e2

Browse files
committed
fix: address review feedback on indexer integration
Fix critical network ID capitalization bugs (preview/qanet/testnet-02), standardize on .secret file extension for all sensitive data, consolidate all services into single compose.yml with Docker Compose profiles, and remove legacy compose files as requested.
1 parent 4afe477 commit 21876e2

File tree

11 files changed

+72
-146
lines changed

11 files changed

+72
-146
lines changed

.envrc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export POSTGRES_USER="postgres"
2222

2323
# A random password is used for your safety. Docker (but not podman) exposes
2424
# ports to the internet by default. This needs to be unguessable.
25-
if [ ! -f postgres.password ]; then
26-
uuidgen | tr -d '-' | head -c 16 > postgres.password
25+
if [ ! -f postgres.secret ]; then
26+
uuidgen | tr -d '-' | head -c 16 > postgres.secret
2727
fi
28-
export POSTGRES_PASSWORD="$(cat ./postgres.password)"
28+
export POSTGRES_PASSWORD="$(cat ./postgres.secret)"
2929

3030
export POSTGRES_DB="cexplorer"
3131

@@ -37,11 +37,11 @@ export APPEND_ARGS="--allow-private-ip --pool-limit 10 --trie-cache-size 0 --pro
3737

3838
# Node Key:
3939
# Generate a unique node key for P2P networking
40-
if [ ! -f midnight-node.privatekey ]; then
40+
if [ ! -f midnight-node.secret ]; then
4141
# Generate node key using parity/subkey
42-
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm docker.io/parity/subkey:latest generate-node-key > midnight-node.privatekey
42+
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm docker.io/parity/subkey:latest generate-node-key > midnight-node.secret
4343
fi
44-
export NODE_KEY="$(cat ./midnight-node.privatekey)"
44+
export NODE_KEY="$(cat ./midnight-node.secret)"
4545

4646
# Indexer Values:
4747
if [ ! -f indexer.secret ]; then

.envrc.preview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# overrides for preview
22
export MIDNIGHT_NODE_IMAGE="ghcr.io/midnight-ntwrk/midnight-node:0.17.0-rc.4"
33
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:3.0.0-alpha.5"
4-
export INDEXER_NETWORK_ID="Preview"
4+
export INDEXER_NETWORK_ID="preview"
55

66
# Mock mode configuration
77
export MOCK_REGISTRATIONS_FILE="res/mock-bridge-data/default-registrations.json"

.envrc.qanet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# overrides for qanet
22
export MIDNIGHT_NODE_IMAGE="ghcr.io/midnight-ntwrk/midnight-node:0.12.0-rc.3"
33
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:2.1.4"
4-
export INDEXER_NETWORK_ID="QANet"
4+
export INDEXER_NETWORK_ID="qanet"
55

66
# Mock mode configuration
77
export MOCK_REGISTRATIONS_FILE="res/mock-bridge-data/qanet-mock.json"

.envrc.testnet-02

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# overrides for testnet-02
22
export MIDNIGHT_NODE_IMAGE="midnightnetwork/midnight-node:0.12.1"
33
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:2.1.4"
4-
export INDEXER_NETWORK_ID="TestNet"
4+
export INDEXER_NETWORK_ID="testnet"
55

66
# Mock mode configuration
77
export MOCK_REGISTRATIONS_FILE="res/mock-bridge-data/testnet-02-mock.json"

.github/workflows/ci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ jobs:
2727
- name: Check compose files
2828
run: |
2929
source ./.envrc
30-
docker compose -f compose.yml config -q
31-
docker compose -f compose-partner-chains.yml config -q
32-
docker compose -f proof-server.yml config -q
30+
# Test main compose file
31+
docker compose config -q
32+
# Test profiles
33+
docker compose --profile cardano config -q
34+
docker compose --profile ogmios config -q
35+
docker compose --profile proof-server config -q
36+
docker compose --profile cardano --profile ogmios --profile proof-server config -q
3337
3438
- name: Run Super-linter
3539
uses: github/super-linter@b807e99ddd37e444d189cfd2c2ca1274d8ae8ef1 #v7

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/cardano-data/*
22
/data
3-
*.privatekey
4-
*.password
53
*.secret
64
ogmios_client.log

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,41 @@ This allows for easy orchestration of the Midnight Node service.
2121

2222
4. Run `docker-compose up`
2323

24-
The `.envrc` file will automatically create a random private key and save it as `midnight-node.privatekey` and a random secret for the indexer saved as `indexer.secret`.
24+
The `.envrc` file will automatically create random secrets and save them as `postgres.secret` (database password), `midnight-node.secret` (node private key), and `indexer.secret` (indexer app secret).
2525

26-
The default `compose.yml` now includes both the Midnight Node and Indexer Standalone, providing a GraphQL API at `http://localhost:8088`.
26+
All services are defined in a single `compose.yml` file. Use Docker Compose profiles to control which services run:
2727

28-
Choose which compose files to use:
28+
**Available profiles:**
2929

30-
- `compose.yml` for Midnight Node + Indexer
31-
- `compose-partner-chains.yml` for Cardano + DB Sync
32-
- `proof-server.yml` for Local Proof Server
30+
- (no profile) - Midnight Node only
31+
- `cardano` - Adds Cardano stack (cardano-node, postgres, cardano-db-sync) and Indexer with GraphQL API at `http://localhost:8088`
32+
- `ogmios` - Adds Ogmios service at `http://localhost:1337`
33+
- `proof-server` - Adds local Proof Server at `http://localhost:6300`
3334

34-
One can use one or multiple compose files at once.
35+
**Usage examples:**
3536

36-
For example, to run the Midnight Node, you can do:
37+
Run Midnight Node only:
3738

3839
```shell
3940
docker compose up -d
4041
```
4142

42-
or to run the Midnight Node and Cardano DB Sync, you can do:
43+
Run Midnight Node + Cardano stack + Indexer:
4344

4445
```shell
45-
docker compose -f ./compose-partner-chains.yml -f ./compose.yml up -d
46+
docker compose --profile cardano up -d
4647
```
4748

48-
or to run the Midnight Node, Cardano DB Sync and a local Proof Server, you can do:
49+
Run with Cardano stack + Ogmios:
4950

5051
```shell
51-
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml up -d
52+
docker compose --profile cardano --profile ogmios up -d
53+
```
54+
55+
Run everything (Cardano + Ogmios + Proof Server):
56+
57+
```shell
58+
docker compose --profile cardano --profile ogmios --profile proof-server up -d
5259
```
5360

5461
🚀 That's it.
@@ -65,8 +72,8 @@ If you're using `midnight-node smartcontract` or `midnight-node wizards` that ne
6572
To restart from fresh, run:
6673

6774
```sh
68-
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml down -v
69-
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml kill
75+
docker compose --profile cardano --profile ogmios --profile proof-server down -v
76+
docker compose --profile cardano --profile ogmios --profile proof-server kill
7077
rm -R ./cardano-data
7178
docker volume rm midnight-node-docker_midnight-data-testnet
7279
```

compose-partner-chains.yml

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

compose.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ volumes:
1919
postgres-data: {}
2020
cardano-ipc: {}
2121
db-sync-data: {}
22+
ogmios-data: {}
2223

2324
services:
2425
postgres:
@@ -34,7 +35,7 @@ services:
3435
volumes:
3536
- postgres-data:/var/lib/postgresql/data
3637
ports:
37-
- "${POSTGRES_PORT}:5432"
38+
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
3839
healthcheck:
3940
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
4041
interval: 5s
@@ -127,3 +128,34 @@ services:
127128
condition: service_healthy
128129
volumes:
129130
- indexer-data:/data
131+
132+
cardano-ogmios:
133+
profiles: ["ogmios"]
134+
image: cardanosolutions/ogmios:v6.11.0
135+
platform: linux/amd64
136+
container_name: cardano-ogmios
137+
restart: unless-stopped
138+
environment:
139+
- DATA_DIR=/data
140+
ports:
141+
- "1337:1337"
142+
volumes:
143+
- cardano-ipc:/ipc
144+
- ogmios-data:/data
145+
command:
146+
- --node-socket
147+
- /ipc/node.socket
148+
- --node-config
149+
- /config/${CARDANO_NETWORK}/cardano-node/config.json
150+
- --host
151+
- 0.0.0.0
152+
153+
proof-server:
154+
profiles: ["proof-server"]
155+
image: midnightnetwork/proof-server:4.0.0
156+
container_name: proof-server
157+
ports:
158+
- "6300:6300"
159+
command: "'midnight-proof-server --network testnet'"
160+
healthcheck:
161+
test: ["CMD", "/bin/bash", "-c", ":> /dev/tcp/127.0.0.1/6300 || exit 1"]

proof-server.yml

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

0 commit comments

Comments
 (0)