aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-19 05:53:30 +0800
committerobscuren <geffobscura@gmail.com>2015-04-19 05:53:30 +0800
commit03b4cf74a2d2ce2f1ff39f0354b9577425e6524e (patch)
tree298438f89fcc08497af20e59ed15975883388837 /cmd
parentd34e4dc5ac2fc80c727e01ad175d3137316247a1 (diff)
downloadgo-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar.gz
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar.bz2
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar.lz
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar.xz
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.tar.zst
go-tangerine-03b4cf74a2d2ce2f1ff39f0354b9577425e6524e.zip
geth: added identity flag which allows to set a custom node name
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go1
-rw-r--r--cmd/utils/flags.go9
2 files changed, 10 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index c0953d75e..dab167bbb 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -218,6 +218,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
},
}
app.Flags = []cli.Flag{
+ utils.IdentityFlag,
utils.UnlockedAccountFlag,
utils.PasswordFileFlag,
utils.BootnodesFlag,
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 8141fae82..a1d9eedda 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -89,6 +89,10 @@ var (
Usage: "Blockchain version",
Value: core.BlockChainVersion,
}
+ IdentityFlag = cli.StringFlag{
+ Name: "identity",
+ Usage: "node name",
+ }
// miner settings
MinerThreadsFlag = cli.IntFlag{
@@ -242,6 +246,11 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
// Set the log dir
glog.SetLogDir(ctx.GlobalString(LogFileFlag.Name))
+ customName := ctx.GlobalString(IdentityFlag.Name)
+ if len(customName) > 0 {
+ clientID += "/" + customName
+ }
+
return &eth.Config{
Name: common.MakeName(clientID, version),
DataDir: ctx.GlobalString(DataDirFlag.Name),