Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Use nginx to expose graphql endpoints #37

@piotr-iohk

Description

@piotr-iohk

Problem

Currently mina daemons in minimina local network use network_mode: host which may be a problem when running multiple networks at the same time as ports may collide between networks. Also exposing ports with ports: [<port>:<port>] may also be problematic because we would need additional logic for handling ports such that they don't interfere on host network.

Minimina does not use network_mode: host any longer however it exposes graphql ports which may interfere when there are networks spinned next to each other therefore the original problem still requires addressing.

Possible way to workaround is to employ nginx reverse proxy to expose graphql endpoints. This way ports handling would live inside private docker network and we can expose graphql like http://localhost/<network-id>/<node-id>/graphql

Acceptance Criteria

  • use nginx to expose graphql endpoints

Example configuration

docker-compose.yaml:

version: '3.8'
x-defaults: &default-attributes
    volumes:
    - /home/piotr/.minimina/default:/local-network
    - config-directory:/config-directory
    environment:
      MINA_PRIVKEY_PASS: naughty blue worm
      MINA_LIBP2P_PASS: naughty blue worm
volumes:
  config-directory: 
services:
  nginx-default:
    image: nginx:latest
    container_name: nginx-default
    ports:
      - "80:80"
    volumes:
      - /home/piotr/.minimina/default/nginx.conf:/etc/nginx/conf.d/default.conf
 ...
  default-mina-seed-1:
    <<: *default-attributes
    container_name: default-mina-seed-1-default
    image: gcr.io/o1labs-192920/mina-daemon:2.0.0rampup3-bfd1009-buster-berkeley
    command: daemon -client-port 3100 -rest-port 3101 -insecure-rest-server -external-port 3102 -metrics-port 3103 -libp2p-metrics-port 3104 -config-file /local-network/genesis_ledger.json -log-json -log-level Trace -file-log-level Trace -config-directory /config-directory/default-mina-seed-1 -seed -libp2p-keypair CAESQFuurFp97v5EFRki4m+FLdwy+I/A4THZecDvKC5c0T2B7FniWMndQhph9T3B08cwXBcgQnqXHG7jhb923qQSSW4=,CAESIOxZ4ljJ3UIaYfU9wdPHMFwXIEJ6lxxu44W/dt6kEklu,12D3KooWRiysxsjGpkGo5PhZbLLQZtteEmwM5nGKgtCxrms6K6bf
    entrypoint:
    - mina

nginx.conf:

server {
    listen 80;

    location /default/seed/graphql {
        proxy_pass http://default-mina-seed-1-default:3101/graphql;
    }

   # other services
  
}

Graphql ep: http://localhost/default/seed/graphql

Tasks

  • Add and configure nginx service when creating network
  • expose graphql endpoints through nginx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions