aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-21 00:17:04 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-21 00:17:04 +0800
commit3d7c1b8194e509f61fb64a129242b3170ecffd08 (patch)
treed31d4bc0d7bd95149d237250cd88a9f86778c504 /cmd/geth/main.go
parentf28b2bb6edad287ae418abc7b9ef5e147df84886 (diff)
parent3b008723db3f89696dab53b311cbd2efc987a01f (diff)
downloadgo-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar.gz
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar.bz2
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar.lz
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar.xz
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.tar.zst
go-tangerine-3d7c1b8194e509f61fb64a129242b3170ecffd08.zip
Merge pull request #755 from karalabe/command-flags-cleanup
cmd/geth, cmd/utils: add cli flags for pprof and whisper
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 97d358407..ddbd1f129 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -24,8 +24,6 @@ import (
"bufio"
"fmt"
"io/ioutil"
- "log"
- "net/http"
"os"
"runtime"
"strconv"
@@ -237,6 +235,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.RPCEnabledFlag,
utils.RPCListenAddrFlag,
utils.RPCPortFlag,
+ utils.WhisperEnabledFlag,
utils.VMDebugFlag,
utils.ProtocolVersionFlag,
utils.NetworkIdFlag,
@@ -247,6 +246,14 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.LogVModuleFlag,
utils.LogFileFlag,
utils.LogJSONFlag,
+ utils.PProfEanbledFlag,
+ utils.PProfPortFlag,
+ }
+ app.Before = func(ctx *cli.Context) error {
+ if ctx.GlobalBool(utils.PProfEanbledFlag.Name) {
+ utils.StartPProf(ctx)
+ }
+ return nil
}
// missing:
@@ -261,11 +268,6 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
}
func main() {
- // Start up the default http server for pprof
- go func() {
- log.Println(http.ListenAndServe("localhost:6060", nil))
- }()
-
fmt.Printf("Welcome to the FRONTIER\n")
runtime.GOMAXPROCS(runtime.NumCPU())
defer logger.Flush()
@@ -337,6 +339,7 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass
}
func startEth(ctx *cli.Context, eth *eth.Ethereum) {
+ // Start Ethereum itself
utils.StartEthereum(eth)
am := eth.AccountManager()