2020-01-22 22:24:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2021-05-10 14:29:25 +01:00
|
|
|
# source aliases from /home/joinmarket/_aliases.sh
|
2023-06-15 20:32:41 +00:00
|
|
|
if [ -f /home/joinmarket/_aliases.sh ]; then
|
2021-10-02 14:04:20 +01:00
|
|
|
source /home/joinmarket/_aliases.sh
|
|
|
|
|
fi
|
2021-05-10 14:29:25 +01:00
|
|
|
|
2020-09-17 19:57:49 +01:00
|
|
|
# SHORTCUT COMMANDS for the user 'joinmarket'
|
2020-01-22 22:24:21 +00:00
|
|
|
|
|
|
|
|
# command: menu
|
|
|
|
|
# calls directly the main menu
|
|
|
|
|
function menu() {
|
2020-10-28 14:06:38 +00:00
|
|
|
/home/joinmarket/menu.sh
|
2020-01-22 22:24:21 +00:00
|
|
|
}
|
2020-05-08 21:59:30 +01:00
|
|
|
|
2021-06-13 23:56:23 +00:00
|
|
|
# command: newnym
|
2023-06-15 20:32:41 +00:00
|
|
|
function newnym() {
|
2021-06-13 23:56:23 +00:00
|
|
|
if [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "runBehindTor=on")" -eq 1 ]; then
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Changing Tor circuits..."
|
|
|
|
|
echo "# Savind old ID..."
|
2021-06-13 23:56:23 +00:00
|
|
|
oldID=$(curl --connect-timeout 15 --socks5-hostname 127.0.0.1:9050 ifconfig.me 2>/dev/null)
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Requesting new identity ..."
|
|
|
|
|
sudo -u debian-tor python3 /home/joinmarket/tor.newnym.py
|
2021-06-13 23:56:23 +00:00
|
|
|
sleep 3
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Savind new ID..."
|
2021-06-13 23:56:23 +00:00
|
|
|
newID=$(curl --connect-timeout 15 --socks5-hostname 127.0.0.1:9050 ifconfig.me 2>/dev/null)
|
|
|
|
|
echo
|
|
|
|
|
if [ ${oldID} = ${newID} ]; then
|
2023-06-15 20:32:41 +00:00
|
|
|
echo "# FAIL: Identity did not change. Read error message above."
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Exiting for precaution."
|
2021-06-13 23:56:23 +00:00
|
|
|
exit 0
|
|
|
|
|
else
|
2023-06-15 20:32:41 +00:00
|
|
|
echo "# SUCCESS"
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Old id: " ${oldID}
|
|
|
|
|
echo "# New id: " ${newID}
|
2021-06-13 23:56:23 +00:00
|
|
|
fi
|
|
|
|
|
else
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Not running behind Tor"
|
2021-06-13 23:56:23 +00:00
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 21:59:30 +01:00
|
|
|
# command: torthistx
|
|
|
|
|
function torthistx() {
|
2023-06-15 20:32:41 +00:00
|
|
|
if [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "runBehindTor=on")" -eq 1 ]; then
|
2021-03-10 09:49:22 +00:00
|
|
|
echo
|
2021-06-14 14:18:03 +01:00
|
|
|
if [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "network=signet")" -eq 1 ]; then
|
|
|
|
|
newnym
|
|
|
|
|
echo
|
|
|
|
|
echo "# Broadcasts a transaction through Tor to Blockstream's API and into the network..."
|
|
|
|
|
echo
|
|
|
|
|
echo "# Transaction ID:"
|
|
|
|
|
curl --socks5-hostname localhost:9050 -d "$1" -X POST https://mempool.space/signet/api/tx
|
|
|
|
|
else
|
|
|
|
|
echo "# Broadcasts a transaction through Tor to Blockstream's API and into the network..."
|
|
|
|
|
echo
|
|
|
|
|
echo "# Transaction ID:"
|
|
|
|
|
curl --socks5-hostname localhost:9050 -d "$1" -X POST http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/api/tx
|
|
|
|
|
fi
|
2020-05-08 21:59:30 +01:00
|
|
|
else
|
2021-06-14 14:18:03 +01:00
|
|
|
echo "# Not running behind Tor"
|
2020-05-08 21:59:30 +01:00
|
|
|
fi
|
|
|
|
|
}
|
2020-09-30 13:58:32 +01:00
|
|
|
|
|
|
|
|
# command: stats
|
|
|
|
|
# shows the uptime and the fees earned as a Maker
|
|
|
|
|
function stats() {
|
2020-10-28 14:06:38 +00:00
|
|
|
/home/joinmarket/info.stats.sh
|
2020-10-06 10:40:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# command: qtgui
|
|
|
|
|
# starts the JoinMarket-QT GUI
|
|
|
|
|
function qtgui() {
|
2021-10-03 00:33:10 +01:00
|
|
|
if grep -Eq "RPCoverTor=on" /home/joinmarket/joinin.conf; then
|
|
|
|
|
tor="torsocks"
|
|
|
|
|
else
|
|
|
|
|
tor=""
|
|
|
|
|
fi
|
2022-03-06 13:41:40 +00:00
|
|
|
|
2021-10-03 00:33:10 +01:00
|
|
|
echo "# Opening the JoinMarket-QT GUI with the command: '(jmvenv) $tor python joinmarket-qt.py'"
|
|
|
|
|
$tor /home/joinmarket/joinmarket-clientserver/jmvenv/bin/python /home/joinmarket/joinmarket-clientserver/scripts/joinmarket-qt.py
|
2021-02-05 19:02:18 +00:00
|
|
|
}
|
|
|
|
|
|
2021-03-04 14:00:22 +00:00
|
|
|
# command: qr [string]
|
|
|
|
|
# shows a QR code from the string
|
|
|
|
|
function qr() {
|
2021-03-04 20:27:52 +00:00
|
|
|
if [ ${#1} -eq 0 ]; then
|
2021-03-04 14:00:22 +00:00
|
|
|
echo "# Error='missing string'"
|
|
|
|
|
fi
|
2021-03-04 18:29:03 +00:00
|
|
|
echo
|
|
|
|
|
echo "Displaying the text:"
|
|
|
|
|
echo "$1"
|
|
|
|
|
echo
|
2021-03-04 20:27:52 +00:00
|
|
|
qrencode -t ANSIUTF8 "${1}"
|
2021-03-04 14:00:22 +00:00
|
|
|
echo "(To shrink QR code: MacOS press CMD- / Linux press CTRL-)"
|
2021-03-04 18:29:03 +00:00
|
|
|
echo
|
2021-03-04 14:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
2021-02-05 19:02:18 +00:00
|
|
|
alias signet-cli="/home/joinmarket/bitcoin/bitcoin-cli -signet"
|
|
|
|
|
alias signetd="/home/joinmarket/bitcoin/bitcoind -signet"
|