> For the complete documentation index, see [llms.txt](https://cryptomolot.gitbook.io/cryptomolot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptomolot.gitbook.io/cryptomolot-docs/mainnets/mina-protocol.md).

# Mina Protocol

## Resources

|         |                                     |
| ------- | ----------------------------------- |
| Website | <https://minaprotocol.com/>         |
| Github  | <https://github.com/o1-labs/docs2/> |
| x.com   | <https://x.com/minaprotocol>        |
| Discord | <https://bit.ly/MinaDiscord>        |
| Docs    | <https://docs.minaprotocol.com/>    |

## Hardware requirements

Mina Daemon Node

<table data-view="cards"><thead><tr><th>CPU</th><th>RAM</th><th>Storage</th><th>Network</th><th>OS</th><th></th></tr></thead><tbody><tr><td>8 cores with BMI2 and AVX CPU instruction set are required</td><td>32 GB</td><td>64 GB</td><td>1 mbps</td><td>Linux (Ubuntu 20.04 x64)</td><td></td></tr></tbody></table>

## Installation 💾

## Generating a Key Pair

Install the mina-generate-keypair utility:

```bash
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.2-4aac388
```

```bash
mina -version
```

The expected output is: `Commit 93e02797f72abe2cbf8dfca6f2328e9c8cd76546 on branch berkeley`

### Generate your keys <a href="#generate-your-keys-for-ubuntu-and-debian" id="generate-your-keys-for-ubuntu-and-debian"></a>

Run the `mina advanced generate-keypair` command:

```bash
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 <a href="#validate-your-private-key" id="validate-your-private-key"></a>

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.

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

## Block Producer Getting Started

{% hint style="info" %}
Get started setting up a Mina node, learn how to [generate a key pair](https://docs.minaprotocol.com/node-operators/generating-a-keypair) for use with the network, and install the `mina daemon`.
{% endhint %}

Install:

```bash
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:

```bash
sudo apt-get install -y curl unzip mina-mainnet=3.0.2-4aac388
```

verify the mina daemon installation, run:

```bash
mina version
```

The expected output is `Commit 93e02797f72abe2cbf8dfca6f2328e9c8cd76546 on branch berkeley`.

## If you are using UFW, allow these permissions[​](https://docs.minaprotocol.com/node-operators/block-producer-node/getting-started#if-you-are-using-ufw-allow-these-permissions) <a href="#if-you-are-using-ufw-allow-these-permissions" id="if-you-are-using-ufw-allow-these-permissions"></a>

```bash
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[​](https://docs.minaprotocol.com/node-operators/block-producer-node/connecting-to-the-network#high-level-overview) <a href="#high-level-overview" id="high-level-overview"></a>

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 <a href="#start-a-standalone-mina-node" id="start-a-standalone-mina-node"></a>

Start a standalone mina node to make sure everything works.

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

```bash
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](https://docs.minaprotocol.com/glossary#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:

```bash
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[​](https://docs.minaprotocol.com/node-operators/block-producer-node/connecting-to-the-network#stop-the-standlone-node) <a href="#stop-the-standlone-node" id="stop-the-standlone-node"></a>

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

### Start a mina node with auto-restart flows using systemd[​](https://docs.minaprotocol.com/node-operators/block-producer-node/connecting-to-the-network#start-a-mina-node-with-auto-restart-flows-using-systemd) <a href="#start-a-mina-node-with-auto-restart-flows-using-systemd" id="start-a-mina-node-with-auto-restart-flows-using-systemd"></a>

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[​](https://docs.minaprotocol.com/node-operators/block-producer-node/connecting-to-the-network#create-and-customize-the-mina-env) <a href="#create-and-customize-the-mina-env" id="create-and-customize-the-mina-env"></a>

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:

   ```bash
   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`:

   * External port 8302
     * Change with `-external-port`
   * Mainnet seed peers list <https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt>
     * Change with `--peer-list-url`
4. After your `.mina-env` file is ready, start a mina node instance and connect to the live network using systemctl to control systemd:

   ```bash
   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[​](https://docs.minaprotocol.com/node-operators/block-producer-node/connecting-to-the-network#check-your-connectivity) <a href="#check-your-connectivity" id="check-your-connectivity"></a>

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

Check if `mina` had any trouble getting started:

```bash
systemctl --user status mina
```

Stop mina gracefully and stop automatically restarting the service:

```bash
systemctl --user stop mina
```

Manually restart the mina process:

```bash
systemctl --user restart mina
```

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

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

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

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