aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-03-17 17:37:37 +0800
committerMaran <maran.hidskes@gmail.com>2014-03-17 17:37:37 +0800
commit8ea7e21f64842380833cce7aafa52b909cb8426b (patch)
tree08b138c3ef94da8fb1ff0a11c7c47aba5e59e616 /ethereum.go
parent3274e0a2496e622a847b213bb5ba0272650ef06c (diff)
downloaddexon-8ea7e21f64842380833cce7aafa52b909cb8426b.tar.gz
dexon-8ea7e21f64842380833cce7aafa52b909cb8426b.tar.zst
dexon-8ea7e21f64842380833cce7aafa52b909cb8426b.zip
Merge
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go51
1 files changed, 38 insertions, 13 deletions
diff --git a/ethereum.go b/ethereum.go
index 302f3c04f..c906a6954 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -271,20 +271,45 @@ func (s *Ethereum) Start() {
if ethutil.Config.Seed {
ethutil.Config.Log.Debugln("Seeding")
- // Testnet seed bootstrapping
- resp, err := http.Get("https://www.ethereum.org/servers.poc3.txt")
- if err != nil {
- log.Println("Fetching seed failed:", err)
- return
- }
- defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- log.Println("Reading seed failed:", err)
- return
- }
+ // DNS Bootstrapping
+ _, nodes, err := net.LookupSRV("eth", "tcp", "ethereum.org")
+ if err == nil {
+ peers := []string{}
+ // Iterate SRV nodes
+ for _, n := range nodes {
+ target := n.Target
+ port := strconv.Itoa(int(n.Port))
+ // Resolve target to ip (Go returns list, so may resolve to multiple ips?)
+ addr, err := net.LookupHost(target)
+ if err == nil {
+ for _, a := range addr {
+ // Build string out of SRV port and Resolved IP
+ peer := net.JoinHostPort(a, port)
+ log.Println("Found DNS Bootstrap Peer:", peer)
+ peers = append(peers, peer)
+ }
+ } else {
+ log.Println("Couldn't resolve :", target)
+ }
+ }
+ // Connect to Peer list
+ s.ProcessPeerList(peers)
+ } else {
+ // Fallback to servers.poc3.txt
+ resp, err := http.Get("http://www.ethereum.org/servers.poc3.txt")
+ if err != nil {
+ log.Println("Fetching seed failed:", err)
+ return
+ }
+ defer resp.Body.Close()
+ body, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ log.Println("Reading seed failed:", err)
+ return
+ }
- s.ConnectToPeer(string(body))
+ s.ConnectToPeer(string(body))
+ }
}
}
f='/~lantw44/cgit/freebsd-ports/commit/emulators/wine?id=6a2d045fb0055cc8d65c8f0d132b80ffdf4497e9'>Update to the 2002.05.09 snapshot of Wine.Gerald Pfeifer2002-05-133-10/+5 * Do not --disable-opengl any longer, which mostly was used to work aroundGerald Pfeifer2002-04-301-1/+0 * Update to the 2002.04.11 snapshot of Wine. Lots of libraries inGerald Pfeifer2002-04-123-126/+144 * Update to 2002.03.10Patrick Li2002-03-124-9/+11 * update to 2002.01.22.FUJISHIMA Satsuki2002-01-244-78/+81 * Update to version 2001-12-16.Dmitry Sivachenko2001-12-284-16/+8 * Unbreak this port on 5.x by removing include of sys/user.hAlfred Perlstein2001-12-081-0/+12 * bump PORTREVISION to reflect addition to pkg-plist.FUJISHIMA Satsuki2001-12-051-0/+1 * add missing file to PLISTYing-Chieh Liao2001-12-051-0/+1 * Update to version 2001.11.08.Steve Price2001-11-165-47/+17 * Actually commit the pkg-message cleanup that I missed before.Peter Pentchev2001-10-191-9/+13 * Describe the reasons for not updating to a more recent Wine snapshot.Peter Pentchev2001-10-151-0/+4 * Update to 2001.08.24David W. Chapman Jr.2001-08-274-12/+43 * Upgrade to 2001.07.31.Dmitry Sivachenko2001-08-084-13/+16 * Add the rest of the items in this pr for PORTDOC complianceDavid W. Chapman Jr.2001-07-072-14/+15 * Delete outdated patch-ggDavid W. Chapman Jr.2001-07-053-42/+4 * Remove duplicate words where appropriate.Dima Dorfman2001-06-251-1/+1 * Update to version 2000-05-10James E. Housley2001-05-144-2/+41 * Update to 2001.04.18Dmitry Sivachenko2001-05-043-2/+22 * Update to 2001.03.26.Jing-Tang Keith Jang2001-04-096-40/+7 * port did not install with NDEBUG=1Dirk Meyer2001-03-183-9/+35 * This updates the Wine port to 2001.03.05 and removes an obsoleteDirk Meyer2001-03-175-58/+3 * Update to 2001.02.16.Jing-Tang Keith Jang2001-02-183-2/+6 * - Mark port broken for ${OSVERSION} < 400000 (not supported);Maxim Sobolev2001-02-033-6/+14 * Fix brokeness due to recent libgcc* changes.Maxim Sobolev2001-01-301-19/+0 * Upgrade to 20010112.Vanilla I. Shu2001-01-167-38/+37 * Make this port more efficient with perl regexes; add a directory to theWill Andrews2001-01-151-5/+1 * Update MAN1 and pkg-plist.Daniel Harris2000-12-302-1/+4 * I forgot to cvs add this file when I upgraded the port.Jean-Marc Zucconi2000-12-241-0/+11 * Upgrade to version 2000-12-12Jean-Marc Zucconi2000-12-235-94/+28 * Fix PLIST and manpage packaging.Will Andrews2000-12-212-1/+6 * Makefile cleanup.Daniel Harris2000-11-271-3/+3 * Upgrade to version 2000.10.26Kevin Lo2000-11-023-10/+8 * Update to version 2000.10.02.Trevor Johnson2000-10-154-9/+33 * Rename ${FILESDIR}/patch-3.3-sys-sigtrap toSatoshi Asami2000-10-081-2/+2 * Update port to 2000.08.21.Alexander Langer2000-09-155-36/+133 * Remove the fsgs patch, which is no longer required.Sheldon Hearn2000-08-244-31/+7 * Makefile simplification and removed references to a removed patch.Daniel Harris2000-08-222-4/+2 * Removed patch-3.3-sys-ldtshare and update README.patch accordingly.Daniel Harris2000-08-221-29/+2 * Update to 2000.08.01 snapshot.Daniel Harris2000-08-203-11/+10 * (1) Add new variable, XFREE86_VERSION, to specify which version ofSatoshi Asami2000-08-031-3/+2 * Add USE_BISON.Alexander Langer2000-07-241-0/+1 * Update to 2000.07.16 snapshot.Alexander Langer2000-07-224-25/+46 * Link wine with -rpath so that it can find libwine.so.Steve Price2000-07-081-0/+1 * Add note requested by maintainer not to upgrade the port to theDavid E. O'Brien2000-06-261-0/+2 * Fix problem caused by our current version of ncurses.h (see PR misc/19077),Stefan Eßer2000-06-191-0/+16 * Rename INSTALLS_SHLIBS to INSTALLS_SHLIB. (There was a typo in theSatoshi Asami2000-06-171-1/+1 * Fix MASSIVE typo INSTALL_SHLIBS --> INSTALLS_SHLIBS, which occured because IMaxim Sobolev2000-06-161-1/+1 * First round of INSTALL_SHLIB fixes.Maxim Sobolev2000-06-162-2/+2 * Use perl-fu to handle the SOVERSION tweak instead of patching 58 files.David E. O'Brien2000-06-111-0/+8 * "We (actually, I) forgot to install the libraries that are partDavid E. O'Brien2000-06-104-9/+178 * Update to version 2000.05.26.Steve Price2000-05-293-10/+2 * Make WINE build again!Will Andrews2000-05-194-24/+12 * PORTNAME/VERSION stuffMichael Haro2000-04-121-5/+4 * Change all www.freebsd.org/~user references to people.FreeBSD.org/~user,Peter Wemm2000-02-081-1/+1 * * Use/set fs/gs from the sigcontext struct so that it correctly runs onDavid E. O'Brien1999-12-114-20/+137 * Upgrade to 991114 version of Wine.Stefan Eßer1999-11-222-4/+6 * Upgrade to 991031 version of Wine.Stefan Eßer1999-11-158-24/+141 * FreeBSD.ORG -> FreeBSD.orgMichael Haro1999-08-311-1/+1 * Change Id->FreeBSD.David E. O'Brien1999-08-251-1/+1 * Commit #2/4 to enforce Caps, no period. I ran this oe asTim Vanderhoek1999-06-271-1/+1 * Upgrade to 99.04.26 version of Wine.Stefan Eßer1999-05-043-31/+14 * WWWWWWWWWWWWWWWWWWWWWWWWWWWhhhhhhhhhheeeeeeeeeeeeeee!!!!!!!!!Tim Vanderhoek1999-05-031-1/+1 * Use 'ONLY_FOR_ARCHS= i386'.Bill Fumerola1999-03-311-1/+2 * Upgrade to 990214 version of Wine.Stefan Eßer1999-02-203-8/+8 * Upgrade to 990131 version of Wine.Stefan Eßer1999-02-023-8/+8 * Homepage. Requires SYSVSHEM, SEM, and MSG in the kernel.Tim Vanderhoek1999-01-191-2/+7 * Upgrade to January 10, 1999 version of Wine.Stefan Eßer1999-01-173-8/+8 * Upgrade to 981211 version of Wine.Stefan Eßer1998-12-273-27/+14 * Unbreak.Justin M. Seger1998-10-131-3/+1 * Add missing bitopts.hJustin M. Seger1998-10-131-2/+2 * Mark BROKEN for ELF:Justin M. Seger1998-10-131-1/+3 * Update to 980927.Jun Kuriyama1998-10-093-12/+42 * Roll back libXpm major to 4. Sorry, it wasn't a good idea to bump itSatoshi Asami1998-09-171-2/+2 * libXpm major is now 5. Also remove regexp support in preparation forSatoshi Asami1998-09-151-2/+2 * Don't emulate the manpages in the PLIST.Tim Vanderhoek1998-08-171-1/+0 * Making x11 category more useful project part 1: take out "x11" ofSatoshi Asami1998-07-281-2/+2