Activate i2p more reliably (#4265)

* move the i2p setup after the last bitcoin.conf check
* redo config even if i2p is active
This commit is contained in:
openoms 2023-11-22 13:03:07 +01:00 committed by GitHub
parent 624f8ca1a7
commit 37c8f6f897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View file

@ -210,11 +210,6 @@ else
echo "Provisioning Bitcoin Core interims update - keep default" >> ${logFile} echo "Provisioning Bitcoin Core interims update - keep default" >> ${logFile}
fi fi
# I2P
echo "Start i2pd" >> ${logFile}
/home/admin/_cache.sh set message "i2pd setup"
/home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile}
# LND INTERIMS UPDATE # LND INTERIMS UPDATE
if [ ${#lndInterimsUpdate} -gt 0 ]; then if [ ${#lndInterimsUpdate} -gt 0 ]; then
/home/admin/_cache.sh set message "Provisioning LND update" /home/admin/_cache.sh set message "Provisioning LND update"
@ -811,6 +806,11 @@ if [ ${confExists} -eq 0 ]; then
chown bitcoin:bitcoin /mnt/hdd/bitcoin/bitcoin.conf chown bitcoin:bitcoin /mnt/hdd/bitcoin/bitcoin.conf
fi fi
# I2P
echo "Start i2pd" >> ${logFile}
/home/admin/_cache.sh set message "i2pd setup"
/home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile}
# signal setup done # signal setup done
/home/admin/_cache.sh set message "Setup Done" /home/admin/_cache.sh set message "Setup Done"

View file

@ -92,7 +92,7 @@ function bitcoinI2Pstatus {
echo "# Follow live with the command:" echo "# Follow live with the command:"
echo "sudo tail -n 1000 -f /mnt/hdd/bitcoin/debug.log | grep i2p" echo "sudo tail -n 1000 -f /mnt/hdd/bitcoin/debug.log | grep i2p"
echo echo
sudo cat /mnt/hdd/bitcoin/debug.log | grep i2p sudo cat /mnt/hdd/bitcoin/debug.log | grep i2p
echo echo
echo "# Running the command:" echo "# Running the command:"
echo "bitcoin-cli -netinfo 4" echo "bitcoin-cli -netinfo 4"
@ -107,7 +107,6 @@ function bitcoinI2Pstatus {
echo echo
} }
echo "# Running: 'blitz.i2pd.sh $*'" echo "# Running: 'blitz.i2pd.sh $*'"
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
@ -145,12 +144,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
if systemctl is-active --quiet i2pd.service; then if systemctl is-active --quiet i2pd.service; then
echo "# i2pd.service is already active." echo "# i2pd.service is already active."
exit 0 else
echo "# sudo systemctl enable i2pd"
sudo systemctl enable i2pd
fi fi
echo "# sudo systemctl enable i2pd"
sudo systemctl enable i2pd
echo "# i2pd config" echo "# i2pd config"
/home/admin/config.scripts/blitz.conf.sh set debug tor /mnt/hdd/bitcoin/bitcoin.conf noquotes /home/admin/config.scripts/blitz.conf.sh set debug tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
confAdd debug i2p /mnt/hdd/bitcoin/bitcoin.conf confAdd debug i2p /mnt/hdd/bitcoin/bitcoin.conf
@ -159,7 +157,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes /home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
confAdd onlynet i2p /mnt/hdd/bitcoin/bitcoin.conf confAdd onlynet i2p /mnt/hdd/bitcoin/bitcoin.conf
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
cat << EOF | sudo tee /etc/i2pd/i2pd.conf cat <<EOF | sudo tee /etc/i2pd/i2pd.conf
# i2pd settings for the RaspiBlitz # i2pd settings for the RaspiBlitz
# for the defaults see: # for the defaults see:
# https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/i2pd.conf # https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/i2pd.conf
@ -212,6 +210,7 @@ EOF
# setting value in raspiblitz.conf # setting value in raspiblitz.conf
/home/admin/config.scripts/blitz.conf.sh set i2pd "on" /home/admin/config.scripts/blitz.conf.sh set i2pd "on"
localip=$(hostname -I | awk '{print $1}')
echo "# Config: /etc/i2pd/i2pd.conf" echo "# Config: /etc/i2pd/i2pd.conf"
echo "# i2pd web console: ${localip}:7070" echo "# i2pd web console: ${localip}:7070"
echo "# Monitor i2p in bitcoind:" echo "# Monitor i2p in bitcoind:"