/openmina

Mina Rust Node

Primary LanguageRustApache License 2.0Apache-2.0

The Open Mina Node

With the Rust-based Open Mina node, you can produce, validate and apply blocks

Openmina Daily Changelog release-badge Apache licensed

Run the Block Producer

Once you have completed the pre-requisites for your operating system, follow these steps:

Setup Option 1: Download Docker Compose Files from the Release

  1. Download the Docker Compose files:

    • Go to the Releases page of this repository.
    • Download the latest openmina-vX.Y.Z-docker-compose.zip (or .tar.gz) file corresponding to the release version (available since v0.8.0).
  2. Extract the files:

    • Unzip or untar the downloaded file:
      unzip openmina-vX.Y.Z-docker-compose.zip
      or
      tar -xzvf openmina-vX.Y.Z-docker-compose.tar.gz
    • Replace vX.Y.Z with the actual release version you downloaded.
  3. Navigate to the extracted directory:

    cd openmina-vX.Y.Z-docker-compose

Setup Option 2: Clone the Repository

  1. Clone this repository:

    git clone https://github.com/openmina/openmina.git
  2. Navigate to the repository:

    cd openmina

Launch

Run the following command to start the demo:

docker compose -f docker-compose.local.producers.yml up --pull always --force-recreate

And finally:

Open your browser and visit http://localhost:8070

You should see the following screen:

producer-demo

Description

The Open Mina Node is a Mina node written completely in Rust and capable of verifying blocks of transactions, producing blocks and generating SNARKs.

In the design of the Open Mina node, we are utilizing much of the same logic as in the Mina Web Node. The key difference is that unlike the Web Node, which is an in-browser node with limited resources, the Open Mina node is able to perform resource-intensive tasks such as SNARK proof generation.

Overview of the Node’s current functionalities

Current functionalities In Development Future Plans
Produce and prove blocks (with and without transactions). ☐ Receiving and broadcasting transactions from/into the transaction pool. ☐ Direct transfer of MINA funds using Webnode
Produce SNARK proofs for transactions. ☐ A block replayer that uses data from the archive nodes ☐ O1JS support for Webnode.
Connect to the network and sync up to the best tip block
Validate and apply new blocks and transactions to update consensus and ledger state.
Broadcast messages: blocks, SNARK pool

Please note that receiving and broadcasting transactions from/into the transaction pool is already possible, but is still an early alpha version and needs more work.

Updates to the Front End

We've added two new pages to the node's front end:

Mempool

image

Shows a list of the transactions from the pool and a side panel detail.

Benchmarks

image

The benchmarks page helps us to send transactions. The transactions are signed in the front end by the Mina signer. Every user can send transactions and they can see in the mempool whether the transactions were sent by their node.

Launch the block producer demo

Run the Open Mina block producer node by following this guide.

How to launch the node (with Docker compose):

From the directory containing the Docker Compose files (either the root of the cloned repository or the directory where the released Docker Compose files were extracted):

docker compose up --pull always

Then visit http://localhost:8070 in your browser.

image

By default, docker compose up will use the latest node and frontend images available (tagged with latest), but specific versions can be selected by using the OPENMINA_TAG and OPENMINA_FRONTEND_TAG variables.

How to launch the node (without Docker compose):

This installation guide has been tested on Debian and Ubuntu and should work on most distributions of Linux.

Pre-requisites:

Ubuntu or Debian-based Linux distribution with the following packages installed:

  • curl
  • git
  • libssl-dev
  • pkg-config
  • protobuf-compiler
  • build-essential

Example (debian-based):

# Either using "sudo" or as the "root" user
sudo apt install curl git libssl-dev pkg-config protobuf-compiler build-essential

Example (macOS):

If you have not yet installed homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install curl git openssl pkg-config protobuf gcc make

Steps (for Debian-based Linux distros and macOS):

Open up the command line and enter the following:

And then:

# Install rustup and set the default Rust toolchain to 1.80 (newer versions work too)
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.80
# Setup the current shell with rustup
source "$HOME/.cargo/env"
# Clone the openmina repository
git clone https://github.com/openmina/openmina.git
cd openmina/
# Build and run the node
cargo run --release -p cli node

How to launch the UI:

Prerequisites

1. Node.js v20.11.1

MacOS

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node@20.11.1

Linux

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install 20.11.1

Windows

Download Node.js v20.11.1 from the official website, open the installer and follow the prompts to complete the installation.

2. Angular CLI v16.2.0

npm install -g @angular/cli@16.2.0

3. Installation

Open a terminal and navigate to this project's root directory

cd PROJECT_LOCATION/openmina/frontend

Install the dependencies

npm install

Run the application

npm start

Repository Structure

  • core/ - Provides basic types needed to be shared across different components of the node.
  • ledger/ - Mina ledger implementation in Rust.
  • snark/ - Snark/Proof verification.
  • p2p/ - P2p implementation for OpenMina node.
  • node/ - Combines all the business logic of the node.
    • native/ - OS specific pieces of the node, which is used to run the node natively (Linux/Mac/Windows).
    • testing/ - Testing framework for OpenMina node.
  • cli/ - OpenMina cli.
  • frontend/ - OpenMina frontend.

Details regarding architecture

The Open Mina Documentation