mynodebtc / mynode

The easiest way to run Bitcoin and Lightning!
Other
627 stars 143 forks source link

I2P not connecting Bitcoin #711

Closed tukac closed 1 year ago

tukac commented 1 year ago

I2P seems not working.

MyNode 0.3.03, Rpi4 8Gb, 1Tb SSD

I have reset bitcoin config to default and enabled I2P in Settings. However, after reboot no I2P connections were established according to bitcoin log and no connections were shown after command watch -t bitcoin-cli -netinfo

I tried manually starting I2P...

admin@myNode:~ $ sudo systemctl enable i2p
[sudo] password for admin: 
Failed to enable unit: Unit file i2p.service does not exist.

I2P seems not installed.

I run:

sudo apt-get update
sudo apt-get upgrade
sudo apt install i2p

Then enabled i2p:


admin@myNode:~ $ sudo systemctl enable i2p
Synchronizing state of i2p.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable i2p
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MONETARY = "de_DE.UTF-8",
    LC_ADDRESS = "de_DE.UTF-8",
    LC_TELEPHONE = "de_DE.UTF-8",
    LC_NAME = "de_DE.UTF-8",
    LC_MEASUREMENT = "de_DE.UTF-8",
    LC_IDENTIFICATION = "de_DE.UTF-8",
    LC_NUMERIC = "de_DE.UTF-8",
    LC_PAPER = "de_DE.UTF-8",
    LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MONETARY = "de_DE.UTF-8",
    LC_ADDRESS = "de_DE.UTF-8",
    LC_TELEPHONE = "de_DE.UTF-8",
    LC_NAME = "de_DE.UTF-8",
    LC_MEASUREMENT = "de_DE.UTF-8",
    LC_IDENTIFICATION = "de_DE.UTF-8",
    LC_NUMERIC = "de_DE.UTF-8",
    LC_PAPER = "de_DE.UTF-8",
    LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").

I2P seems running now. Status:

admin@myNode:~ $ systemctl status i2p
● i2p.service - load-balanced unspoofable packet switching network
   Loaded: loaded (/lib/systemd/system/i2p.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2022-10-16 12:56:47 CDT; 2h 19min ago
 Main PID: 694 (wrapper)
    Tasks: 119 (limit: 4915)
   CGroup: /system.slice/i2p.service
           ├─694 /usr/sbin/wrapper /etc/i2p/wrapper.config wrapper.java.additional.1=-DloggerFilenameOverride=/var/log/i2p/log-router-@.txt wrapper.java.additional.10=
           └─699 /usr/lib/jvm/java-11-openjdk-arm64/bin/java -DloggerFilenameOverride=/var/log/i2p/log-router-@.txt -Di2p.dir.base=/usr/share/i2p -Dwrapper.logfile=/va
lines 1-8/8 (END)

However after several hours bitcoin-cli getnetworkinfo doesn't show I2P address, neither does watch -t bitcoin-cli -netinfo, neither does bitcoin log show successful I2P connections.

I went to https://geti2p.net

I added new repository from instructions on https://geti2p.net:

sudo apt install software-properties-common
sudo apt-get update
sudo apt-get upgrade
sudo apt-add-repository ppa:i2p-maintainers/i2p
sudo apt-get install apt-transport-https lsb-release curl

...and followed instructions for Debian Buster:

echo "deb https://deb.i2p2.de/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/i2p.list
curl -o i2p-archive-keyring.gpg https://geti2p.net/_static/i2p-archive-keyring.gpg
gpg --keyid-format long --import --import-options show-only --with-fingerprint i2p-archive-keyring.gpg
sudo cp ~/i2p-archive-keyring.gpg /usr/share/keyrings
sudo apt-get install i2p i2p-keyring
sudo apt-get update
sudo apt-get upgrade
i2prouter start

However, no I2P connections were established either. This is where I stopped.

tehelsper commented 1 year ago

A couple things:

tukac commented 1 year ago

It looks i2pd service didn't start automatically:

admin@myNode:~ $ systemctl status i2pd
● i2pd.service - I2P Router written in C++
   Loaded: loaded (/lib/systemd/system/i2pd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:i2pd(1)
           https://i2pd.readthedocs.io/en/latest/

I started it (requires sudo)...

admin@myNode:~ $ systemctl start i2pd
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'i2pd.service'.
Authenticating as: admin
Password: 
==== AUTHENTICATION COMPLETE ===

Now is up:

admin@myNode:~ $ systemctl status i2pd
● i2pd.service - I2P Router written in C++
   Loaded: loaded (/lib/systemd/system/i2pd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-10-17 07:43:15 CDT; 3s ago
     Docs: man:i2pd(1)
           https://i2pd.readthedocs.io/en/latest/
  Process: 18380 ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pi
 Main PID: 18381 (i2pd)
    Tasks: 12 (limit: 4915)
   CGroup: /system.slice/i2pd.service
           └─18381 /usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logf
lines 1-10/10 (END)

I added few i2p peers to bitcoin config...

addnode=liu75cvktv4icbctg72w7nxbk4eibt7wamizfdii4omz7gcke5vq.b32.i2p
addnode=3oa5fycx3tyechdfgootxcpap7sx7p3sawenrbzyyxrty74rt7zq.b32.i2p
addnode=ys7np3pmfhiyq3z2rcoeylb7agfbyfuhhp7ky2uzvvuzswad6cia.b32.i2p

... and rebooted. After reboot systemctl status i2pd returned active(running). I don't know why it didn't start automatically first time, but now it does. Nice. :)

Feature request: on Settings > Networking it would be useful to warn changes won't make effect if customized bitcoin or lnd config.

I am closing this issue, thanks!