Skip to content

Conversation

vasild
Copy link
Contributor

@vasild vasild commented Jun 15, 2021

Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

@vasild
Copy link
Contributor Author

vasild commented Jun 15, 2021

@fanquake fanquake added the Docs label Jun 15, 2021
@vasild
Copy link
Contributor Author

vasild commented Jun 15, 2021

@jonatack
Copy link
Member

Concept ACK!

Can be merged after FF but is needed before release.

@fanquake
Copy link
Member

Can be merged after FF

Why after feature freeze? I can't see why this couldn't be merged at any time.

@jonatack
Copy link
Member

That it's ok if it isn't merged today.

@maflcko
Copy link
Member

maflcko commented Jun 15, 2021

Missing a link to the new doc from the main file doc/Readme.md?

@theStack
Copy link
Contributor

Concept ACK

@ghost
Copy link

ghost commented Jun 15, 2021

Concept ACK

nit: Docs mention i2p 'router' is required, this can be confusing for some users. I had to use i2pd (C++) instead of i2prouter (Java) last time I tried i2p in Bitcoin Core.

Related comments:

#20685 (comment)

#20685 (comment)

#20685 (comment)

Will test again today on POP!_OS.

@ghost
Copy link

ghost commented Jun 15, 2021

Tried on POP!_OS and had no issues except last step:

  1. Install i2pd using instructions mentioned for Ubuntu: https://i2pd.readthedocs.io/en/latest/user-guide/install/

  2. Run: sudo systemctl start i2pd.service

  3. Confirm if running: ss -nlt

    State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
             
    LISTEN  0        4096           127.0.0.1:7656           0.0.0.0:*  
    
  4. bitcoin.conf:

    testnet=1
    i2psam=127.0.0.1:7656
    i2pacceptincoming=1
    debug=i2p
    
  5. Run bitcoind

  6. Check debug.log:

    2021-06-15T20:36:16Z i2paccept thread start
    2021-06-15T20:36:16Z I2P: Creating SAM session with 127.0.0.1:7656
    
    2021-06-15T20:36:56Z I2P: SAM session created: session id=3e0f35228b, my address=bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333
    2021-06-15T20:36:56Z AddLocal(bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333,4)
    
  7. Confirm i2p_private_key was created:

    ~/.bitcoin/testnet3$ ls
    
    anchors.dat  chainstate         i2p_private_key  settings.json
    banlist.dat  debug.log          mempool.dat      wallets
    blocks       fee_estimates.dat  peers.dat
    
  8. bitcoin-cli -netinfo returns i2p address but no column for i2p peers

    Bitcoin Core v21.99.0-eb63b1db2c4d testnet - 70016/Satoshi:21.99.0/
    
            ipv4    ipv6   onion   total   block
    in         0       0       0       0
    out       10       0       0      10       2
    total     10       0       0      10
    
    Local addresses
    bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p     port  18333    score      4
    

@jonatack
Copy link
Member

-netinfo displays an I2P column if you have any I2P connections; addnode any of the I2P addresses in contrib/seeds/nodes_main.txt and you will see the connection in -netinfo.

@laanwj laanwj added this to the 22.0 milestone Jun 17, 2021
doc/i2p.md Outdated
- in the output of the CLI `-netinfo` peer connections dashboard

