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
17723a52
Unverified
Commit
17723a52
authored
Jan 25, 2019
by
Felix Lange
Committed by
GitHub
Jan 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/bootnode: print node URL on startup (#18516)
Also say that cmd/bootnode is not for production use.
parent
f28da4f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
main.go
cmd/bootnode/main.go
+12
-1
No files found.
cmd/bootnode/main.go
View file @
17723a52
...
...
@@ -112,12 +112,13 @@ func main() {
if
!
realaddr
.
IP
.
IsLoopback
()
{
go
nat
.
Map
(
natm
,
nil
,
"udp"
,
realaddr
.
Port
,
realaddr
.
Port
,
"ethereum discovery"
)
}
// TODO: react to external IP changes over time.
if
ext
,
err
:=
natm
.
ExternalIP
();
err
==
nil
{
realaddr
=
&
net
.
UDPAddr
{
IP
:
ext
,
Port
:
realaddr
.
Port
}
}
}
printNotice
(
&
nodeKey
.
PublicKey
,
*
realaddr
)
if
*
runv5
{
if
_
,
err
:=
discv5
.
ListenUDP
(
nodeKey
,
conn
,
""
,
restrictList
);
err
!=
nil
{
utils
.
Fatalf
(
"%v"
,
err
)
...
...
@@ -136,3 +137,13 @@ func main() {
select
{}
}
func
printNotice
(
nodeKey
*
ecdsa
.
PublicKey
,
addr
net
.
UDPAddr
)
{
if
addr
.
IP
.
IsUnspecified
()
{
addr
.
IP
=
net
.
IP
{
127
,
0
,
0
,
1
}
}
n
:=
enode
.
NewV4
(
nodeKey
,
addr
.
IP
,
0
,
addr
.
Port
)
fmt
.
Println
(
n
.
String
())
fmt
.
Println
(
"Note: you're using cmd/bootnode, a developer tool."
)
fmt
.
Println
(
"We recommend using a regular node as bootstrap node for production deployments."
)
}
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