@@ -23,10 +23,10 @@ import (
23
23
"github.com/ethereum/go-ethereum/logger/glog"
24
24
"github.com/ethereum/go-ethereum/p2p/nat"
25
25
"github.com/ethereum/go-ethereum/rpc"
26
- "github.com/ethereum/go-ethereum/xeth"
27
26
"github.com/ethereum/go-ethereum/rpc/api"
28
- "github.com/ethereum/go-ethereum/rpc/comms"
29
27
"github.com/ethereum/go-ethereum/rpc/codec"
28
+ "github.com/ethereum/go-ethereum/rpc/comms"
29
+ "github.com/ethereum/go-ethereum/xeth"
30
30
)
31
31
32
32
func init () {
@@ -132,7 +132,7 @@ var (
132
132
GasPriceFlag = cli.StringFlag {
133
133
Name : "gasprice" ,
134
134
Usage : "Sets the minimal gasprice when mining transactions" ,
135
- Value : new (big.Int ).Mul (big .NewInt (10 ), common .Szabo ).String (),
135
+ Value : new (big.Int ).Mul (big .NewInt (1 ), common .Szabo ).String (),
136
136
}
137
137
138
138
UnlockedAccountFlag = cli.StringFlag {
@@ -276,6 +276,36 @@ var (
276
276
Usage : "solidity compiler to be used" ,
277
277
Value : "solc" ,
278
278
}
279
+ GpoMinGasPriceFlag = cli.StringFlag {
280
+ Name : "gpomin" ,
281
+ Usage : "Minimum suggested gas price" ,
282
+ Value : new (big.Int ).Mul (big .NewInt (1 ), common .Szabo ).String (),
283
+ }
284
+ GpoMaxGasPriceFlag = cli.StringFlag {
285
+ Name : "gpomax" ,
286
+ Usage : "Maximum suggested gas price" ,
287
+ Value : new (big.Int ).Mul (big .NewInt (100 ), common .Szabo ).String (),
288
+ }
289
+ GpoFullBlockRatioFlag = cli.IntFlag {
290
+ Name : "gpofull" ,
291
+ Usage : "Full block threshold for gas price calculation (%)" ,
292
+ Value : 80 ,
293
+ }
294
+ GpobaseStepDownFlag = cli.IntFlag {
295
+ Name : "gpobasedown" ,
296
+ Usage : "Suggested gas price base step down ratio (1/1000)" ,
297
+ Value : 10 ,
298
+ }
299
+ GpobaseStepUpFlag = cli.IntFlag {
300
+ Name : "gpobaseup" ,
301
+ Usage : "Suggested gas price base step up ratio (1/1000)" ,
302
+ Value : 100 ,
303
+ }
304
+ GpobaseCorrectionFactorFlag = cli.IntFlag {
305
+ Name : "gpobasecf" ,
306
+ Usage : "Suggested gas price base correction factor (%)" ,
307
+ Value : 110 ,
308
+ }
279
309
)
280
310
281
311
// MakeNAT creates a port mapper from set command line flags.
@@ -313,33 +343,39 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
313
343
clientID += "/" + customName
314
344
}
315
345
return & eth.Config {
316
- Name : common .MakeName (clientID , version ),
317
- DataDir : ctx .GlobalString (DataDirFlag .Name ),
318
- ProtocolVersion : ctx .GlobalInt (ProtocolVersionFlag .Name ),
319
- GenesisNonce : ctx .GlobalInt (GenesisNonceFlag .Name ),
320
- BlockChainVersion : ctx .GlobalInt (BlockchainVersionFlag .Name ),
321
- SkipBcVersionCheck : false ,
322
- NetworkId : ctx .GlobalInt (NetworkIdFlag .Name ),
323
- LogFile : ctx .GlobalString (LogFileFlag .Name ),
324
- Verbosity : ctx .GlobalInt (VerbosityFlag .Name ),
325
- LogJSON : ctx .GlobalString (LogJSONFlag .Name ),
326
- Etherbase : ctx .GlobalString (EtherbaseFlag .Name ),
327
- MinerThreads : ctx .GlobalInt (MinerThreadsFlag .Name ),
328
- AccountManager : MakeAccountManager (ctx ),
329
- VmDebug : ctx .GlobalBool (VMDebugFlag .Name ),
330
- MaxPeers : ctx .GlobalInt (MaxPeersFlag .Name ),
331
- MaxPendingPeers : ctx .GlobalInt (MaxPendingPeersFlag .Name ),
332
- Port : ctx .GlobalString (ListenPortFlag .Name ),
333
- NAT : MakeNAT (ctx ),
334
- NatSpec : ctx .GlobalBool (NatspecEnabledFlag .Name ),
335
- Discovery : ! ctx .GlobalBool (NoDiscoverFlag .Name ),
336
- NodeKey : MakeNodeKey (ctx ),
337
- Shh : ctx .GlobalBool (WhisperEnabledFlag .Name ),
338
- Dial : true ,
339
- BootNodes : ctx .GlobalString (BootnodesFlag .Name ),
340
- GasPrice : common .String2Big (ctx .GlobalString (GasPriceFlag .Name )),
341
- SolcPath : ctx .GlobalString (SolcPathFlag .Name ),
342
- AutoDAG : ctx .GlobalBool (AutoDAGFlag .Name ) || ctx .GlobalBool (MiningEnabledFlag .Name ),
346
+ Name : common .MakeName (clientID , version ),
347
+ DataDir : ctx .GlobalString (DataDirFlag .Name ),
348
+ ProtocolVersion : ctx .GlobalInt (ProtocolVersionFlag .Name ),
349
+ GenesisNonce : ctx .GlobalInt (GenesisNonceFlag .Name ),
350
+ BlockChainVersion : ctx .GlobalInt (BlockchainVersionFlag .Name ),
351
+ SkipBcVersionCheck : false ,
352
+ NetworkId : ctx .GlobalInt (NetworkIdFlag .Name ),
353
+ LogFile : ctx .GlobalString (LogFileFlag .Name ),
354
+ Verbosity : ctx .GlobalInt (VerbosityFlag .Name ),
355
+ LogJSON : ctx .GlobalString (LogJSONFlag .Name ),
356
+ Etherbase : ctx .GlobalString (EtherbaseFlag .Name ),
357
+ MinerThreads : ctx .GlobalInt (MinerThreadsFlag .Name ),
358
+ AccountManager : MakeAccountManager (ctx ),
359
+ VmDebug : ctx .GlobalBool (VMDebugFlag .Name ),
360
+ MaxPeers : ctx .GlobalInt (MaxPeersFlag .Name ),
361
+ MaxPendingPeers : ctx .GlobalInt (MaxPendingPeersFlag .Name ),
362
+ Port : ctx .GlobalString (ListenPortFlag .Name ),
363
+ NAT : MakeNAT (ctx ),
364
+ NatSpec : ctx .GlobalBool (NatspecEnabledFlag .Name ),
365
+ Discovery : ! ctx .GlobalBool (NoDiscoverFlag .Name ),
366
+ NodeKey : MakeNodeKey (ctx ),
367
+ Shh : ctx .GlobalBool (WhisperEnabledFlag .Name ),
368
+ Dial : true ,
369
+ BootNodes : ctx .GlobalString (BootnodesFlag .Name ),
370
+ GasPrice : common .String2Big (ctx .GlobalString (GasPriceFlag .Name )),
371
+ GpoMinGasPrice : common .String2Big (ctx .GlobalString (GpoMinGasPriceFlag .Name )),
372
+ GpoMaxGasPrice : common .String2Big (ctx .GlobalString (GpoMaxGasPriceFlag .Name )),
373
+ GpoFullBlockRatio : ctx .GlobalInt (GpoFullBlockRatioFlag .Name ),
374
+ GpobaseStepDown : ctx .GlobalInt (GpobaseStepDownFlag .Name ),
375
+ GpobaseStepUp : ctx .GlobalInt (GpobaseStepUpFlag .Name ),
376
+ GpobaseCorrectionFactor : ctx .GlobalInt (GpobaseCorrectionFactorFlag .Name ),
377
+ SolcPath : ctx .GlobalString (SolcPathFlag .Name ),
378
+ AutoDAG : ctx .GlobalBool (AutoDAGFlag .Name ) || ctx .GlobalBool (MiningEnabledFlag .Name ),
343
379
}
344
380
}
345
381
@@ -396,7 +432,7 @@ func IpcSocketPath(ctx *cli.Context) (ipcpath string) {
396
432
if ctx .GlobalString (IPCPathFlag .Name ) != common .DefaultIpcPath () {
397
433
ipcpath = ctx .GlobalString (IPCPathFlag .Name )
398
434
} else if ctx .GlobalString (DataDirFlag .Name ) != "" &&
399
- ctx .GlobalString (DataDirFlag .Name ) != common .DefaultDataDir () {
435
+ ctx .GlobalString (DataDirFlag .Name ) != common .DefaultDataDir () {
400
436
ipcpath = filepath .Join (ctx .GlobalString (DataDirFlag .Name ), "geth.ipc" )
401
437
}
402
438
}
0 commit comments