2020-01-25 01:15:38 +01:00
|
|
|
#!/bin/bash
|
|
|
|
clear
|
|
|
|
|
|
|
|
# load raspiblitz config data
|
|
|
|
source /home/admin/raspiblitz.info
|
|
|
|
source /mnt/hdd/raspiblitz.conf
|
|
|
|
|
|
|
|
# make sure txindex and wallet of bitcoin is on
|
|
|
|
/home/admin/config.scripts/network.wallet.sh on
|
|
|
|
/home/admin/config.scripts/network.txindex.sh on
|
|
|
|
|
|
|
|
# extract RPC credentials from bitcoin.conf - store only in var
|
|
|
|
RPC_USER=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
|
|
|
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
|
2021-04-14 20:19:35 +01:00
|
|
|
|
2021-04-20 00:26:49 +02:00
|
|
|
if [ "${chain}net" == "mainnet" ]; then
|
2021-04-14 20:19:35 +01:00
|
|
|
BITCOINRPCPORT=8332
|
2021-04-20 00:26:49 +02:00
|
|
|
elif [ "${chain}net" == "testnet" ]; then
|
2021-04-14 20:19:35 +01:00
|
|
|
BITCOINRPCPORT=18332
|
2021-04-20 00:26:49 +02:00
|
|
|
elif [ "${chain}net" == "signet" ]; then
|
2021-04-14 20:19:35 +01:00
|
|
|
BITCOINRPCPORT=38332
|
|
|
|
fi
|
|
|
|
|
2021-12-14 23:34:35 +01:00
|
|
|
# check and set up the HS
|
|
|
|
/home/admin/config.scripts/tor.onion-service.sh bitcoin${BITCOINRPCPORT} ${BITCOINRPCPORT} ${BITCOINRPCPORT}
|
2021-04-14 20:19:35 +01:00
|
|
|
|
|
|
|
hiddenService=$(sudo cat /mnt/hdd/tor/bitcoin${BITCOINRPCPORT}/hostname)
|
2021-08-17 14:56:10 +01:00
|
|
|
# https://github.com/rootzoll/raspiblitz/issues/2339
|
|
|
|
if [ ${#hiddenService} -eq 0 ];then
|
|
|
|
hiddenService=$(sudo cat /mnt/hdd/tor/bitcoin/hostname)
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "# The Hidden Service for bitcoind port ${BITCOINRPCPORT} is:"
|
|
|
|
echo "${hiddenService}"
|
2020-01-25 01:15:38 +01:00
|
|
|
|
2021-12-14 23:34:35 +01:00
|
|
|
# btcstandup://<rpcuser>:<rpcpassword>@<hidden service hostname>:<hidden service port>/?label=<optional node label>
|
2021-08-17 14:56:10 +01:00
|
|
|
quickConnect="btcstandup://${RPC_USER}:${PASSWORD_B}@${hiddenService}:${BITCOINRPCPORT}/?label=${hostname}"
|
2021-04-14 20:19:35 +01:00
|
|
|
echo
|
2020-01-25 01:15:38 +01:00
|
|
|
echo "scan the QR Code with Fully Noded to connect to your node:"
|
2022-02-13 12:23:34 +00:00
|
|
|
sudo /home/admin/config.scripts/blitz.display.sh qr "${quickConnect}"
|
2020-01-25 01:15:38 +01:00
|
|
|
qrencode -t ANSI256 $quickConnect
|
|
|
|
echo "Press ENTER to return to the menu"
|
2020-01-25 01:32:06 +01:00
|
|
|
read key
|
2020-01-25 01:33:01 +01:00
|
|
|
|
|
|
|
# clean up
|
2022-02-13 12:23:34 +00:00
|
|
|
sudo /home/admin/config.scripts/blitz.display.sh hide
|
2020-01-25 01:33:01 +01:00
|
|
|
clear
|