Skip to main content

Docker Compose Seed Peer

Run a Mina seed node — a publicly reachable peer that bootstraps newcomers into the network.

The full Docker Compose configuration — including docker-compose.yml, example environment files for mainnet and devnet, a Makefile, and a README — is maintained in the Mina repository:

mina/src/app/cli/docker-compose/seed-peer/

Quick start​

tip

Before running the commands below, review the Configuration section.

git clone https://github.com/MinaProtocol/mina.git
cd mina/src/app/cli/docker-compose/seed-peer

# For mainnet
cp example.mainnet.env .env

# For devnet
cp example.devnet.env .env

# Edit .env — set MINA_LIBP2P_PASS (required)
vi .env

# Start services
docker compose --env-file .env up -d

# Or use make shortcuts
make mainnet
make devnet
note

Every docker compose command on this page passes --env-file .env. Docker Compose reads .env on its own, but other runtimes, such as Podman, do not.

Services overview​

ServiceDescriptionDefault Port
generate_libp2p_keyOne-shot: generates the libp2p keypair—
mina_seedMina daemon running with --seed and --libp2p-keypair3085 (GraphQL), 8302 (P2P)

Configuration​

Docker image​

VariableDescription
MINA_DAEMON_IMAGEMina daemon Docker image

The image, for mainnet and devnet, is pulled from Docker Hub.

Network​

VariableDescription
MINA_NETWORKmainnet or devnet
MINA_PEERLIST_URLBootstrap peers URL
MINA_LIBP2P_PASSPassphrase for the libp2p key (required)

Ports​

VariableDefaultDescription
MINA_REST_PORT3085GraphQL API port
MINA_P2P_PORT8302P2P networking port (must be reachable from the internet)

Building the relay-circuit address​

Once the seed has its libp2p peer ID, build a multiaddr that other nodes can use as a --peer:

make peer-id
/ip4/<external-ip>/tcp/<libp2p-port>/p2p/<peer-id>

or with DNS:

/dns4/seed.example.com/tcp/8302/p2p/12D3Koo...

You can submit a PR to MinaFoundation/seeds to be listed in the official seed peer list.

Data persistence​

Host pathContainer pathContents
./mina_node/.mina-config/root/.mina-configDaemon config, libp2p key, peers

Make targets​

CommandDescription
make devnetCopy devnet env and start services
make mainnetCopy mainnet env and start services
make stopStop services
make cleanStop services, remove volumes and .mina-config
make logsFollow logs
make statusShow container status
make peer-idPrint this seed's libp2p peer ID
make healthCheck GraphQL endpoint, peer ID, addresses, and container summary

Verifying the deployment​

make health

docker compose --env-file .env exec mina_seed mina client status

curl -s http://localhost:3085/graphql -H 'Content-Type: application/json' \
-d '{"query":"{ daemonStatus { peers { peerId } } }"}' | jq .

Clean start​

make clean
docker compose --env-file .env up -d
danger

make clean removes ./mina_node/.mina-config, including your libp2p key. Your seed's multiaddr will change after a clean restart. Back up ./mina_node/.mina-config/keys/libp2p-key* if you've published the multiaddr anywhere.