Run Block Producing Node on Devnet
This guide is intended for setting up block producer nodes on Mina Devnet only. Do not use this guide for Mina Mainnet until necessary security audits are complete.
Prerequisites
Ensure Docker and Docker Compose are installed on your system - Docker Installation Guide
Download & Start the Node
- Download the Latest Release
-
Visit the Open Mina Releases
-
Download the latest
openmina-vX.Y.Z-docker-compose.zip
-
Extract the Files:
unzip openmina-vX.Y.Z-docker-compose.zip
cd openmina-vX.Y.Z-docker-compose
mkdir openmina-workdir
-
Prepare Your Keys
Docker Compose references
openmina-workdir
. It stores a private key and logs for block production. Place your block producer's private key into theopenmina-workdir
directory and name itproducer-key
:cp /path/to/your/private_key openmina-workdir/producer-key
Replace
/path/to/your/private_key
with the actual path to your private key file. -
Launch Block Producer
Use
MINA_PRIVKEY_PASS
to set the private key password. Optionally, useCOINBASE_RECEIVER
to set a different coinbase receiver:env COINBASE_RECEIVER="YourWalletAddress" MINA_PRIVKEY_PASS="YourPassword" \
docker compose -f docker-compose.block-producer.yml up -d --pull alwaysOptional parameters:
OPENMINA_LIBP2P_EXTERNAL_IP
Sets your node’s external IP address to help other nodes find it.OPENMINA_LIBP2P_PORT
Sets the port for Libp2p communication. -
Go to Dashboard
Visit http://localhost:8070 to monitor sync and block production.
Alternative: Using Make Command
As an alternative to Docker Compose, you can run the block producer directly using the Makefile target. This method requires building from source.
Prerequisites
- Rust toolchain installed
- Git repository cloned and accessible
Setup and Run
-
Prepare Your Keys
You have two options for setting up your producer key:
Option A: Generate a new key pair
make generate-block-producer-key
This will create a new key pair and save the private key to
openmina-workdir/producer-key
and the public key toopenmina-workdir/producer-key.pub
. The command will fail if keys already exist to prevent accidental overwriting.To generate keys with a password:
make generate-block-producer-key MINA_PRIVKEY_PASS="YourPassword"
To generate keys with a custom filename:
make generate-block-producer-key PRODUCER_KEY_FILENAME=./path/to/custom-key
This will create
./path/to/custom-key
(private) and./path/to/custom-key.pub
(public).You can combine both options:
make generate-block-producer-key \
PRODUCER_KEY_FILENAME=./path/to/custom-key \
MINA_PRIVKEY_PASS="YourPassword"Option B: Use an existing key
mkdir -p openmina-workdir
cp /path/to/your/private_key openmina-workdir/producer-key -
Run Block Producer
For devnet (default):
make run-block-producer \
MINA_PRIVKEY_PASS="YourPassword" \
NETWORK=devnet \
COINBASE_RECEIVER="YourWalletAddress"For mainnet (when supported):
make run-block-producer \
COINBASE_RECEIVER="YourWalletAddress" \
MINA_PRIVKEY_PASS="YourPassword" \
NETWORK=mainnetOptional parameters:
OPENMINA_LIBP2P_EXTERNAL_IP
- Sets external IP addressOPENMINA_LIBP2P_PORT
- Sets libp2p communication portPRODUCER_KEY_FILENAME
- Path to producer key (default:./openmina-workdir/producer-key
)
Example with all options:
make run-block-producer \
NETWORK=devnet \
COINBASE_RECEIVER="YourWalletAddress" \
MINA_PRIVKEY_PASS="YourPassword" \
OPENMINA_LIBP2P_EXTERNAL_IP="1.2.3.4" \
OPENMINA_LIBP2P_PORT="8302" -
Monitor the Node
The node will start and listen on port 3000. You can monitor its status by checking the console output or connecting a frontend dashboard.
Access Logs
Logs are stored in openmina-workdir
with filenames like
openmina.log.2024-10-14
, openmina.log.2024-10-15
, etc.
Provide Feedback
Collect logs from openmina-workdir
and report issues on the
rust-node-testing
discord channel. Include reproduction steps if possible.