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
dfe79cc7
Unverified
Commit
dfe79cc7
authored
Nov 14, 2016
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils, mobile: place bootnodes in LGPL packages
parent
4a439c23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
flags.go
cmd/utils/flags.go
+3
-3
discover.go
mobile/discover.go
+0
-11
params.go
mobile/params.go
+11
-0
bootnodes.go
params/bootnodes.go
+8
-8
No files found.
cmd/utils/flags.go
View file @
dfe79cc7
...
@@ -488,9 +488,9 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
...
@@ -488,9 +488,9 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
// Return pre-configured nodes if none were manually requested
// Return pre-configured nodes if none were manually requested
if
!
ctx
.
GlobalIsSet
(
BootnodesFlag
.
Name
)
{
if
!
ctx
.
GlobalIsSet
(
BootnodesFlag
.
Name
)
{
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
return
TestnetBootnodes
return
params
.
TestnetBootnodes
}
}
return
MainnetBootnodes
return
params
.
MainnetBootnodes
}
}
// Otherwise parse and use the CLI bootstrap nodes
// Otherwise parse and use the CLI bootstrap nodes
bootnodes
:=
[]
*
discover
.
Node
{}
bootnodes
:=
[]
*
discover
.
Node
{}
...
@@ -511,7 +511,7 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
...
@@ -511,7 +511,7 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
func
MakeBootstrapNodesV5
(
ctx
*
cli
.
Context
)
[]
*
discv5
.
Node
{
func
MakeBootstrapNodesV5
(
ctx
*
cli
.
Context
)
[]
*
discv5
.
Node
{
// Return pre-configured nodes if none were manually requested
// Return pre-configured nodes if none were manually requested
if
!
ctx
.
GlobalIsSet
(
BootnodesFlag
.
Name
)
{
if
!
ctx
.
GlobalIsSet
(
BootnodesFlag
.
Name
)
{
return
DiscoveryV5Bootnodes
return
params
.
DiscoveryV5Bootnodes
}
}
// Otherwise parse and use the CLI bootstrap nodes
// Otherwise parse and use the CLI bootstrap nodes
bootnodes
:=
[]
*
discv5
.
Node
{}
bootnodes
:=
[]
*
discv5
.
Node
{}
...
...
mobile/discover.go
View file @
dfe79cc7
...
@@ -22,20 +22,9 @@ package geth
...
@@ -22,20 +22,9 @@ package geth
import
(
import
(
"errors"
"errors"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/discv5"
)
)
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
// by the foundation running the V5 discovery protocol.
func
FoundationBootnodes
()
*
Enodes
{
nodes
:=
&
Enodes
{
nodes
:
make
([]
*
discv5
.
Node
,
len
(
utils
.
DiscoveryV5Bootnodes
))}
for
i
,
node
:=
range
utils
.
DiscoveryV5Bootnodes
{
nodes
.
nodes
[
i
]
=
node
}
return
nodes
}
// Enode represents a host on the network.
// Enode represents a host on the network.
type
Enode
struct
{
type
Enode
struct
{
node
*
discv5
.
Node
node
*
discv5
.
Node
...
...
mobile/params.go
View file @
dfe79cc7
...
@@ -20,6 +20,7 @@ package geth
...
@@ -20,6 +20,7 @@ package geth
import
(
import
(
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
)
)
...
@@ -76,3 +77,13 @@ type ChainConfig struct {
...
@@ -76,3 +77,13 @@ type ChainConfig struct {
func
NewChainConfig
()
*
ChainConfig
{
func
NewChainConfig
()
*
ChainConfig
{
return
new
(
ChainConfig
)
return
new
(
ChainConfig
)
}
}
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
// by the foundation running the V5 discovery protocol.
func
FoundationBootnodes
()
*
Enodes
{
nodes
:=
&
Enodes
{
nodes
:
make
([]
*
discv5
.
Node
,
len
(
params
.
DiscoveryV5Bootnodes
))}
for
i
,
node
:=
range
params
.
DiscoveryV5Bootnodes
{
nodes
.
nodes
[
i
]
=
node
}
return
nodes
}
cmd/util
s/bootnodes.go
→
param
s/bootnodes.go
View file @
dfe79cc7
// Copyright 2015 The go-ethereum Authors
// Copyright 2015 The go-ethereum Authors
// This file is part of
go-ethereum
.
// This file is part of
the go-ethereum library
.
//
//
//
go-ethereum
is free software: you can redistribute it and/or modify
//
The go-ethereum library
is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU
Lesser
General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// (at your option) any later version.
//
//
//
go-ethereum
is distributed in the hope that it will be useful,
//
The go-ethereum library
is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU
Lesser
General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU
Lesser
General Public License
// along with
go-ethereum
. If not, see <http://www.gnu.org/licenses/>.
// along with
the go-ethereum library
. If not, see <http://www.gnu.org/licenses/>.
package
util
s
package
param
s
import
(
import
(
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/discover"
...
...
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