mirror of
https://github.com/nahuhh/basicswap-bash.git
synced 2025-01-03 09:29:39 +00:00
allow choosing Monero node type
This commit is contained in:
parent
b77f11500c
commit
9d603800af
2 changed files with 25 additions and 12 deletions
17
dep/setup.sh
17
dep/setup.sh
|
@ -19,13 +19,18 @@ pip3 install .
|
||||||
|
|
||||||
# Move scripts to /usr/local/bin
|
# Move scripts to /usr/local/bin
|
||||||
cd $SWAP_DATADIR
|
cd $SWAP_DATADIR
|
||||||
sudo mv -f -t /usr/local/bin/ basicswap-bash bsx-*
|
sudo mv -f -t /usr/local/bin/ basicswap-bash bsx*
|
||||||
sudo mkdir /usr/local/bin/bsx/
|
|
||||||
sudo mv -f -t /usr/local/bin/bsx/ dep/*
|
|
||||||
## Run basicswap-prepare with particl and monero
|
## Run basicswap-prepare with particl and monero
|
||||||
CURRENT_XMR_HEIGHT=$(curl "http://$monerod_addr:$monerod_port/get_info" | jq .height)
|
if [[ "$monerod_addr" && "$monerod_port" ]]; then
|
||||||
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
# Use remote Monero node
|
||||||
$red; echo -e "\n\nMake note of your seed above\n"; $nocolor
|
CURRENT_XMR_HEIGHT=$(curl "http://$monerod_addr:$monerod_port/get_info" | jq .height)
|
||||||
|
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
||||||
|
else # Use BasicSwapDEX's Monero node
|
||||||
|
CURRENT_XMR_HEIGHT=$(curl https://localmonero.co/blocks/api/get_stats | jq .height)
|
||||||
|
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
||||||
|
fi
|
||||||
|
$red; echo -e "\n\nMake note of your seed above\n"; $nocolor
|
||||||
echo 'Install complete.
|
echo 'Install complete.
|
||||||
|
|
||||||
Use `basicswap-bash` to run, `bsx-update` to update, and `bsx-addcoin` to add a coin'
|
Use `basicswap-bash` to run, `bsx-update` to update, and `bsx-addcoin` to add a coin'
|
||||||
|
|
20
install.sh
20
install.sh
|
@ -7,8 +7,7 @@ green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
nocolor="echo -e -n \e[0m"
|
||||||
|
|
||||||
# Title Bar
|
# Title Bar
|
||||||
$green
|
$green "\n"
|
||||||
echo -e "\n"
|
|
||||||
title="BasicSwapDEX installer"
|
title="BasicSwapDEX installer"
|
||||||
COLUMNS=$(tput cols)
|
COLUMNS=$(tput cols)
|
||||||
title_size=${#title}
|
title_size=${#title}
|
||||||
|
@ -19,10 +18,19 @@ printf "%${COLUMNS}s" " " | tr " " "*"
|
||||||
$nocolor
|
$nocolor
|
||||||
|
|
||||||
## Configure Monero node
|
## Configure Monero node
|
||||||
read -p $'\n\nEnter Address of Monero node [example: http://192.168.1.123] ' monerod_addr
|
echo -e "\n\n[1]Connect to a Monero node\n[2]Allow BasicSwapDEX to run a Monero node (+70GB)\n"
|
||||||
read -p 'Enter RPC Port for the Monero node [example: 18081] ' monerod_port
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
$green; printf $monerod_addr:$monerod_port; $nocolor
|
read -p 'Select an option: ' l
|
||||||
echo -e "\nPress any key to continue, or CTRL-C to exit." && read
|
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.'
|
||||||
|
|
||||||
## Update & Install dependencies
|
## Update & Install dependencies
|
||||||
sudo apt update
|
sudo apt update
|
||||||
|
|
Loading…
Reference in a new issue