init: introduce I2P connectivity options
Summary:
Introduce two new options to reach the I2P network:
- -i2psam=<ip:port> point to the I2P SAM proxy. If this is set then the I2P network is considered reachable and we can make outgoing connections to I2P peers via that proxy. We listen for and accept incoming connections from I2P peers if the below is set in addition to -i2psam=<ip:port>
- -i2pacceptincoming if this is set together with -i2psam=<ip:port> then we accept incoming I2P connections via the I2P SAM proxy.
Add functional tests.
This is a backport of core#20685 [15/20]
https://github.com/bitcoin/bitcoin/pull/20685/commits/76c35c60f338937071bcfad4211ef7254d3830ec
Test Plan:
ninja all check-all
Install i2prouter, start it (i2prouter start) , start the SAM bridge (can be done in a browser http://127.0.0.1:7657/configclients), then run:
ninja && src/bitcoind -regtest -i2psam=127.0.0.1:7656 -debug=i2p
At this point, it still does not do much, but the new command line options are accepted.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11027