Skip to content

Commit cb1fa52

Browse files
committed
cmd/geth, cmd/mist, eth, flags: renamed loglevel to verbosity
1 parent c8fc4ce commit cb1fa52

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

cmd/geth/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
244244
utils.MaxPeersFlag,
245245
utils.MaxPendingPeersFlag,
246246
utils.EtherbaseFlag,
247+
utils.GasPriceFlag,
247248
utils.MinerThreadsFlag,
248249
utils.MiningEnabledFlag,
249250
utils.NATFlag,
@@ -258,7 +259,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
258259
utils.ProtocolVersionFlag,
259260
utils.NetworkIdFlag,
260261
utils.RPCCORSDomainFlag,
261-
utils.LogLevelFlag,
262+
utils.VerbosityFlag,
262263
utils.BacktraceAtFlag,
263264
utils.LogToStdErrFlag,
264265
utils.LogVModuleFlag,

cmd/mist/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func init() {
7373
utils.DataDirFlag,
7474
utils.ListenPortFlag,
7575
utils.LogFileFlag,
76-
utils.LogLevelFlag,
76+
utils.VerbosityFlag,
7777
utils.MaxPeersFlag,
7878
utils.MaxPendingPeersFlag,
7979
utils.MinerThreadsFlag,

cmd/utils/flags.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"crypto/ecdsa"
55
"fmt"
66
"log"
7+
"math/big"
78
"net/http"
89
"os"
910
"path"
@@ -116,6 +117,11 @@ var (
116117
Usage: "Public address for block mining rewards. By default the address of your primary account is used",
117118
Value: "primary",
118119
}
120+
GasPriceFlag = cli.StringFlag{
121+
Name: "gasprice",
122+
Usage: "Sets the minimal gasprice when mining transactions",
123+
Value: new(big.Int).Mul(big.NewInt(10), common.Szabo).String(),
124+
}
119125

120126
UnlockedAccountFlag = cli.StringFlag{
121127
Name: "unlock",
@@ -133,8 +139,8 @@ var (
133139
Name: "logfile",
134140
Usage: "Send log output to a file",
135141
}
136-
LogLevelFlag = cli.IntFlag{
137-
Name: "loglevel",
142+
VerbosityFlag = cli.IntFlag{
143+
Name: "verbosity",
138144
Usage: "Logging verbosity: 0-6 (0=silent, 1=error, 2=warn, 3=info, 4=core, 5=debug, 6=debug detail)",
139145
Value: int(logger.InfoLevel),
140146
}
@@ -270,7 +276,7 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) {
270276

271277
func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
272278
// Set verbosity on glog
273-
glog.SetV(ctx.GlobalInt(LogLevelFlag.Name))
279+
glog.SetV(ctx.GlobalInt(VerbosityFlag.Name))
274280
// Set the log type
275281
//glog.SetToStderr(ctx.GlobalBool(LogToStdErrFlag.Name))
276282
glog.SetToStderr(true)
@@ -290,7 +296,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
290296
SkipBcVersionCheck: false,
291297
NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
292298
LogFile: ctx.GlobalString(LogFileFlag.Name),
293-
LogLevel: ctx.GlobalInt(LogLevelFlag.Name),
299+
Verbosity: ctx.GlobalInt(VerbosityFlag.Name),
294300
LogJSON: ctx.GlobalString(LogJSONFlag.Name),
295301
Etherbase: ctx.GlobalString(EtherbaseFlag.Name),
296302
MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name),
@@ -305,6 +311,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
305311
Shh: ctx.GlobalBool(WhisperEnabledFlag.Name),
306312
Dial: true,
307313
BootNodes: ctx.GlobalString(BootnodesFlag.Name),
314+
GasPrice: common.String2Big(ctx.GlobalString(GasPriceFlag.Name)),
308315
}
309316

310317
}

eth/backend.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"io/ioutil"
8+
"math/big"
89
"os"
910
"path"
1011
"path/filepath"
@@ -53,12 +54,12 @@ type Config struct {
5354
BlockChainVersion int
5455
SkipBcVersionCheck bool // e.g. blockchain export
5556

56-
DataDir string
57-
LogFile string
58-
LogLevel int
59-
LogJSON string
60-
VmDebug bool
61-
NatSpec bool
57+
DataDir string
58+
LogFile string
59+
Verbosity int
60+
LogJSON string
61+
VmDebug bool
62+
NatSpec bool
6263

6364
MaxPeers int
6465
MaxPendingPeers int
@@ -76,6 +77,7 @@ type Config struct {
7677
Dial bool
7778

7879
Etherbase string
80+
GasPrice *big.Int
7981
MinerThreads int
8082
AccountManager *accounts.Manager
8183

@@ -200,7 +202,7 @@ type Ethereum struct {
200202

201203
func New(config *Config) (*Ethereum, error) {
202204
// Bootstrap database
203-
logger.New(config.DataDir, config.LogFile, config.LogLevel)
205+
logger.New(config.DataDir, config.LogFile, config.Verbosity)
204206
if len(config.LogJSON) > 0 {
205207
logger.NewJSONsystem(config.DataDir, config.LogJSON)
206208
}
@@ -266,6 +268,8 @@ func New(config *Config) (*Ethereum, error) {
266268
eth.blockProcessor = core.NewBlockProcessor(stateDb, extraDb, eth.pow, eth.txPool, eth.chainManager, eth.EventMux())
267269
eth.chainManager.SetProcessor(eth.blockProcessor)
268270
eth.miner = miner.New(eth, eth.pow, config.MinerThreads)
271+
eth.miner.SetGasPrice(config.GasPrice)
272+
269273
eth.protocolManager = NewProtocolManager(config.ProtocolVersion, config.NetworkId, eth.eventMux, eth.txPool, eth.chainManager, eth.downloader)
270274
if config.Shh {
271275
eth.whisper = whisper.New()

0 commit comments

Comments
 (0)