🌱Aadam's Garden

Search

Search IconIcon to open search

How to run Althea testnet locally

Last updated Jan 3, 2023

This guide will show how to run a local testnet for Althea on Ubuntu. For a guide on running this test using Docker, see How to run Althea testnet locally using Docker.

# Prerequisites

I’m starting with a clean Ubuntu install.

# Install Wireguard

1
sudo apt-get update && sudo apt install -y wireguard linux-source linux-headers-$(uname -r) build-essential && sudo modprobe wireguard

# Clone Repo

1
2
git clone git@github.com:althea-net/althea_rs.git
cd althea_rs

# Add packages

Add postgresql PPA:

1
2
3
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
1
sudo apt install -y iputils-ping iproute2 jq netcat-openbsd default-libmysqlclient-dev libsqlite3-dev postgresql postgresql-client postgresql-server-dev libpq-dev python3-pip bridge-utils libssl-dev pkg-config ipset python3-setuptools python3-wheel dh-autoreconf procps iperf3

# Install Rust

1
2
curl https://sh.rustup.rs -sSf | sh
fish_add_path "$HOME/.cargo/bin"

# Run test script

Make sure that you’re in the althea_rs directory. It will save the output to output.txt in the althea_rs directory.

1
SPEEDTEST_THROUGHPUT="200" SPEEDTEST_DURATION="15" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 POSTGRES_USER=postgres POSTGRES_BIN=/usr/lib/postgresql/15/bin/postgres INITDB_BIN=/usr/lib/postgresql/15/bin/initdb bash integration-tests/rita.sh 2>&1 | tee output.txt

# Observe Wireguard tunnels

1
sudo ip netns exec netlab-5 wg

When run inside the container, or natively if you are running natively, this will run the command wg in the network namespace of rita-n5 instance.