Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
3647cc5b
Commit
3647cc5b
authored
May 13, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented our own makeshift go seed. Fixes #16
parent
cc341b87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
ethereum.go
ethereum.go
+17
-4
No files found.
ethereum.go
View file @
3647cc5b
...
@@ -325,8 +325,21 @@ func (s *Ethereum) Start(seed bool) {
...
@@ -325,8 +325,21 @@ func (s *Ethereum) Start(seed bool) {
}
}
func
(
s
*
Ethereum
)
Seed
()
{
func
(
s
*
Ethereum
)
Seed
()
{
ethutil
.
Config
.
Log
.
Debugln
(
"Seeding"
)
ethutil
.
Config
.
Log
.
Debugln
(
"[SERV] Retrieving seed nodes"
)
// DNS Bootstrapping
// Eth-Go Bootstrapping
ips
,
er
:=
net
.
LookupIP
(
"seed.bysh.me"
)
if
er
==
nil
{
peers
:=
[]
string
{}
for
_
,
ip
:=
range
ips
{
node
:=
fmt
.
Sprintf
(
"%s:%d"
,
ip
.
String
(),
30303
)
ethutil
.
Config
.
Log
.
Debugln
(
"[SERV] Found DNS Go Peer:"
,
node
)
peers
=
append
(
peers
,
node
)
}
s
.
ProcessPeerList
(
peers
)
}
// Official DNS Bootstrapping
_
,
nodes
,
err
:=
net
.
LookupSRV
(
"eth"
,
"tcp"
,
"ethereum.org"
)
_
,
nodes
,
err
:=
net
.
LookupSRV
(
"eth"
,
"tcp"
,
"ethereum.org"
)
if
err
==
nil
{
if
err
==
nil
{
peers
:=
[]
string
{}
peers
:=
[]
string
{}
...
@@ -340,11 +353,11 @@ func (s *Ethereum) Seed() {
...
@@ -340,11 +353,11 @@ func (s *Ethereum) Seed() {
for
_
,
a
:=
range
addr
{
for
_
,
a
:=
range
addr
{
// Build string out of SRV port and Resolved IP
// Build string out of SRV port and Resolved IP
peer
:=
net
.
JoinHostPort
(
a
,
port
)
peer
:=
net
.
JoinHostPort
(
a
,
port
)
log
.
Println
(
"
Found DNS Bootstrap Peer:"
,
peer
)
ethutil
.
Config
.
Log
.
Debugln
(
"[SERV]
Found DNS Bootstrap Peer:"
,
peer
)
peers
=
append
(
peers
,
peer
)
peers
=
append
(
peers
,
peer
)
}
}
}
else
{
}
else
{
log
.
Println
(
"
Couldn't resolve :"
,
target
)
ethutil
.
Config
.
Log
.
Debugln
(
"[SERV}
Couldn't resolve :"
,
target
)
}
}
}
}
// Connect to Peer list
// Connect to Peer list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment