|
|
@ -1,6 +1,7 @@ |
|
|
|
package common |
|
|
|
package common |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"fmt" |
|
|
|
"io/ioutil" |
|
|
|
"io/ioutil" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"os/user" |
|
|
|
"os/user" |
|
|
@ -12,6 +13,13 @@ import ( |
|
|
|
"github.com/kardianos/osext" |
|
|
|
"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 ExpandHomePath(p string) (path string) { |
|
|
|
func ExpandHomePath(p string) (path string) { |
|
|
|
path = p |
|
|
|
path = p |
|
|
|
|
|
|
|
|
|
|
|