Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/xeth"
Expand Down Expand Up @@ -194,7 +193,7 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {

func GetEthereum(clientID, version string, ctx *cli.Context) (*eth.Ethereum, error) {
return eth.New(&eth.Config{
Name: p2p.MakeName(clientID, version),
Name: ethutil.MakeName(clientID, version),
DataDir: ctx.GlobalString(DataDirFlag.Name),
LogFile: ctx.GlobalString(LogFileFlag.Name),
LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
Expand Down
7 changes: 7 additions & 0 deletions ethutil/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import (
"github.com/kardianos/osext"
)

// MakeName creates a node name that follows the ethereum convention
// for such names. It adds the operation system name and Go runtime version
// the name.
func MakeName(name, version string) string {
return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
}

func DefaultAssetPath() string {
var assetPath string
pwd, _ := os.Getwd()
Expand Down
10 changes: 1 addition & 9 deletions p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"net"
"runtime"
"sync"
"time"

Expand All @@ -33,13 +32,6 @@ const (
var srvlog = logger.NewLogger("P2P Server")
var srvjslog = logger.NewJsonLogger()

// MakeName creates a node name that follows the ethereum convention
// for such names. It adds the operation system name and Go runtime version
// the name.
func MakeName(name, version string) string {
return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
}

// Server manages all peer connections.
//
// The fields of Server are used as configuration parameters.
Expand All @@ -54,7 +46,7 @@ type Server struct {
MaxPeers int

// Name sets the node name of this server.
// Use MakeName to create a name that follows existing conventions.
// Use ethutil.MakeName to create a name that follows existing conventions.
Name string

// Bootstrap nodes are used to establish connectivity
Expand Down