Skip to content

Commit dfe79cc

Browse files
committed
cmd/utils, mobile: place bootnodes in LGPL packages
1 parent 4a439c2 commit dfe79cc

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

cmd/utils/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
488488
// Return pre-configured nodes if none were manually requested
489489
if !ctx.GlobalIsSet(BootnodesFlag.Name) {
490490
if ctx.GlobalBool(TestNetFlag.Name) {
491-
return TestnetBootnodes
491+
return params.TestnetBootnodes
492492
}
493-
return MainnetBootnodes
493+
return params.MainnetBootnodes
494494
}
495495
// Otherwise parse and use the CLI bootstrap nodes
496496
bootnodes := []*discover.Node{}
@@ -511,7 +511,7 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
511511
func MakeBootstrapNodesV5(ctx *cli.Context) []*discv5.Node {
512512
// Return pre-configured nodes if none were manually requested
513513
if !ctx.GlobalIsSet(BootnodesFlag.Name) {
514-
return DiscoveryV5Bootnodes
514+
return params.DiscoveryV5Bootnodes
515515
}
516516
// Otherwise parse and use the CLI bootstrap nodes
517517
bootnodes := []*discv5.Node{}

mobile/discover.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,9 @@ package geth
2222
import (
2323
"errors"
2424

25-
"github.com/ethereum/go-ethereum/cmd/utils"
2625
"github.com/ethereum/go-ethereum/p2p/discv5"
2726
)
2827

29-
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
30-
// by the foundation running the V5 discovery protocol.
31-
func FoundationBootnodes() *Enodes {
32-
nodes := &Enodes{nodes: make([]*discv5.Node, len(utils.DiscoveryV5Bootnodes))}
33-
for i, node := range utils.DiscoveryV5Bootnodes {
34-
nodes.nodes[i] = node
35-
}
36-
return nodes
37-
}
38-
3928
// Enode represents a host on the network.
4029
type Enode struct {
4130
node *discv5.Node

mobile/params.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package geth
2020

2121
import (
2222
"github.com/ethereum/go-ethereum/core"
23+
"github.com/ethereum/go-ethereum/p2p/discv5"
2324
"github.com/ethereum/go-ethereum/params"
2425
)
2526

@@ -76,3 +77,13 @@ type ChainConfig struct {
7677
func NewChainConfig() *ChainConfig {
7778
return new(ChainConfig)
7879
}
80+
81+
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
82+
// by the foundation running the V5 discovery protocol.
83+
func FoundationBootnodes() *Enodes {
84+
nodes := &Enodes{nodes: make([]*discv5.Node, len(params.DiscoveryV5Bootnodes))}
85+
for i, node := range params.DiscoveryV5Bootnodes {
86+
nodes.nodes[i] = node
87+
}
88+
return nodes
89+
}

cmd/utils/bootnodes.go renamed to params/bootnodes.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Copyright 2015 The go-ethereum Authors
2-
// This file is part of go-ethereum.
2+
// This file is part of the go-ethereum library.
33
//
4-
// go-ethereum is free software: you can redistribute it and/or modify
5-
// it under the terms of the GNU General Public License as published by
4+
// The go-ethereum library is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Lesser General Public License as published by
66
// the Free Software Foundation, either version 3 of the License, or
77
// (at your option) any later version.
88
//
9-
// go-ethereum is distributed in the hope that it will be useful,
9+
// The go-ethereum library is distributed in the hope that it will be useful,
1010
// but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
// GNU General Public License for more details.
12+
// GNU Lesser General Public License for more details.
1313
//
14-
// You should have received a copy of the GNU General Public License
15-
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
14+
// You should have received a copy of the GNU Lesser General Public License
15+
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
package utils
17+
package params
1818

1919
import (
2020
"github.com/ethereum/go-ethereum/p2p/discover"

0 commit comments

Comments
 (0)