Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ RUN rustup default 1.77 && rustup component add rustfmt
WORKDIR /openmina
COPY . .
RUN cargo build --release --package=cli --bin=openmina
RUN cargo build --release --features scenario-generators --bin openmina-node-testing

FROM openmina/mina-snark-worker-prover:${MINA_SNARK_WORKER_TAG} as prover

FROM debian:buster
RUN apt-get update && apt-get install -y libjemalloc2 libssl1.1 libpq5 curl jq procps && apt-get clean
COPY --from=build /openmina/cli/bin/snark-worker /usr/local/bin/
COPY --from=build /openmina/target/release/openmina /usr/local/bin/
COPY --from=build /openmina/target/release/openmina-node-testing /usr/local/bin/
COPY --from=prover /usr/local/bin/mina /usr/local/bin
ENTRYPOINT [ "openmina" ]
ENTRYPOINT [ "openmina" ]
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ In the future, we plan to implement:
* SnarkyJS support for Rust node, thanks to which you will be able to directly inject simple transactions, such as transferring Mina funds from one account to another.
* The ability to record/replay all blocks

## Producer demo

See the detailed [guide](docs/producer-demo.md).

## How to launch (with docker compose):

Expand All @@ -59,15 +62,29 @@ Ubuntu or Debian-based Linux distribution with the following packages installed:
- `git`
- `libssl-dev`
- `pkg-config`
- `protobuf-compiler`
- `build-essential`

Example:
Example (debian-based):

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

Example (macOS):

If you have not yet installed homebrew:

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

``` sh
brew install curl git openssl pkg-config protobuf gcc make
```

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

Open up the command line and enter the following:

Expand Down
21 changes: 21 additions & 0 deletions docker-compose.local.producers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
local-producer-cluster:
container_name: local-producer-cluster
build:
context: .
dockerfile: Dockerfile
entrypoint: ["openmina-node-testing", "scenarios-generate", "--name", "simulation-small-forever-real-time"]
ports:
- 11010:11010
- 11012:11012
- 11014:11014

frontend:
container_name: frontend
build:
context: .
dockerfile: Dockerfile_FE
args:
BUILD_CONFIGURATION: block_producers
ports:
- "8070:80"
143 changes: 143 additions & 0 deletions docs/producer-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Producer Demo Launch Guide with Docker

This demo showcases the block production capabilities of OpenMina nodes within a private network. It launches three OpenMina nodes on your local machine, operating in a private network environment. For the purpose of this demonstration, block proofs are disabled. This setup allows you to observe block production immediately, without the need to wait for your account to be included in the staking ledger on testnets.

## Table of Contents
1. [Prerequisites](#prerequisites)
- [Docker Installation on Debian-based Linux](#docker-installation-on-debian-based-linux)
- [Docker Installation on Windows](#docker-installation-on-windows)
- [Docker Installation on macOS](#docker-installation-on-macos)
2. [Running the Producer Demo](#running-the-producer-demo)
- [Running on Debian-based Linux](#running-on-debian-based-linux)
- [Running on Windows](#running-on-windows)
- [Running on macOS](#running-on-macos)

## Prerequisites

### Docker Installation on Debian-based Linux

1. **Set up Docker's apt repository:**

```bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```

2. **Install the Docker packages:**

```bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

3. **Add your user to the `docker` group:**

```bash
sudo usermod -aG docker $USER
newgrp docker
```

4. **Verify the installation:**

```bash
docker run hello-world
```

### Docker Installation on Windows

1. **Download Docker Desktop for Windows from the [Docker Website](https://www.docker.com/products/docker-desktop/).**

2. **Run the installer and follow the instructions.**

3. **After installation, Docker will start automatically. Verify that Docker Desktop is running by checking the Docker icon in your system tray.**

### Docker Installation on macOS

1. **Download Docker Desktop for Mac from the [Docker Website](https://www.docker.com/products/docker-desktop/).**

2. **Open the downloaded `.dmg` file and drag Docker to the Applications folder.**

3. **Open Docker from the Applications folder and follow the installation steps.**

4. **Open up a terminal window by using the shortcut Command + Space and type in terminal**

5. **Verify the installation by running the following command in your terminal:**
```sh
docker --version
```

## Running the Producer Demo

### Running on Debian-based Linux

1. **Clone this repository:**
```bash
git clone https://github.com/openmina/openmina.git
```

2. **Navigate to the repository:**

```bash
cd openmina
```

3. **Run the following command to start the demo:**
```sh
docker compose -f docker-compose.local.producers.yml up --build
```

4. **Open you browser and visit http://localhost:8070**

### Running on Windows

1. **Open the command prompt by pressing the windows button on your keyboard and type in command prompt**

2. **Clone this repository:**
```bash
git clone https://github.com/openmina/openmina.git
```

3. **Navigate to the repository:**

```bash
cd openmina
```

4. **Run the following command to start the demo:**
```sh
docker compose -f docker-compose.local.producers.yml up --build
```

5. **Open you browser and visit http://localhost:8070**

### Running on macOS

1. **Open a terminal by pressing command + space on your keyboard and type in terminal**

2. **Clone this repository:**
```bash
git clone https://github.com/openmina/openmina.git
```

3. **Navigate to the repository:**

```bash
cd openmina
```

4. **Run the following command to start the demo:**
```sh
docker compose -f docker-compose.local.producers.yml up --build
```

5. **Open you browser and visit http://localhost:8070**