Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
2a0e5888
Commit
2a0e5888
authored
Mar 12, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #460 from tgerring/ethutil
Move MakeName to ethutil
parents
31a95151
485e37e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
flags.go
cmd/utils/flags.go
+1
-2
common.go
ethutil/common.go
+7
-0
server.go
p2p/server.go
+1
-9
No files found.
cmd/utils/flags.go
View file @
2a0e5888
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/xeth"
"github.com/ethereum/go-ethereum/xeth"
...
@@ -194,7 +193,7 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
...
@@ -194,7 +193,7 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
(
*
eth
.
Ethereum
,
error
)
{
func
GetEthereum
(
clientID
,
version
string
,
ctx
*
cli
.
Context
)
(
*
eth
.
Ethereum
,
error
)
{
return
eth
.
New
(
&
eth
.
Config
{
return
eth
.
New
(
&
eth
.
Config
{
Name
:
p2p
.
MakeName
(
clientID
,
version
),
Name
:
ethutil
.
MakeName
(
clientID
,
version
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
DataDir
:
ctx
.
GlobalString
(
DataDirFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
LogFile
:
ctx
.
GlobalString
(
LogFileFlag
.
Name
),
LogLevel
:
ctx
.
GlobalInt
(
LogLevelFlag
.
Name
),
LogLevel
:
ctx
.
GlobalInt
(
LogLevelFlag
.
Name
),
...
...
ethutil/common.go
View file @
2a0e5888
...
@@ -13,6 +13,13 @@ import (
...
@@ -13,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
DefaultAssetPath
()
string
{
func
DefaultAssetPath
()
string
{
var
assetPath
string
var
assetPath
string
pwd
,
_
:=
os
.
Getwd
()
pwd
,
_
:=
os
.
Getwd
()
...
...
p2p/server.go
View file @
2a0e5888
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"errors"
"errors"
"fmt"
"fmt"
"net"
"net"
"runtime"
"sync"
"sync"
"time"
"time"
...
@@ -33,13 +32,6 @@ const (
...
@@ -33,13 +32,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.
...
@@ -54,7 +46,7 @@ type Server struct {
...
@@ -54,7 +46,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.
MakeName 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment