-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add built-in seeds for .onion #4582
Conversation
@@ -97,6 +102,64 @@ unsigned int pnSeed[] = | |||
0x13f5094c, 0x7ab32648, 0x542e9fd5, 0x53136bc1, 0x7fdf51c0, 0x802197b2, 0xa2d2cc5b, 0x6b5f4bc0, | |||
}; | |||
|
|||
static SeedSpec6 pnSeed6_main[]={ | |||
{{0xfd,0x87,0xd8,0x7e,0xeb,0x43,0x0a,0x26,0x27,0x21,0xae,0x94,0xd5,0xc2,0x72,0x24}, 8333}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indentation?
None of these are blockers, though. |
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. |
Untested ACK |
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()); |
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. |
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. |
To make an analogy, we ship the compiler (python script) + compiler output, but not the source code. |
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. |
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, |
@@ -80,4 +80,3 @@ It will do the following automatically: | |||
- add missing translations to the build system (TODO) | |||
|
|||
See doc/translation-process.md for more information. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do this, we don't want white-space changes ^^ (evil-grin)... no I'm sorry, everything is fine for me :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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. |
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. |
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. |
I didn't obfuscate those, I literally copied those from the previous source! |
@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. |
Untested ACK |
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.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4582_a60120e951ae94d0553c5515229432e016fb0657/ for binaries and test log. |
It's really good to have some seeds for hidden-services integrated! |
Squashed and added the deobfuscated IPv4s as comment. |
a60120e Add built-in seeds for .onion (Wladimir J. van der Laan)
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.