Commit e7b33e9a authored by Taylor Gerring's avatar Taylor Gerring

Move p2p.MakeName to ethutil.MakeVersion

parent fb248823
...@@ -31,7 +31,6 @@ import ( ...@@ -31,7 +31,6 @@ import (
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/state"
) )
...@@ -62,7 +61,7 @@ func main() { ...@@ -62,7 +61,7 @@ func main() {
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH") utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethereum, err := eth.New(&eth.Config{ ethereum, err := eth.New(&eth.Config{
Name: p2p.MakeName(ClientIdentifier, Version), Name: ethutil.MakeVersion(ClientIdentifier, Version),
KeyStore: KeyStore, KeyStore: KeyStore,
DataDir: Datadir, DataDir: Datadir,
LogFile: LogFile, LogFile: LogFile,
......
...@@ -28,8 +28,8 @@ import ( ...@@ -28,8 +28,8 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/ui/qt/webengine" "github.com/ethereum/go-ethereum/ui/qt/webengine"
"github.com/obscuren/qml" "github.com/obscuren/qml"
) )
...@@ -52,7 +52,7 @@ func run() error { ...@@ -52,7 +52,7 @@ func run() error {
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH") config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethereum, err := eth.New(&eth.Config{ ethereum, err := eth.New(&eth.Config{
Name: p2p.MakeName(ClientIdentifier, Version), Name: ethutil.MakeVersion(ClientIdentifier, Version),
KeyStore: KeyStore, KeyStore: KeyStore,
DataDir: Datadir, DataDir: Datadir,
LogFile: LogFile, LogFile: LogFile,
......
...@@ -13,6 +13,10 @@ import ( ...@@ -13,6 +13,10 @@ import (
"github.com/kardianos/osext" "github.com/kardianos/osext"
) )
func MakeVersion(name, version string) string {
return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
}
func DefaultAssetPath() string { func DefaultAssetPath() string {
var assetPath string var assetPath string
pwd, _ := os.Getwd() pwd, _ := os.Getwd()
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"net" "net"
"runtime"
"sync" "sync"
"time" "time"
...@@ -24,13 +23,6 @@ const ( ...@@ -24,13 +23,6 @@ const (
var srvlog = logger.NewLogger("P2P Server") var srvlog = logger.NewLogger("P2P Server")
var srvjslog = logger.NewJsonLogger() 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. // Server manages all peer connections.
// //
// The fields of Server are used as configuration parameters. // The fields of Server are used as configuration parameters.
...@@ -45,7 +37,7 @@ type Server struct { ...@@ -45,7 +37,7 @@ type Server struct {
MaxPeers int MaxPeers int
// Name sets the node name of this server. // Name sets the node name of this server.
// Use MakeName to create a name that follows existing conventions. // Use ethutil.MakeVersion to create a name that follows existing conventions.
Name string Name string
// Bootstrap nodes are used to establish connectivity // Bootstrap nodes are used to establish connectivity
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment