-
Notifications
You must be signed in to change notification settings - Fork 4
Installation | Ubuntu & Debian
The following guide can be used for installation on Ubuntu or Debian.
- Install MongoDB
- Make sure Python 3.8 or higher is installed
- Install dependencies
- Clone the repository
- Install, create and activate a virtual environment
- Install pip requirements
- Deactivate virtual environment
- Run the bot
We use MongoDB as the backend database for all trade and market data, make sure to install MongoDB on your system before continuing.
Make sure MongoDB is running upon continuing.
Unless you know what you are doing... make sure to install at least the following OS versions, which have python3.8 or higher already pre-installed to the system.
- Debian Bullseye or higher
- Ubuntu 20.04 or higher
- Raspbian Buster or higher
After installing the requirements, you need to install a few additional packages:
# update repository
sudo apt-get update
# install packages
sudo apt-get install -y python3-pip python3-venv python3-dev git curl
⚠️ Version considerationsWhen cloning the repository, the default working branch is 'main', this branch contains the latest stable release of HODLv2. You may also choose to use a feature branch, which contains all new features but could include bugs that can break the system. Use feature branches with caution.
You can now clone HODLv2 into your desired project directory from the hodlv2 GitHub repository:
# Choose between stable or unstable (new features).
# for stable (main)
git clone https://github.com/p0ntsnl/hodlv2.git
cd hodlv2
git checkout main # should be already checked in
From the project directory, run the following commands to install, create and activate a virtual environment.
#install virtualenv
pip3 install virtualenv
# create virtual env
python3 -m venv env
# activate virtual env
source env/bin/activate
You should notice that your terminal path includes env, signifying an activated virtual environment.
(env) p0nts@odroid:~/home/p0nts/hodlv2/#
Now you can install the desired pip3 dependencies inside your isolated virtual environment:
# install pip3 requirements
pip3 install -r requirements.txt
You are now finished, the virtual environment is equipped with everything it needs to run the bot. You can deactivate the virtual environment by running deactivate
.
Your terminal should now be back to normal.
p0nts@odroid:~/home/p0nts/hodlv2/#
# add project directory to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:<path_to_hodlv2>
# start bot
env/bin/python3 hodlv2/main.py
# Start the web-interface (default: 0.0.0.0:8080)
env/bin/python3 hodlv2/web/run.py
If everything is ok:
- You should see the following message in your console:
Starting HODLv2 <version>
- You should be able to visit the web-interface through: http://localhost:8080 (or different if you've updated config.py)
In the root of the repository, you can find hodlv2-bot.service
and hodlv2-web.service
. Move these over to systemd, update the paths, reload the daemon and start the bot through systemd.
# move service files to the correct directory
cp hodlv2-bot.service /etc/systemd/system/hodlv2-bot.service
cp hodlv2-web.service /etc/systemd/system/hodlv2-web.service
# edit WorkingDirectory / Environment / ExecStart in both files
vi /etc/systemd/system/hodlv2-bot.service
vi /etc/systemd/system/hodlv2-web.service
# reload systemd daemon
systemctl daemon-reload
# Start the bot
systemctl start hodlv2-bot
# Start the web-interface
systemctl start hodlv2-web
If everything is ok:
- You should see the following message in your console:
Starting HODLv2 <version>
- You should be able to visit the web-interface through: http://localhost:8080 (or different if you've updated config.py)