@@ -123,35 +123,6 @@ var (
123
123
Name : "nousb" ,
124
124
Usage : "Disables monitoring for and managine USB hardware wallets" ,
125
125
}
126
- EthashCacheDirFlag = DirectoryFlag {
127
- Name : "ethash.cachedir" ,
128
- Usage : "Directory to store the ethash verification caches (default = inside the datadir)" ,
129
- }
130
- EthashCachesInMemoryFlag = cli.IntFlag {
131
- Name : "ethash.cachesinmem" ,
132
- Usage : "Number of recent ethash caches to keep in memory (16MB each)" ,
133
- Value : eth .DefaultConfig .EthashCachesInMem ,
134
- }
135
- EthashCachesOnDiskFlag = cli.IntFlag {
136
- Name : "ethash.cachesondisk" ,
137
- Usage : "Number of recent ethash caches to keep on disk (16MB each)" ,
138
- Value : eth .DefaultConfig .EthashCachesOnDisk ,
139
- }
140
- EthashDatasetDirFlag = DirectoryFlag {
141
- Name : "ethash.dagdir" ,
142
- Usage : "Directory to store the ethash mining DAGs (default = inside home folder)" ,
143
- Value : DirectoryString {eth .DefaultConfig .EthashDatasetDir },
144
- }
145
- EthashDatasetsInMemoryFlag = cli.IntFlag {
146
- Name : "ethash.dagsinmem" ,
147
- Usage : "Number of recent ethash mining DAGs to keep in memory (1+GB each)" ,
148
- Value : eth .DefaultConfig .EthashDatasetsInMem ,
149
- }
150
- EthashDatasetsOnDiskFlag = cli.IntFlag {
151
- Name : "ethash.dagsondisk" ,
152
- Usage : "Number of recent ethash mining DAGs to keep on disk (1+GB each)" ,
153
- Value : eth .DefaultConfig .EthashDatasetsOnDisk ,
154
- }
155
126
NetworkIdFlag = cli.Uint64Flag {
156
127
Name : "networkid" ,
157
128
Usage : "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)" ,
@@ -207,6 +178,72 @@ var (
207
178
Name : "lightkdf" ,
208
179
Usage : "Reduce key-derivation RAM & CPU usage at some expense of KDF strength" ,
209
180
}
181
+ // Ethash settings
182
+ EthashCacheDirFlag = DirectoryFlag {
183
+ Name : "ethash.cachedir" ,
184
+ Usage : "Directory to store the ethash verification caches (default = inside the datadir)" ,
185
+ }
186
+ EthashCachesInMemoryFlag = cli.IntFlag {
187
+ Name : "ethash.cachesinmem" ,
188
+ Usage : "Number of recent ethash caches to keep in memory (16MB each)" ,
189
+ Value : eth .DefaultConfig .EthashCachesInMem ,
190
+ }
191
+ EthashCachesOnDiskFlag = cli.IntFlag {
192
+ Name : "ethash.cachesondisk" ,
193
+ Usage : "Number of recent ethash caches to keep on disk (16MB each)" ,
194
+ Value : eth .DefaultConfig .EthashCachesOnDisk ,
195
+ }
196
+ EthashDatasetDirFlag = DirectoryFlag {
197
+ Name : "ethash.dagdir" ,
198
+ Usage : "Directory to store the ethash mining DAGs (default = inside home folder)" ,
199
+ Value : DirectoryString {eth .DefaultConfig .EthashDatasetDir },
200
+ }
201
+ EthashDatasetsInMemoryFlag = cli.IntFlag {
202
+ Name : "ethash.dagsinmem" ,
203
+ Usage : "Number of recent ethash mining DAGs to keep in memory (1+GB each)" ,
204
+ Value : eth .DefaultConfig .EthashDatasetsInMem ,
205
+ }
206
+ EthashDatasetsOnDiskFlag = cli.IntFlag {
207
+ Name : "ethash.dagsondisk" ,
208
+ Usage : "Number of recent ethash mining DAGs to keep on disk (1+GB each)" ,
209
+ Value : eth .DefaultConfig .EthashDatasetsOnDisk ,
210
+ }
211
+ // Transaction pool settings
212
+ TxPoolPriceLimitFlag = cli.Uint64Flag {
213
+ Name : "txpool.pricelimit" ,
214
+ Usage : "Minimum gas price limit to enforce for acceptance into the pool" ,
215
+ Value : eth .DefaultConfig .TxPool .PriceLimit ,
216
+ }
217
+ TxPoolPriceBumpFlag = cli.Uint64Flag {
218
+ Name : "txpool.pricebump" ,
219
+ Usage : "Price bump percentage to replace an already existing transaction" ,
220
+ Value : eth .DefaultConfig .TxPool .PriceBump ,
221
+ }
222
+ TxPoolAccountSlotsFlag = cli.Uint64Flag {
223
+ Name : "txpool.accountslots" ,
224
+ Usage : "Minimum number of executable transaction slots guaranteed per account" ,
225
+ Value : eth .DefaultConfig .TxPool .AccountSlots ,
226
+ }
227
+ TxPoolGlobalSlotsFlag = cli.Uint64Flag {
228
+ Name : "txpool.globalslots" ,
229
+ Usage : "Maximum number of executable transaction slots for all accounts" ,
230
+ Value : eth .DefaultConfig .TxPool .GlobalSlots ,
231
+ }
232
+ TxPoolAccountQueueFlag = cli.Uint64Flag {
233
+ Name : "txpool.accountqueue" ,
234
+ Usage : "Maximum number of non-executable transaction slots permitted per account" ,
235
+ Value : eth .DefaultConfig .TxPool .AccountQueue ,
236
+ }
237
+ TxPoolGlobalQueueFlag = cli.Uint64Flag {
238
+ Name : "txpool.globalqueue" ,
239
+ Usage : "Maximum number of non-executable transaction slots for all accounts" ,
240
+ Value : eth .DefaultConfig .TxPool .GlobalQueue ,
241
+ }
242
+ TxPoolLifetimeFlag = cli.DurationFlag {
243
+ Name : "txpool.lifetime" ,
244
+ Usage : "Maximum amount of time non-executable transaction are queued" ,
245
+ Value : eth .DefaultConfig .TxPool .Lifetime ,
246
+ }
210
247
// Performance tuning settings
211
248
CacheFlag = cli.IntFlag {
212
249
Name : "cache" ,
@@ -784,6 +821,30 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config) {
784
821
}
785
822
}
786
823
824
+ func setTxPool (ctx * cli.Context , cfg * core.TxPoolConfig ) {
825
+ if ctx .GlobalIsSet (TxPoolPriceLimitFlag .Name ) {
826
+ cfg .PriceLimit = ctx .GlobalUint64 (TxPoolPriceLimitFlag .Name )
827
+ }
828
+ if ctx .GlobalIsSet (TxPoolPriceBumpFlag .Name ) {
829
+ cfg .PriceBump = ctx .GlobalUint64 (TxPoolPriceBumpFlag .Name )
830
+ }
831
+ if ctx .GlobalIsSet (TxPoolAccountSlotsFlag .Name ) {
832
+ cfg .AccountSlots = ctx .GlobalUint64 (TxPoolAccountSlotsFlag .Name )
833
+ }
834
+ if ctx .GlobalIsSet (TxPoolGlobalSlotsFlag .Name ) {
835
+ cfg .GlobalSlots = ctx .GlobalUint64 (TxPoolGlobalSlotsFlag .Name )
836
+ }
837
+ if ctx .GlobalIsSet (TxPoolAccountQueueFlag .Name ) {
838
+ cfg .AccountQueue = ctx .GlobalUint64 (TxPoolAccountQueueFlag .Name )
839
+ }
840
+ if ctx .GlobalIsSet (TxPoolGlobalQueueFlag .Name ) {
841
+ cfg .GlobalQueue = ctx .GlobalUint64 (TxPoolGlobalQueueFlag .Name )
842
+ }
843
+ if ctx .GlobalIsSet (TxPoolLifetimeFlag .Name ) {
844
+ cfg .Lifetime = ctx .GlobalDuration (TxPoolLifetimeFlag .Name )
845
+ }
846
+ }
847
+
787
848
func setEthash (ctx * cli.Context , cfg * eth.Config ) {
788
849
if ctx .GlobalIsSet (EthashCacheDirFlag .Name ) {
789
850
cfg .EthashCacheDir = ctx .GlobalString (EthashCacheDirFlag .Name )
@@ -826,6 +887,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
826
887
ks := stack .AccountManager ().Backends (keystore .KeyStoreType )[0 ].(* keystore.KeyStore )
827
888
setEtherbase (ctx , ks , cfg )
828
889
setGPO (ctx , & cfg .GPO )
890
+ setTxPool (ctx , & cfg .TxPool )
829
891
setEthash (ctx , cfg )
830
892
831
893
switch {
0 commit comments