Skip to main content
note

A new version of Mina Docs is coming soon! This page will be rewritten.

Block Producer Sidecar


info

PLEASE READ: This affects the submission of uptime data and the Performance Score results for receiving a delegation.

The current sidecar tracking system is being phased out to be replaced by the SNARK-work-based uptime tracking system. Until further notice, please continue running the sidecar AND SNARK-based tracking system on the SAME node.

Please follow the latest updates and post questions in the #delegation-program channel on Mina Protocol Discord.


In order to maintain eligibility for various grants and the Mina Foundation Delegation Program, you must run a sidecar with your daemon to report node uptime.

If you are required to keep your node online for a grant or specific program, you must run a small sidecar program that will report your daemon's uptime. This tutorial will walk you through the process of installing, configuring and running the sidecar program.

Installation

The sidecar is a separate package that can be installed on Debian/Ubuntu or run along side a Docker solution.

Debian / Ubuntu

Install the sidecar package using the apt package manager.

sudo apt-get install -y mina-bp-stats-sidecar=1.3.0-9b0369c

This will install the following files:

  1. /usr/local/bin/mina-bp-stats-sidecar (the mina sidecar program)
  2. /etc/mina-sidecar.json (the config file for the mina sidecar)
  3. /etc/systemd/system/mina-bp-stats-sidecar.service (the systemd config to run it as a service)

We will need to update the config file with the correct parameters. So use your preferred editor to replace the contents of /etc/mina-sidecar.json with the following:

{
"uploadURL": "https://us-central1-mina-mainnet-303900.cloudfunctions.net/block-producer-stats-ingest/?token=72941420a9595e1f4006e2f3565881b5",
"nodeURL": "http://127.0.0.1:3095"
}

Docker

If you are using docker, you can simply pull the latest image which we will run in the next section.

docker pull minaprotocol/mina-bp-stats-sidecar:latest

Next we will need to setup the config file, for this tutorial we will assume you are on a Linux based host system.

We will need to create a config file with the correct parameters. So use your preferred editor to replace the contents of ~/mina-sidecar-config.json with the following:

{
"uploadURL": "https://us-central1-mina-mainnet-303900.cloudfunctions.net/block-producer-stats-ingest/?token=72941420a9595e1f4006e2f3565881b5",
"nodeURL": "http://mina:3095"
}

We will pass this file into the Docker container in the next step.

Usage

This sidecar will need to communicate with a running daemon, so you will first need to start your daemon. You will need to run the daemon with the flag --limited-graphql-port 3095 in order for the sidecar to be able to communicate with the daemon. Further instructions can be found on the connecting page.

Debian / Ubuntu

First ensure the daemon is running on the same machine with the flag --limited-graphql-port 3095.

To (optionally) enable the sidecar service to run on reboot you can use:

sudo systemctl enable mina-bp-stats-sidecar

Then to manually start the sidecar service, use this command:

sudo service mina-bp-stats-sidecar start

From there you can check that it's running and see the most recent logs with service mina-bp-stats-sidecar status

If you want to get logs from the sidecar service, you can use journalctl:

journalctl -f -u mina-bp-stats-sidecar.service

Docker

First you will need to create a network for the daemon and sidecar containers:

docker network create mina-network

Next you will need to start the daemon with --network mina-network passed to docker, and some new flags --open-limited-graphql-port --limited-graphql-port 3095 passed to the daemon.

To start the sidecar container, simply use the following command:

docker run \
--name mina-sidecar \
--network mina-network \
--restart=always -d \
-v $(pwd)/mina-sidecar-config.json:/etc/mina-sidecar.json \
minaprotocol/mina-bp-stats-sidecar:latest

You can check the logs using the docker logs command:

docker logs -f mina-sidecar

Troubleshooting

If you get a 400 while running your sidecar:

INFO:root:Fetching block 2136...
INFO:root:Got block data
ERROR:root:HTTP Error 400: Bad Request

-- TRACEBACK --

ERROR:root:Sleeping for 30s and trying again

It likely means you're shipping off data to the ingest pipeline without any block producer key configured on your Mina node - since your BP key is your identity we can't accept node data since we don't know who is submitting it!

Need any help?

Post your questions in the #Delegation-Program channel on Mina Protocol Discord.