2024-01-21 22:34:44 +00:00
|
|
|
#/bin/bash
|
|
|
|
|
2024-01-22 22:06:38 +00:00
|
|
|
# Colors
|
|
|
|
cyan="echo -e -n \e[36;1m"
|
|
|
|
red="echo -e -n \e[31;1m"
|
|
|
|
green="echo -e -n \e[32;1m"
|
|
|
|
nocolor="echo -e -n \e[0m"
|
|
|
|
|
|
|
|
# Title Bar
|
|
|
|
$green
|
|
|
|
echo -e "\n"
|
|
|
|
title="BasicSwapDEX installer"
|
|
|
|
COLUMNS=$(tput cols)
|
|
|
|
title_size=${#title}
|
|
|
|
span=$(((COLUMNS + title_size) / 2))
|
|
|
|
printf "%${COLUMNS}s" " " | tr " " "*"
|
|
|
|
printf "%${span}s\n" "$title"
|
|
|
|
printf "%${COLUMNS}s" " " | tr " " "*"
|
|
|
|
$nocolor
|
|
|
|
|
2024-01-21 22:34:44 +00:00
|
|
|
## Configure Monero node
|
2024-01-22 22:06:38 +00:00
|
|
|
read -p $'\n\nEnter Address of Monero node [example: http://192.168.1.123] ' monerod_addr
|
2024-01-21 22:34:44 +00:00
|
|
|
read -p 'Enter RPC Port for the Monero node [example: 18081] ' monerod_port
|
2024-01-22 22:06:38 +00:00
|
|
|
$green; printf $monerod_addr:$monerod_port; $nocolor
|
|
|
|
echo -e "\nPress any key to continue, or CTRL-C to exit." && read
|
2024-01-21 22:34:44 +00:00
|
|
|
|
|
|
|
## Update & Install dependencies
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y git wget python3-full python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config curl jq
|
|
|
|
|
|
|
|
## Make venv
|
|
|
|
export SWAP_DATADIR=$HOME/coinswaps
|
|
|
|
export monerod_addr=$monerod_addr
|
|
|
|
export monerod_port=$monerod_port
|
|
|
|
mkdir -p "$SWAP_DATADIR/venv"
|
|
|
|
python3 -m venv "$SWAP_DATADIR/venv"
|
|
|
|
|
|
|
|
## Activate venv
|
|
|
|
./dep/activate_venv.sh
|