To see to which I2P peers your node is connected, use `bitcoin-cli -netinfo 4`
or the RPC `getpeerinfo` (e.g. `bitcoin-cli getpeerinfo`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention that you can see which I2P addresses your node knows with RPC getnodeaddresses 0 i2p and (maybe, not sure) that there are I2P seed nodes to bootstrap your I2P connections in /contrib/seeds/nodes_main.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added getnodeaddresses 0 i2p, but not the seeds mention.

Actually, we use the seeds to fill addrman / establish a connection if we don't have any. But as far as I am aware we do this regardless of the network. Should we do that per-network? I.e. make sure we establish at least one connection to Tor if the user has bothered to setup a Tor proxy, using the seeds if necessary? Same for I2P.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good idea. IRC discussion: https://www.erisian.com.au/bitcoin-core-dev/log-2021-06-18.html#l-289

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The few times I talked people through testing an I2P service, each time they needed an I2P address to connect to or wouldn't see one. @prayank23's review is another good example 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(N being either I2P or Tor). If N is configured, make sure we have at least one connection to N (either inbound or outbound). If nobody connects to us, then try to open a connection to a peer from N (using either the seeds or addresses received via gossip)".

This will help I2P now / 22.0. But it is too late for 22.0.

For 23.0 it may not be necessary for I2P if it gains traction quickly. I am not sure if Tor needs it at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If demonstrated to be an issue, it may (possibly) not be too late.

@jonatack
Copy link
Member

ACK, modulo the comments. I was wondering if we should warn that i2pd needs to be a version more recent than 2.33.0 due to the issues Suhas experienced with it, but mentioning i2pd can be done in a follow-up, if desired.

@laanwj
Copy link
Member

laanwj commented Jun 18, 2021

I was wondering if we should warn that i2pd needs to be a version more recent than 2.33.0 due to the issues Suhas experienced with it, but mentioning i2pd can be done in a follow-up

Was about to comment this as well, but I guess we cannot really recommend any version of i2pd at this point at all due to known crash issues? In any case, I agree it can be done later if at all.

@ghost
Copy link

ghost commented Jun 18, 2021

I have nothing more to add in review apart from my comments above. Would be helpful if someone could answer this question on SE: https://bitcoin.stackexchange.com/questions/107060/tor-and-i2p-tradeoffs-in-bitcoin-core

@vasild
Copy link
Contributor Author

vasild commented Jun 18, 2021

2f689c9bfe...28fb34a275: address suggestions

@vasild
Copy link
Contributor Author

vasild commented Jun 18, 2021

28fb34a275...e498c9292a: remove redundant word

Render: https://github.com/bitcoin/bitcoin/blob/e498c9292af233c33616dcee2fe749ecb85fa186/doc/i2p.md

@vasild
Copy link
Contributor Author

vasild commented Jun 18, 2021

@prayank23, I added a link to the I2P glossary https://geti2p.net/en/about/glossary, I think "I2P router" in general means an I2P proxy not the specific implementation in Java.

## Run Bitcoin Core with an I2P router (proxy)

A running I2P router (proxy) with [SAM](https://geti2p.net/en/docs/api/samv3)
enabled is required (there is an [official one](https://geti2p.net) and
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This official link has one 'download' button, it will open https://geti2p.net/en/download which has options for different OS. If you try installing i2p for Ubuntu from here it won't work. Others also look like .jar files

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK with a few more comments :)

Edit: I wonder if the first sentence from doc/tor.md would be clearer: "It is possible to run Bitcoin Core as an I2P (Invisible Internet Project) service and connect to such services."

@vasild
Copy link
Contributor Author

vasild commented Jun 21, 2021

e498c9292a...afe5c3e70a: address suggestions and remove leading - from config options since - is used only on the command line and not in bitcoin.conf and it may be confused with an option to bitcoin-cli (instead of bitcoind).

@vasild
Copy link
Contributor Author

vasild commented Jun 21, 2021

I wonder if the first sentence from doc/tor.md would be clearer: "It is possible to run Bitcoin Core as an I2P (Invisible Internet Project) service and connect to such services."

Yes. The previous "to connect to other bitcoin nodes through I2P" may be interpreted as to connect to other non-I2P nodes (e.g. IPv4).

doc/i2p.md Outdated
To see to which I2P peers your node is connected, use `bitcoin-cli -netinfo 4`
or the RPC `getpeerinfo` (e.g. `bitcoin-cli getpeerinfo`).

To see which I2P addresses your node knows, use the RPC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To see which I2P addresses your node knows, use the RPC
To see which I2P addresses your node knows, run RPC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Member

@jonatack jonatack Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"run" because getnodeaddresses 0 i2p is not just the name of an RPC but a call with specific arguments. But definitely a pico-nit.

@jonatack
Copy link
Member

jonatack commented Jun 21, 2021

ACK

There are a few fixups but nothing that can't be done in a follow-up before -final. Personally, I was procrastinating on writing this doc out of bikeshed avoidance, so just noting a few things here and happy to open a follow-up.

@vasild
Copy link
Contributor Author

vasild commented Jun 23, 2021

afe5c3e70a...78cdab1ad2: address suggestions

For the next time: maybe a wiki is more appropriate, where everybody can edit and only open a PR once settled/finalized.

@jonatack
Copy link
Member

ACK 78cdab1

Thanks for updating. It may be a good idea to mention the ports (0 or ignored) I2P specificity to users here once it's settled.

@laanwj
Copy link
Member

laanwj commented Jun 24, 2021

ACK 78cdab1

For the next time: maybe a wiki is more appropriate, where everybody can edit and only open a PR once settled/finalized.

Yes, I don't think this is a bad idea for new documentation. I'd be uncomfortable with using a wiki as main documentation source, but during the editing phase it can be less friction.

@laanwj laanwj merged commit b7565c7 into bitcoin:master Jun 24, 2021
@michaelfolkson
Copy link

For the next time: maybe a wiki is more appropriate, where everybody can edit and only open a PR once settled/finalized.

Neat idea. Better than a StackExchange post if it is intended to go directly into Core docs and as @laanwj says less friction during editing phase than opening a PR with a first draft.

@vasild vasild deleted the i2p_doc branch June 24, 2021 12:31
@vasild
Copy link
Contributor Author

vasild commented Jun 24, 2021

Indeed. Just the initial/draft phase.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 24, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 15, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 15, 2021
78cdab1 doc: sort entries in doc/README.md#Miscellaneous alphabetically (Vasil Dimov)
cad487b doc: add basic I2P documentation (Vasil Dimov)

Pull request description:

  Add basic I2P documentation to help users to start using I2P and Bitcoin Core.

ACKs for top commit:
  jonatack:
    ACK 78cdab1
  laanwj:
    ACK 78cdab1

Tree-SHA512: 71cffc9419338a21cb9e811ee9463d6d09eef1a2a73190f766523bc1642a1f58984d5b2ab13da9b6560387ac9f431aace8bc7ae9b776585ecd3e3c1ff6af8e8d
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Feb 15, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#22250 | core#22250]]
Depends on D11037

Test Plan: proofreading and following the steps to run a node using I2P

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11041
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants