diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-08-08 17:15:08 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-10 14:06:59 +0800 |
commit | f0998415ba9a73f0add32f9b5aed2aec98b9a7f3 (patch) | |
tree | f85ad72f6213fc953b3174378d7c7443cc1d1dd5 /cmd | |
parent | 00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284 (diff) | |
download | go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar.gz go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar.bz2 go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar.lz go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar.xz go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.tar.zst go-tangerine-f0998415ba9a73f0add32f9b5aed2aec98b9a7f3.zip |
cmd, consensus/ethash, eth: miner push notifications
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/main.go | 3 | ||||
-rw-r--r-- | cmd/geth/usage.go | 1 | ||||
-rw-r--r-- | cmd/utils/flags.go | 14 |
3 files changed, 13 insertions, 5 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 77ef6afe2..d556ad92c 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -98,8 +98,9 @@ var ( utils.MaxPendingPeersFlag, utils.EtherbaseFlag, utils.GasPriceFlag, - utils.MinerThreadsFlag, utils.MiningEnabledFlag, + utils.MinerThreadsFlag, + utils.MinerNotifyFlag, utils.TargetGasLimitFlag, utils.NATFlag, utils.NoDiscoverFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 6a12a66cc..9d63c68f7 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -185,6 +185,7 @@ var AppHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ utils.MiningEnabledFlag, utils.MinerThreadsFlag, + utils.MinerNotifyFlag, utils.EtherbaseFlag, utils.TargetGasLimitFlag, utils.GasPriceFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 522ad06b6..d6142f246 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -24,7 +24,6 @@ import ( "math/big" "os" "path/filepath" - "runtime" "strconv" "strings" "time" @@ -318,9 +317,13 @@ var ( Usage: "Enable mining", } MinerThreadsFlag = cli.IntFlag{ - Name: "minerthreads", + Name: "miner.threads", Usage: "Number of CPU threads to use for mining", - Value: runtime.NumCPU(), + Value: 0, + } + MinerNotifyFlag = cli.StringFlag{ + Name: "miner.notify", + Usage: "Comma separated HTTP URL list to notify of new work packages", } TargetGasLimitFlag = cli.Uint64Flag{ Name: "targetgaslimit", @@ -1093,6 +1096,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if ctx.GlobalIsSet(MinerThreadsFlag.Name) { cfg.MinerThreads = ctx.GlobalInt(MinerThreadsFlag.Name) } + if ctx.GlobalIsSet(MinerNotifyFlag.Name) { + cfg.MinerNotify = strings.Split(ctx.GlobalString(MinerNotifyFlag.Name), ",") + } if ctx.GlobalIsSet(DocRootFlag.Name) { cfg.DocRoot = ctx.GlobalString(DocRootFlag.Name) } @@ -1293,7 +1299,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai DatasetDir: stack.ResolvePath(eth.DefaultConfig.Ethash.DatasetDir), DatasetsInMem: eth.DefaultConfig.Ethash.DatasetsInMem, DatasetsOnDisk: eth.DefaultConfig.Ethash.DatasetsOnDisk, - }) + }, nil) } } if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" { |