net: add I2P hardcoded seeds #21825

pull jonatack wants to merge 3 commits into bitcoin:master from jonatack:i2p-hardcoded-seeds changing 3 files +25 −0
  1. jonatack commented at 7:43 pm on May 1, 2021: member

    Follow-up to #21560 that updated the fixed seeds infra for BIP155 addresses and then added Tor v3 ones:

    • Update contrib/generate-seeds.py to parse I2P addresses

    • Add a few I2P nodes to contrib/seeds/nodes_main.txt

    • Run generate-seeds.py and add the I2P seeds to chainparamsseeds.h

    Reviewers, see contrib/seeds/README.md for more info and feel free to use the following CLI one-liner to check for and propose additional seeds for contrib/seeds/nodes_main.txt. You can also see how many I2P peers your node knows with cli -addrinfo.

    0bitcoin-cli getnodeaddresses 0 | jq '.[] | (select(.address | contains(".b32.i2p"))) | .address' | sort
    

    I verified the I2P addresses are correctly BIP155-serialized/deserialized by building with all seeds removed from chainparamsseeds.h except those added here, restarting with -datadir=newdir -dnsseed=0 and running rpc getnodeaddresses 0 that initially returns only the new I2P addresses.

  2. DrahtBot added the label P2P on May 1, 2021
  3. DrahtBot added the label Scripts and tools on May 1, 2021
  4. DrahtBot added the label Validation on May 1, 2021
  5. jonatack force-pushed on May 2, 2021
  6. contrib: parse I2P addresses in generate-seeds.py ea269c7ef1
  7. contrib: add a few I2P seed nodes e01f173fb9
  8. net: add I2P seeds to chainparamsseeds 142e2da440
  9. jonatack force-pushed on May 2, 2021
  10. jonatack commented at 12:46 pm on May 2, 2021: member

    Screenshot from 2021-05-02 15-45-20

    Tested several times running a node with no peers.dat, dnsseed=0, noonion, onlynet=i2p, and only these new I2P seeds in chainparamsseeds, and it connects to all of the I2P seeds that are online right now.

     0$ bitcoin-cli -addrinfo
     1{
     2  "addresses_known": {
     3    "ipv4": 0,
     4    "ipv6": 0,
     5    "torv2": 0,
     6    "torv3": 0,
     7    "i2p": 8,
     8    "total": 8
     9  }
    10}
    11
    12$ bitcoin-cli getnodeaddresses 0
    13[
    14  {
    15    "time": 1619267336,
    16    "services": 9,
    17    "address": "wwbw7nqr3ahkqv62cuqfwgtneekvvpnuc4i4f6yo7tpoqjswvcwa.b32.i2p",
    18    "port": 8333,
    19    "network": "i2p"
    20  },
    21  {
    22    "time": 1619331060,
    23    "services": 9,
    24    "address": "hnbbyjpxx54623l555sta7pocy3se4sdgmuebi5k6reesz5rjp6q.b32.i2p",
    25    "port": 8333,
    26    "network": "i2p"
    27  },
    28  {
    29    "time": 1618857028,
    30    "services": 9,
    31    "address": "72l3ucjkuscrbiiepoehuwqgknyzgo7zuix5ty4puwrkyhtmnsga.b32.i2p",
    32    "port": 8333,
    33    "network": "i2p"
    34  },
    35  {
    36    "time": 1619232946,
    37    "services": 9,
    38    "address": "zsxwyo6qcn3chqzwxnseusqgsnuw3maqnztkiypyfxtya4snkoka.b32.i2p",
    39    "port": 8333,
    40    "network": "i2p"
    41  },
    42  {
    43    "time": 1619240850,
    44    "services": 9,
    45    "address": "pjs7or2ctvteeo5tu4bwyrtydeuhqhvdprtujn4daxr75jpebjxa.b32.i2p",
    46    "port": 8333,
    47    "network": "i2p"
    48  },
    49  {
    50    "time": 1618776457,
    51    "services": 9,
    52    "address": "c4gfnttsuwqomiygupdqqqyy5y5emnk5c73hrfvatri67prd7vyq.b32.i2p",
    53    "port": 8333,
    54    "network": "i2p"
    55  },
    56  {
    57    "time": 1619959105,
    58    "services": 1033,
    59    "address": "h3r6bkn46qxftwja53pxiykntegfyfjqtnzbm6iv6r5mungmqgmq.b32.i2p",
    60    "port": 8333,
    61    "network": "i2p"
    62  },
    63  {
    64    "time": 1619108616,
    65    "services": 9,
    66    "address": "gehtac45oaghz54ypyopim64mql7oad2bqclla74l6tfeolzmodq.b32.i2p",
    67    "port": 8333,
    68    "network": "i2p"
    69  }
    70]
    
  11. vasild approved
  12. vasild commented at 10:49 am on May 3, 2021: member

    ACK 142e2da4401aa8c0643f7fc473ffaceafbbf90c3

    I verified that the additions to src/chainparamsseeds.h are generated from the extended contrib/seeds/nodes_main.txt. The I2P peers in my node’s list of peers are a subset of the added ones.

    The command from the PR description did not work for me because the getnodeaddresses RPC does not return a JSON with network field. I used this instead:

    0bitcoin-cli getnodeaddresses 0 |jq -r '.[] | (select(.address |test("\\.i2p$"; "i"))) | .address' | sort
    
  13. Emzy commented at 10:57 am on May 3, 2021: contributor
    ACK I’m one of the I2P seeds.
  14. jonatack commented at 11:05 am on May 3, 2021: member

    The command from the PR description did not work for me because the getnodeaddresses RPC does not return a JSON with network field.

    Indeed, it was added only very recently to master in #21594 (thanks!) Updated the PR description to work before that merge.

  15. jonatack commented at 11:11 am on May 3, 2021: member

    Collecting ways to do this with jq :sunglasses:

    0./src/bitcoin-cli getnodeaddresses 0 | jq '.[] | (select(.address | contains(".b32.i2p"))) | .address' | sort
    1./src/bitcoin-cli getnodeaddresses 0 | jq -r '.[] | (select(.address | test("\\.i2p$"; "i"))) | .address' | sort
    2./src/bitcoin-cli getnodeaddresses 0 | jq '.[] | (select(.network == "i2p")) | .address' | sort
    
  16. jonatack commented at 11:40 am on May 3, 2021: member

    Collecting ways to do this with jq sunglasses

    or #21843

  17. vasild commented at 12:03 pm on May 3, 2021: member

    … select(.address | contains(".i2p")) …

    I have xppyui2pgfuqegju.onion :hole:

  18. laanwj commented at 1:50 pm on May 3, 2021: member

    ACK 142e2da4401aa8c0643f7fc473ffaceafbbf90c3

    • Verified that python3 generate-seeds.py . > ../../src/chainparamsseeds.h gives the same output
    • Checked that all nodes (except one) are connectable
    • Checked getaddresses on my node, that all known I2Ps are covered here
  19. jonatack commented at 4:49 pm on May 3, 2021: member
    * Checked that all nodes (except one) are connectable
    

    Same, am connected to all but one. Pinged the person on IRC and they are checking.

  20. jonatack commented at 9:42 pm on May 3, 2021: member
    Ok, that node is back online and expected to be stable. We’re good :rocket:
  21. laanwj merged this on May 4, 2021
  22. laanwj closed this on May 4, 2021

  23. jonatack deleted the branch on May 4, 2021
  24. gwillen referenced this in commit 56e5c4c75e on Jun 1, 2022
  25. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me