Add built-in seeds for .onion #4582

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2014_07_onionseeds changing 6 files +1432 −91
  1. laanwj commented at 12:13 PM on July 24, 2014: member

    This makes it possible for a node with -onlynet=tor to bootstrap itself. It also adds the base infrastructure for adding IPv6 seed nodes.

    The seeds are taken from reliable nodes in @sipa's crawler as well as https://en.bitcoin.it/wiki/Fallback_Nodes#Tor_nodes.

    I've tested this with bitcoind -onlynet=tor -dnsseed=0 -onion=127.0.0.1:9050 after making sure that peers.dat was cleared.

  2. in src/chainparams.cpp:None in 382bd6add7 outdated
     101 | @@ -97,6 +102,64 @@ unsigned int pnSeed[] =
     102 |      0x13f5094c, 0x7ab32648, 0x542e9fd5, 0x53136bc1, 0x7fdf51c0, 0x802197b2, 0xa2d2cc5b, 0x6b5f4bc0,
     103 |  };
     104 |  
     105 | +static SeedSpec6 pnSeed6_main[]={
     106 | +{{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0a,0x26,0x27,0x21,0xae,0x94,0xd5,0xc2,0x72,0x24}, 8333},
    


    sipa commented at 12:40 PM on July 24, 2014:

    Nit: indentation?

  3. sipa commented at 7:11 PM on July 24, 2014: member
    • We can just store all seed addresses in 16-byte format (even the IPv4 ones)? If code compactness is a worry, we'll likely need to move all of this to a separate file excluded from automatic formatting anyway?
    • Maybe we can add actual IPv6 (non-onion) seed IPs too?
    • Perhaps we should only add seed addresses for networks we're connected to?

    None of these are blockers, though.

  4. laanwj commented at 7:31 PM on July 24, 2014: member

    I'm OK with all of those, I cannot help testing the second one though, but if you send a list it's easy to add.

  5. sipa commented at 2:48 PM on July 27, 2014: member

    Untested ACK

  6. laanwj commented at 8:30 AM on July 28, 2014: member

    Added a commit that converts all the IPv4 seeds to the new format as well.

    Checked that they're still the same by diffing the output of:

    std::vector<CAddress> vAddr = Params().FixedSeeds();
    for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++)
        printf("%s\n", (*it).ToString().c_str());
    
  7. jgarzik commented at 8:05 PM on July 29, 2014: contributor

    Change LGTM, though I tend to prefer approaches that do not store obfuscated addresses in the git repo.

    An alternative is a short C++ program that reads addresses, generates a header file at compile time, and then proceeds with the build. automake has a generated-source pattern to enable this.

  8. sipa commented at 11:30 PM on July 29, 2014: member

    We already have python scripts for automatic source generation (inside the qt/ directory, afaik), and C++ tools at compile time are harder (you need to compile them for the host system first...).

    A text file per network with all seeds in it, and a python script to generate a cpp source file for that sounds nice, though.

  9. jgarzik commented at 2:15 AM on July 30, 2014: contributor

    To make an analogy, we ship the compiler (python script) + compiler output, but not the source code.

  10. laanwj commented at 6:30 AM on July 30, 2014: member

    This change already adds a python script to generate the .h file. Adding the source address lists and calling it as part of the build system is fine to me, and a small step.

    Strong disagree with porting it to C++. I've seen how much trouble native-compiled tools create in other projects (Mesa, miniupnpc AFAIK) and it's useless work if we already have a Python script.

  11. laanwj commented at 9:29 AM on July 30, 2014: member

    Ok - I moved the seed generation script and input files to share/seeds, and included the source files.

    I stopped short of actually integrating it into the build system. Generating the file every time is not necessary, and it may complicate building for those using MSVC and other build systems. Note that the other autogenerated file, src/qt/bitcoinstrings.cpp, is also checked in.

  12. in contrib/devtools/README.md:None in 57af27f782 outdated
      79 | @@ -80,4 +80,3 @@ It will do the following automatically:
      80 |  - add missing translations to the build system (TODO)
      81 |  
      82 |  See doc/translation-process.md for more information.
      83 | -
    


    Diapolo commented at 12:14 PM on July 30, 2014:

    Please don't do this, we don't want white-space changes ^^ (evil-grin)... no I'm sorry, everything is fine for me :).


    laanwj commented at 12:17 PM on July 30, 2014:

    AFAIK we haven't got an auto formatter for text files :p Anyhow, this is not on purpose, something was added and removed again and supposedly I removed a newline too many.

  13. Diapolo commented at 12:27 PM on July 30, 2014: none

    What makes a good seed node? I'm just asking because my 2 Tor hs are not in this list, but are also not running 24/7 but only when I use my PC.

  14. laanwj commented at 12:49 PM on July 30, 2014: member

    The current onion nodes come from two place:

    If you have a node that's not online 24/7 it makes no sense to add it, IMO.

  15. laanwj added the label P2P on Jul 31, 2014
  16. sipa commented at 12:44 PM on August 1, 2014: member

    In light of @jgarzik's comment to not have obfuscated addresses in the source code, it would be nice to convert the hex IP addresses into dotted quad notation in the text file.

  17. laanwj commented at 12:59 PM on August 1, 2014: member

    I didn't obfuscate those, I literally copied those from the previous source!

  18. sipa commented at 1:01 PM on August 1, 2014: member

    @laanwj Didn't mean to say you were, and not a blocker either. Just saying it would be nice if the 'primary' source was in the most human readable format possible.

  19. sipa commented at 1:05 PM on August 1, 2014: member

    Untested ACK

  20. Add built-in seeds for .onion
    This makes it possible for a node with `-onlynet=tor` to bootstrap
    itself.
    
    It also adds the base infrastructure for adding IPv6 seed nodes.
    
    Also represent IPv4 fixed seed addresses in 16-byte format.
    a60120e951
  21. BitcoinPullTester commented at 3:42 PM on August 3, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4582_a60120e951ae94d0553c5515229432e016fb0657/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  22. Diapolo commented at 8:59 AM on August 4, 2014: none

    It's really good to have some seeds for hidden-services integrated!

  23. laanwj commented at 10:06 AM on August 4, 2014: member

    Squashed and added the deobfuscated IPv4s as comment.

  24. laanwj merged this on Aug 4, 2014
  25. laanwj closed this on Aug 4, 2014

  26. laanwj referenced this in commit d97a58f883 on Aug 4, 2014
  27. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-13 18:15 UTC

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