diff --git a/README.md b/README.md index 00de220..65d9050 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,9 @@ cd basicswap-bash && ./install.sh # Running BasicSwapDEX `basicswap-bash` +# Add coins +`bsx-addcoin` +# Update BSX core +`bsx-update` +# Update blockchains +`bsx-upgrade-coins` diff --git a/bsx-addcoin b/bsx-addcoin new file mode 100755 index 0000000..ed317a7 --- /dev/null +++ b/bsx-addcoin @@ -0,0 +1,4 @@ +#!/bin/bash +export SWAP_DATADIR=$HOME/coinswaps +. $SWAP_DATADIR/venv/bin/activate && python -V +./dep/addcoin.sh diff --git a/bsx-update b/bsx-update new file mode 100755 index 0000000..a1b3c30 --- /dev/null +++ b/bsx-update @@ -0,0 +1,4 @@ +#!/bin/bash +export SWAP_DATADIR=$HOME/coinswaps +. $SWAP_DATADIR/venv/bin/activate && python -V +./dep/update.sh diff --git a/bsx-upgrade-coins b/bsx-upgrade-coins new file mode 100755 index 0000000..bac38b3 --- /dev/null +++ b/bsx-upgrade-coins @@ -0,0 +1,4 @@ +#!/bin/bash +export SWAP_DATADIR=$HOME/coinswaps +. $SWAP_DATADIR/venv/bin/activate && python -V +./dep/upgradecoins.sh diff --git a/dep/addcoin.sh b/dep/addcoin.sh new file mode 100755 index 0000000..0184b77 --- /dev/null +++ b/dep/addcoin.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +## Prompt for user input +echo -e "\n\nThe following coins can be added (case sensitive)\nbitcoin\ndash\nfiro\nlitecoin\nparticl\nPIVX\n" +read -p 'Full name of coin to add [example: litecoin] ' addcoin +## Confirm +echo -e "\nAdd $addcoin to your BasicSwap install, correct? Press any key to continue. CTRL-C to exit" +read +## Add the coin +if [ $addcoin = bitcoin ]; then + read -p 'Use --usebtcfastsync for bitcoin? [Y/n] ' btcfastsync + + case $btcfastsync in + n | N) confirmed=no;; + *) confirmed=yes;; + esac + + if [ $confirmed = yes ]; then + echo using btcfastsync + basicswap-prepare --usebtcfastsync --datadir=/$SWAP_DATADIR --addcoin=$addcoin + else + echo "not using btcfastsync" + basicswap-prepare --datadir=/$SWAP_DATADIR --addcoin=$addcoin + fi +else + echo "not using bitcoin, using $addcoin" + basicswap-prepare --datadir=/$SWAP_DATADIR --addcoin=$addcoin +fi diff --git a/dep/setup.sh b/dep/setup.sh index a1f5a98..140e7d9 100755 --- a/dep/setup.sh +++ b/dep/setup.sh @@ -12,10 +12,14 @@ pip3 install . cd $SWAP_DATADIR git clone https://github.com/tecnovert/basicswap.git cd $SWAP_DATADIR/basicswap + ## Install basicswap protoc -I=basicswap --python_out=basicswap basicswap/messages.proto pip3 install . -mv basicswap-bash dep/startup.sh /usr/local/bin + +# Move scripts to /usr/local/bin +cd $SWAP_DATADIR +sudo mv -f -t /usr/local/bin/ basicswap-bash bsx* dep ## Run basicswap-prepare with particl and monero CURRENT_XMR_HEIGHT=$(curl "http://$monerod_addr:$monerod_port/get_info" | jq .height) @@ -23,4 +27,4 @@ XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port basicswap-prepare --d echo -e "\n\nMake note of your seed above\n" echo 'Install complete. -Use `basicswap-bash` to run, `update.sh` to update, and `addcoin.sh` to add a coin' +Use `basicswap-bash` to run, `bsx-update` to update, and `bsx-addcoin` to add a coin' diff --git a/dep/update.sh b/dep/update.sh new file mode 100755 index 0000000..856087c --- /dev/null +++ b/dep/update.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd $SWAP_DATADIR/basicswap +git pull +pip3 install . diff --git a/dep/upgradecoins.sh b/dep/upgradecoins.sh new file mode 100755 index 0000000..b8c01c1 --- /dev/null +++ b/dep/upgradecoins.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +## Prompt for user input +echo "You can only update coins which you have already added to your install" +echo -e "\n\nList of coins supported by Basicswap (case sensitive):\nbitcoin\ndash\nfiro\nlitecoin\nparticl\nPIVX\n" +read -p 'Full name of coin to update [example: litecoin] ' updatecoin + +## Confirm +echo -e "\nUpdating $updatecoin, correct? Press any key to continue. CTRL-C to exit" +read + +## Update the coin +basicswap-prepare --datadir=$SWAP_DATADIR -preparebinonly --withcoins=$updatecoin +echo "updating $updatecoin"