Skip to content

Commit 390273a

Browse files
authored
Merge pull request #818 from openmina/block-producer-guide
Add Block producer guide & Edit Local Block Producer Demo
2 parents 1befb61 + 70cf17a commit 390273a

File tree

5 files changed

+120
-133
lines changed

5 files changed

+120
-133
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Run the Block Producer
99

10-
Once you have completed the [pre-requisites](https://github.com/openmina/openmina/blob/main/docs/producer-demo.md#prerequisites) for your operating system, follow these steps:
10+
Once you have completed the [pre-requisites](./docs/docker-installation.md) for your operating system, follow these steps:
1111

1212
### Setup Option 1: Download Docker Compose Files from the Release
1313

@@ -263,4 +263,4 @@ npm start
263263
[release-link]: https://github.com/openmina/openmina/releases/latest
264264

265265
[Apache licensed]: https://img.shields.io/badge/license-Apache_2.0-blue.svg
266-
[Apache link]: https://github.com/openmina/openmina/blob/master/LICENSE
266+
[Apache link]: https://github.com/openmina/openmina/blob/master/LICENSE

docs/block-producer-guide.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Rust Node Block Production Testing on Devnet
2+
3+
This guide is intended for setting up block producer nodes on **Mina Devnet** only.
4+
Do not use this guide for Mina Mainnet until necessary security audits are complete.
5+
6+
7+
---
8+
9+
### 0. Prerequisites
10+
11+
Ensure Docker and Docker Compose are installed on your system - [Docker Installation Guide](./docker-installation.md)
12+
13+
### 1. Setup Directories
14+
Create the main directory and a subdirectory `openmina-workdir`. [Docker Compose](../docker-compose.block-producer.yml) references `openmina-workdir`. It stores a private key and logs for block production.
15+
16+
```bash
17+
mkdir -p ~/mina-node/openmina-workdir cd ~/mina-node
18+
```
19+
20+
### 2. Prepare Your Keys
21+
Place your block producer's private key into the `openmina-workdir` directory and name it `producer-key`:
22+
23+
```bash
24+
cp /path/to/your/private_key producer-key
25+
```
26+
Replace `/path/to/your/private_key` with the actual path to your private key file.
27+
28+
### 3. Launch Block Producer
29+
Download the Docker Compose file:
30+
31+
```bash
32+
curl -O https://raw.githubusercontent.com/openmina/openmina/main/docker-compose.block-producer.yml
33+
```
34+
35+
Launch the block producer with `MINA_PRIVKEY_PASS` to set the private key password. Optionally, use `COINBASE_RECEIVER` to set a different coinbase receiver:
36+
37+
```bash
38+
env COINBASE_RECEIVER="YourWalletAddress" MINA_PRIVKEY_PASS="YourPassword" \
39+
docker compose -f docker-compose.block-producer.yml up -d --pull always
40+
```
41+
42+
### 4. Access Dashboard
43+
44+
Visit [http://localhost:8070](http://localhost:8070) to [monitor sync](http://localhost:8070/dashboard) and [block production](http://localhost:8070/block-production).
45+
46+
### 5. Logs
47+
48+
Logs are stored in `openmina-workdir` with filenames like `openmina.log.2024-10-14`, `openmina.log.2024-10-15`, etc.
49+
50+
### 6. Feedback
51+
52+
Collect logs from `openmina-workdir` and report issues on the [rust-node-testing](https://discord.com/channels/484437221055922177/1290662938734231552) discord channel. Include reproduction steps if possible.
53+

docs/docker-installation.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Docker Installation Guide
2+
3+
## Installation for
4+
5+
- [Debian-based Linux](#docker-installation-on-debian-based-linux)
6+
- [Windows](#docker-installation-on-windows)
7+
- [macOS](#docker-installation-on-macos)
8+
9+
## Docker Installation on Debian-based Linux
10+
11+
1. Set up Docker's apt repository:
12+
13+
```bash
14+
# Add Docker's official GPG key:
15+
sudo apt-get update
16+
sudo apt-get install ca-certificates curl
17+
sudo install -m 0755 -d /etc/apt/keyrings
18+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
19+
sudo chmod a+r /etc/apt/keyrings/docker.asc
20+
21+
# Add the repository to Apt sources:
22+
echo \
23+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
24+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
25+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
26+
sudo apt-get update
27+
```
28+
29+
2. Install the Docker packages:
30+
31+
```bash
32+
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
33+
```
34+
35+
3. Add your user to the `docker` group:
36+
37+
```bash
38+
sudo usermod -aG docker $USER
39+
newgrp docker
40+
```
41+
42+
4. Verify the installation:
43+
44+
```bash
45+
docker run hello-world
46+
```
47+
48+
---
49+
50+
## Docker Installation on Windows
51+
52+
1. Download and Install [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/).
53+
54+
2. Ensure Docker Desktop is running (check the system tray icon).
55+
56+
---
57+
58+
### Docker Installation on macOS
59+
60+
1. Download and Install [Docker Desktop for Mac](https://www.docker.com/products/docker-desktop/).
61+
2. Verify the installation in Terminal:
62+
63+
```bash
64+
docker --version
65+
```

docs/producer-demo.md

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)