basicswap-bash/install.sh

51 lines
1.6 KiB
Bash
Raw Permalink Normal View History

2024-01-21 22:34:44 +00:00
#/bin/bash
# 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
2024-01-26 10:31:51 +00:00
$green "\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-26 10:31:51 +00:00
echo -e "\n\n[1]Connect to a Monero node\n[2]Allow BasicSwapDEX to run a Monero node (+70GB)\n"
until [[ "$l" =~ ^[12]$ ]]; do
read -p 'Select an option: ' l
case $l in
1) read -p 'Enter Address of Monero node [example: 192.168.1.123] ' monerod_addr
read -p 'Enter RPC Port for the Monero node [example: 18081] ' monerod_port
$green "Look good? $monerod_addr:$monerod_port"; $nocolor;;
2) $green "\nBasicSwapDEX will run the Monero node for you."; $nocolor;;
*) $red "\nYou must answer 1 or 2\n"; $nocolor;;
esac
done
echo -e "\nShall we begin?"
read -p 'Press any key to continue, or CTRL-C to exit.'
2024-01-21 22:34:44 +00:00
## Update & Install dependencies
sudo apt update
2024-01-30 16:19:59 +00:00
# python-is-python3 for ubuntu
sudo apt install -y git wget python-is-python3 python3-full python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config curl jq
2024-01-30 14:52:48 +00:00
# Move scripts to /usr/local/bin
sudo rm -r /usr/local/bin/bsx # Remove old
sudo mv -f -t /usr/local/bin/ basicswap-bash bsx* # Add new
2024-01-21 22:34:44 +00:00
## 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
2024-01-30 14:52:48 +00:00
/usr/local/bin/bsx/activate_venv.sh