diff options
Diffstat (limited to 'p2p/server.go')
-rw-r--r-- | p2p/server.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/p2p/server.go b/p2p/server.go index 25da04cd9..3ea2538d1 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "net" + "runtime" "sync" "time" @@ -23,6 +24,13 @@ 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. @@ -37,7 +45,7 @@ type Server struct { MaxPeers int // Name sets the node name of this server. - // Use ethutil.MakeVersion to create a name that follows existing conventions. + // Use MakeName to create a name that follows existing conventions. Name string // Bootstrap nodes are used to establish connectivity |