Mina Protocol

Mina is a layer-1 blockchain with a 22KB blockchain & zero knowledge smart contracts (“zkApps”) written in TypeScript.

Resources

Hardware requirements

Mina Daemon Node

8 cores with BMI2 and AVX CPU instruction set are required

32 GB

64 GB

1 mbps

Linux (Ubuntu 20.04 x64)

Installation 💾

Generating a Key Pair

Install the mina-generate-keypair utility:

echo "deb [trusted=yes] http://packages.o1test.net $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/mina.list
sudo apt-get update
sudo apt-get install -y mina-mainnet=3.0.0-93e0279
mina -version

The expected output is: Commit 93e02797f72abe2cbf8dfca6f2328e9c8cd76546 on branch berkeley

Generate your keys

Run the mina advanced generate-keypair command:

mina advanced generate-keypair --privkey-path ~/keys/my-wallet

When prompted, type in the password you intend to use to secure this key. Do NOT forget this password. If already set, the tool uses the password from the MINA_PRIVKEY_PASS environment variable instead of prompting you.

Validate your private key

Now that you've created your key, validate that it works. It's sufficient to use the mina advanced validate-keypair command to verify that you can sign a transaction.

mina advanced validate-keypair --privkey-path <path-to-the-private-key-file>

Block Producer Getting Started

Get started setting up a Mina node, learn how to generate a key pair for use with the network, and install the mina daemon.

Install:

sudo rm /etc/apt/sources.list.d/mina*.list
echo "deb [trusted=yes] http://packages.o1test.net $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/mina.list
sudo apt-get update

Now install the node package:

sudo apt-get install -y curl unzip mina-mainnet=3.0.0-93e0279

verify the mina daemon installation, run:

mina version

The expected output is Commit 93e02797f72abe2cbf8dfca6f2328e9c8cd76546 on branch berkeley.

If you are using UFW, allow these permissions

sudo ufw allow 22
sudo ufw allow 8302
sudo ufw allow 3089
sudo ufw enable

Connect to the Mina Network

Steps to install mina, connect to the Mina Mainnet network, and test connectivity.

High-Level Overview

  1. Install or update your node to the latest mina daemon.

  2. Start a standalone mina node.

  3. Stop the standalone node.

  4. Configure the node as a block producer, or customize, with the ~/.mina-env file.

  5. Start a mina node with auto-restart workflows.

  6. Check your connectivity.

  7. Monitor the mina client status.

Start a standalone mina node

Start a standalone mina node to make sure everything works.

To start a mina node instance and connect to the live network:

mina daemon --peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt

The --peer-list argument specifies 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.

If you have a key with MINA stake and want to produce blocks:

mina daemon --peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt \
            --block-producer-key ~/keys/my-wallet

where ~/keys/my-wallet is the path to your private key, if not the default.

Stop the standlone node

Kill the existing mina daemon process: Press Ctrl+C.

Start a mina node with auto-restart flows using systemd

Now that you've confirmed things are okay by running the standalone process, start mina with auto-restart workflows that allow the node to continue running after you log out and restart automatically when the machine restarts.

Create and customize the .mina-env

To produce blocks or otherwise customize the configuration for the mina daemon:

  1. Create the ~/.mina-env file.

  2. To produce blocks, add the required configuration:

    MINA_PRIVKEY_PASS="My_V3ry_S3cure_Password"
    LOG_LEVEL=Info
    FILE_LOG_LEVEL=Debug
    EXTRA_FLAGS=" --block-producer-key <BLOCK_PRODUCER_KEY_PATH>"

    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 you can keep ~/.mina-env empty for now.

  3. To change how mina is configured, specify flags to the mina daemon process with space-separated arguments between the quotes in EXTRA_FLAGS="".

    You can change the default values with EXTRA_FLAGS:

  4. After your .mina-env file is ready, start a mina node instance and connect to the live network using systemctl to control systemd:

    systemctl --user daemon-reload
    systemctl --user start mina
    systemctl --user enable mina
    sudo loginctl enable-linger

    These commands allow the node to continue running after you log out and restart automatically when the machine reboots.

Check your connectivity

Monitor the mina process that's running in the background and auto-restarting.

Check if mina had any trouble getting started:

systemctl --user status mina

Stop mina gracefully and stop automatically restarting the service:

systemctl --user stop mina

Manually restart the mina process:

systemctl --user restart mina

Look at logs that show the last 1000 lines, and follow from there:

journalctl --user -u mina -n 1000 -f

In some cases, you might need to run the following command to view the logs:

journalctl --user-unit mina -n 1000 -f

Last updated