Creating a local development environment¶
Intro¶
This document describes the environment and the set of steps aiming to create a local development and debugging environment.
Prerequisites¶
- OS: Any officially supported versions of Ubuntu. For more information, see System requirements.
Dependencies¶
Installation¶
Create a new user (optional)¶
For development purposes recommended not to use root user. Command below will create a new Ubuntu user.
Install Java 21¶
Install SBT¶
sudo apt-get update
sudo apt-get install apt-transport-https curl gnupg -yqq
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
sudo apt-get update
sudo apt-get install sbt
Install Postgresql¶
Configure firewall rule for Postgresql port 5432¶
Create a new DB¶
sudo -u postgres psql
postgres=# CREATE USER new_user WITH PASSWORD 'password';
postgres=# CREATE DATABASE horizon OWNER new_user;
\q
Test connection to DB¶
Export environment variables¶
export EXCHANGE_DB_NAME=openhorizon
export EXCHANGE_DB_PW=password
export EXCHANGE_DB_USER=new_user
export EXCHANGE_ROOT_PW=root_password