Browse Source

Merge pull request #10 from JeremyRand/multiple-initial

Support multiple initial IP's
master
Lyndsay Roger 3 years ago committed by GitHub
parent
commit
b78cb421a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      configs/bitcoin-test.json
  2. 1
      configs/bitcoin.json
  3. 3
      configs/dnsseeder.json
  4. 1
      configs/namecoin.json
  5. 1
      configs/twister.json
  6. 13
      seeder.go

1
configs/bitcoin-test.json

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
"Pver": 70001,
"DNSName": "btctseed.zagbot.com",
"TTL": 300,
"InitialIP": "0.0.0.0,0.0.0.0",
"Seeder1": "testnet-seed.alexykot.me",
"Seeder2": "testnet-seed.bitcoin.petertodd.org",
"Seeder3": "testnet-seed.bluematt.me"

1
configs/bitcoin.json

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
"Pver": 70001,
"DNSName": "btcseed.zagbot.com",
"TTL": 600,
"InitialIP": "0.0.0.0,0.0.0.0",
"Seeder1": "dnsseed.bluematt.me",
"Seeder2": "bitseed.xf2.org",
"Seeder3": "dnsseed.bitcoin.dashjr.org"

3
configs/dnsseeder.json

@ -6,7 +6,8 @@ @@ -6,7 +6,8 @@
"Pver": 70001,
"DNSName": "seeder.example.com",
"TTL": 600,
"InitialIP": "0.0.0.0,0.0.0.0",
"Seeder1": "seeder1.example.com",
"Seeder2": "seed1.bob.com",
"Seeder3": "seed2.example.com"
}
}

1
configs/namecoin.json

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
"Pver": 70001,
"DNSName": "dnsseed.nmctest.net",
"TTL": 600,
"InitialIP": "0.0.0.0,0.0.0.0",
"Seeder1": "nmc.seed.quisquis.de",
"Seeder2": "seed.nmc.markasoftware.com"
}

1
configs/twister.json

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
"Pver": 60000,
"DNSName": "dnsseed.zagbot.com",
"TTL": 600,
"InitialIP": "0.0.0.0,0.0.0.0",
"Seeder1": "seed2.twister.net.co",
"Seeder2": "seed.twister.net.co",
"Seeder3": "seed3.twister.net.co"

13
seeder.go

@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
"log"
"net"
"strconv"
"strings"
"sync"
"time"
@ -105,12 +106,14 @@ func (s *dnsseeder) initSeeder() { @@ -105,12 +106,14 @@ func (s *dnsseeder) initSeeder() {
}
}
// load one ip address into system and start crawling from it
// load ip addresses into system and start crawling from them
if len(s.theList) == 0 && s.initialIP != "" {
if newIP := net.ParseIP(s.initialIP); newIP != nil {
// 1 at the end is the services flag
if x := s.addNa(wire.NewNetAddressIPPort(newIP, s.port, 1)); x == true {
log.Printf("%s: crawling with initial IP %s \n", s.name, s.initialIP)
for _, initialIP := range strings.Split(s.initialIP, ",") {
if newIP := net.ParseIP(initialIP); newIP != nil {
// 1 at the end is the services flag
if x := s.addNa(wire.NewNetAddressIPPort(newIP, s.port, 1)); x == true {
log.Printf("%s: crawling with initial IP %s \n", s.name, s.initialIP)
}
}
}
}

Loading…
Cancel
Save