Midgard - Linux

Setting up Midgard on Linux

The steps shown here are tested on Ubuntu 24.04, different distributions may need adjustments to the commands.

All commands are meant to be run as root user, if not specified otherwise. Depending on the server installation, they may need to be run from a different user via sudo.

Prerequisites

Install all needed packages for building and running midgard

apt install -y --no-install-recommends apt-transport-https gcc gnupg lsb-release postgresql postgresql-common wget

Application user

Add the application user that is used to run the thornode daemon

useradd -m midgard -s /bin/bash

Database

Install TimescaleDB

Run the PostgreSQL package setup script

/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

Add the TimescaleDB package

echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list

Install the TimescaleDB GPG key

Update your local repository list and install TimescaleDB

Tune your PostgreSQL instance for TimescaleDB

Restart PostgreSQL

Create midgard database

Install TimescaleDB extension

Connect to the database

Add TimescaleDB to the database

Check that TimescaleDB is installed

Install

As midgard user run:

Configuration

As midgard user run:

Add midgard config

Systemd

Create a service file to be able to manage the Midgard process via systemd

Reload systemd config

Start

Start the daemon

Last updated