Skip to main content

Connect to Devnet

The Devnet network is designed for testing and experimentation. Devnet is a dedicated network for developers who are building on top of the Mina protocol.

On the Devnet network, MINA holds no real value. To request a prefunded account, reach out on Mina Protocol Discord.

If you are interested in running a node, connect to Mainnet network instead.

High-Level Overview

  1. Install or update your node to the required specific mina daemon.
  2. Start a mina node and connect to Devnet.
  3. Check your connectivity.

Update your software

Connecting to Devnet requires a specific build of the Mina client and a specific version of a peers list.

Follow the steps for your operating system.

Ubuntu 18.04 and Debian 9

Install the latest Stable Mina Release 3.0.0 or visit the GitHub Releases Page to install pre-release (Alpha/Beta) builds.

To set up the new debian devnet repository and install the latest version:

echo "deb [trusted=yes] http://packages.o1test.net $(lsb_release -cs) devnet" | sudo tee /etc/apt/sources.list.d/mina-devnet.list
sudo apt-get install --yes apt-transport-https
sudo apt-get update
sudo apt-get install --yes curl unzip mina-devnet=3.0.0

To check that daemon installed correctly:

mina version

The expected output is:

Commit dc6bf78b8ddbbca3a1a248971b76af1514bf05aa on branch berkeley

Start and connect a node to Devnet

Steps to start a Mina node instance and connect to the Devnet network.

Create a libp2p key

If you don't already have one, you must create a libp2p key pair and persist it:

mina libp2p generate-keypair -privkey-path <path-to-the-key-file>

Set the environment variable MINA_LIBP2P_PASS with the password set for the libp2p key pair in the previous step.

Run mina daemon with:

mina daemon -libp2p-keypair <path-to-the-key-file> and --peer-list-url https://storage.googleapis.com/o1labs-gitops-infrastructure/devnet/seed-list-devnet.txt

The --peer-list argument specifies the the source file of seed peer addresses for the initial peer to connect to on the network. Mina is a peer-to-peer protocol, so there is no dependence on a single centralized server.

Docker

To run your daemon using Docker, create a directory on the host machine to mount as a volume:

cd ~
mkdir ~/.mina-config

To produce blocks or customize the configuration for the mina daemon, create the ~/.mina-env file:

export MINA_PRIVKEY_PASS="My_V3ry_S3cure_Password"
LOG_LEVEL=Info
FILE_LOG_LEVEL=Debug
EXTRA_FLAGS=" --block-producer-key <BLOCK_PRODUCER_KEY_PATH>"
PEER_LIST_URL=https://storage.googleapis.com/o1labs-gitops-infrastructure/devnet/seed-list-devnet.txt

Replace <BLOCK_PRODUCER_KEY_PATH> with the full path to your block producer private key. For example, /home/ubuntu/keys/my-wallet.

If you do not want to produce blocks, then provide only the PEER_LIST_URL.

Now, run the image with your ~/.mina-config and ~/.mina-env files mounted into the container:

docker run --name mina -d \
-p 8302:8302 \
--restart=always \
--mount "type=bind,source=$(pwd)/.mina-env,dst=/entrypoint.d/mina-env,readonly" \
--mount "type=bind,source=$(pwd)/.mina-config,dst=/root/.mina-config" \
minaprotocol/mina-daemon:3.0.0-dc6bf78-focal-devnet \
daemon \

Check your connectivity

Follow the logs:

docker logs -f mina

If the node crashes, save the log output to a file:

docker logs mina > mina-log.txt

Monitor connectivity to the network:

docker exec -it mina mina client status