How can I use Bitcoin Core with the anonymous network protocol I2P? How can I use Bitcoin Core with the I2P anonymous network protocol?
Jon Atack answered this on Twitter. First install and start I2P (version 2.35 or above).
$ apt install i2pd
$ systemctl enable i2pd.service
$ systemctl start i2pd.service

In your bitcoin.conf file add (I will assume you run Bitcoin Core v22+ and want to use both Tor and I2P but remove debug=tor and onlynet=onion if not interested in Tor):
debug=tor
debug=i2p
onlynet=onion
onlynet=i2p
i2psam=127.0.0.1:7656

There are 2 config options for I2P. Only the second one is required to be set for I2P to work.
  -i2pacceptincoming
       If set and -i2psam is also set then incoming I2P connections are
       accepted via the SAM proxy. If this is not set but -i2psam is set
       then only outgoing connections will be made to the I2P network.
       Ignored if -i2psam is not set. Listening for incoming I2P
       connections is done through the SAM proxy, not by binding to a
       local address and port (default: 1)

  -i2psam=&lt;ip:port&gt;
       I2P SAM proxy to reach I2P peers and accept I2P connections (default:
       none)

Then to view your I2P peers:
watch -t ./src/bitcoin-cli -netinfo 4
(For more information on -netinfo see the help documentation using bitcoin-cli -netinfo help or this StackExchange question)

This was enabled by Vasil Dimov's Bitcoin Core PR 20685 merged in March 2021 and BIP 155 for addrv2 messages
Historical discussion of supporting I2P back in 2012 is here. (Thanks to Adam Jonas for finding this)