Skip to content

Conversation

@cosmir17
Copy link
Contributor

@cosmir17 cosmir17 commented Oct 31, 2025

Adds indexer-standalone integration to midnight-node-docker, enabling users to run both Midnight node and indexer with a single docker-compose command.

Changes

  • Added indexer-standalone service to compose.yml with GraphQL API on port 8088
  • Added INDEXER_IMAGE environment variable to all network configurations
  • Created .envrc.preview for preview network support
  • Updated testnet-02 node version from 0.12.0 to 0.12.1 (matching actual testnet)
  • Added automatic indexer secret generation to .envrc

Supported Networks

  • qanet (node 0.12.0-rc.3, indexer 2.1.4)
  • testnet-02 (node 0.12.1, indexer 2.1.4)
  • preview (node 0.17.0-rc.4, indexer 3.0.0-alpha.5)

Fixes PM-20249

- Add indexer-standalone service to compose.yml
- Generate and manage indexer secret in .envrc
- Add INDEXER_IMAGE to qanet and testnet-02 environments
- Create new preview environment configuration
- Update README to document indexer integration
- Add indexer.secret to .gitignore
@cosmir17 cosmir17 self-assigned this Oct 31, 2025
@cosmir17 cosmir17 requested a review from a team as a code owner October 31, 2025 01:04
Add cardano-node and cardano-db-sync services to support midnight-node's
main chain follower. Midnight-node requires access to Cardano blockchain
data via PostgreSQL populated by cardano-db-sync.

Services added:
- cardano-node: Connects to Cardano preview network, provides blockchain data
- cardano-db-sync: Syncs Cardano data to PostgreSQL (cexplorer database)

Changes:
- Added cardano-ipc and db-sync-data volumes for inter-service communication
- Updated midnight-node-testnet to depend on cardano-db-sync
- Created cardano-data/ directory for persistent node data
- Set indexer APP__APPLICATION__NETWORK_ID=TestNet to match testnet-02
- Added interactions/ to .git/info/exclude

Known issue - indexer version incompatibility:
- Indexer 2.1.4 expects "Undeployed" network but testnet-02 uses "TestNet"
- This is a version compatibility issue, not configuration
- Cardano stack works correctly; indexer needs compatible version

Other limitations:
- Cardano sync takes significant time (hours to days for full sync)
- Midnight-node shows verification errors until db-sync catches up

Related: PM-20249
@@ -0,0 +1,11 @@
# overrides for preview
export MIDNIGHT_NODE_IMAGE="ghcr.io/midnight-ntwrk/midnight-node:0.17.0-rc.4"
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:3.0.0-alpha.5"
Copy link
Collaborator

@gilescope gilescope Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Node needs to publish to dockerhub for all named releases. (these referenced images aren't public)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gilescope Good catch on the ghcr.io images requiring auth. Is this blocking for the PR, or should we track it separately for the node team?

For context:

  • testnet-02 already uses public Docker Hub image (midnightnetwork/midnight-node:0.12.1)
  • preview/qanet use ghcr.io which needs GitHub authentication

.envrc.preview Outdated
# overrides for preview
export MIDNIGHT_NODE_IMAGE="ghcr.io/midnight-ntwrk/midnight-node:0.17.0-rc.4"
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:3.0.0-alpha.5"
export INDEXER_NETWORK_ID="Preview"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the network id lowercase?

export MIDNIGHT_NODE_IMAGE="midnightnetwork/midnight-node:0.12.0"
export MIDNIGHT_NODE_IMAGE="midnightnetwork/midnight-node:0.12.1"
export INDEXER_IMAGE="ghcr.io/midnight-ntwrk/indexer-standalone:2.1.4"
export INDEXER_NETWORK_ID="TestNet"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not TestNet-02 ? Honestly I think we should have lowercase for all these network ids.

/data
*.privatekey
*.password
*.secret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have 1 not 3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

volumes:
- cardano-ipc:/node-ipc
- db-sync-data:/var/lib/cexplorer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have these in the other compose file:
cardano-db-sync
cardano-node
postgres

How about we just have one compose file and rely on docker compose profiles to turn sets of sevices on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Everything is now in single compose.yml with profiles:

  • docker compose up → just midnight-node
  • docker compose --profile cardano up → adds Cardano stack + indexer
  • docker compose --profile ogmios up → adds Ogmios
  • docker compose --profile proof-server up → adds proof server

Deleted the legacy compose files as requested. Much cleaner now!

cosmir17 and others added 2 commits November 4, 2025 14:21
Co-authored-by: Squirrel <gilescope@gmail.com>
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.
@cosmir17 cosmir17 force-pushed the add-indexer-standalone branch from f36794a to 21876e2 Compare November 4, 2025 15:53
@cosmir17 cosmir17 requested a review from gilescope November 4, 2025 15:55
@gilescope gilescope changed the title feat: add indexer-standalone support to midnight-node-docker feat: add Preview support to midnight-node-docker (and indexer) Nov 6, 2025
@stevanlohja
Copy link
Contributor

Preview pc-chain-config.json is not recognized or missing. Ref: https://github.com/midnightntwrk/midnight-node/blob/main/res/preview/pc-chain-config.json

✗ tree envs 
envs
├── preview
│   └── pc-chain-config.json
├── qanet
│   └── pc-chain-config.json
└── testnet-02
    └── pc-chain-config.json

5 directories, 2 files
➜  midnight-node-docker git:(add-indexer-standalone) ✗ cat envs/preview/pc-chain-config.json
cat: envs/preview/pc-chain-config.json: Is a directory

@ozgb
Copy link

ozgb commented Nov 6, 2025

pc-chain-config.json is included in the node images:

⬢ ❯ docker run --entrypoint find --rm ghcr.io/midnight-ntwrk/midnight-node:0.18.0-rc.5 / -name "pc-chain-config.json"
/res/dev/pc-chain-config.json
/res/node-dev-01/pc-chain-config.json
/res/perfnet/pc-chain-config.json
/res/preview/pc-chain-config.json
/res/qanet/pc-chain-config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants