danielmcclure / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 1 forks source link

Switch seed peers to loading data from sipas DNS dumps #457

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
At http://bitcoin.sipa.be/seeds.txt is a file that contains long term stable 
IPs. We should change SeedPeers to parse it and ship a copy with bitcoinj, then 
refresh it before each release.

Original issue reported on code.google.com by hearn@google.com on 24 Sep 2013 at 1:31

GoogleCodeExporter commented 9 years ago
I'm interested in helping with this one.  Should I just copy that file into a 
subfolder of src/main/resources and write code to load it?

Original comment by s...@msgilligan.com on 2 Feb 2014 at 9:21

GoogleCodeExporter commented 9 years ago
From the mailing list:

This involves implementing a new PeerDiscovery class that loads the relevant 
text files (probably from a JAR resource). It will help improve reliability 
when DNS seeds aren't reachable for some reason, as long as we keep the list up 
to date.

Probably also implies fixing Issue #302.

Original comment by s...@msgilligan.com on 2 Feb 2014 at 9:23

GoogleCodeExporter commented 9 years ago
Yep. That'd be a good place to start. There's an existing SeedPeers class that 
nobody uses because it's hopelessly out of date. You could just rewrite that to 
use the DNS dump files.

Then we'll hit issue #302 but of course a working SeedPeers class is useful by 
itself too.

Original comment by mh.in.en...@gmail.com on 3 Feb 2014 at 11:53

GoogleCodeExporter commented 9 years ago
I've started work here: 
https://github.com/msgilligan/bitcoinj/commits/msgilligan-issue457

seeds.txt is big: 29 MB

I don't have much free time, but that is starting to change.  I hope to have 
something ready in a week or so.

Original comment by s...@msgilligan.com on 10 Feb 2014 at 7:37

GoogleCodeExporter commented 9 years ago
OK, I have the changes made and the code pushed to GitHub:
https://github.com/msgilligan/bitcoinj/commit/81780f1c2c54a55f12af903cbf58d81452
7ae32b

I have protected and deprecated the getPeer() method and also deprecated the 
private nextPeer() method. As far as I can tell they were only used by the unit 
tests.

The getPeers() method (which I've marked with @Override) is the only discovery 
method in the PeerDiscovery.

I have some concerns about the size of the file on disk (and the array in 
memory) and I'll bring those up on the mailing list.

Original comment by s...@msgilligan.com on 17 Feb 2014 at 4:16

GoogleCodeExporter commented 9 years ago
OK, I'm ready for more feedback, another commit (squashed, this time) is here:
https://github.com/msgilligan/bitcoinj/tree/msgilligan-issue457-squashed

I'll post to the mailing list with more info and details.

Original comment by s...@msgilligan.com on 22 Feb 2014 at 8:42