@@ -174,20 +174,6 @@ var (
174174 Name : "exitwhensynced" ,
175175 Usage : "Exits after block synchronisation completes" ,
176176 }
177- UltraLightServersFlag = cli.StringFlag {
178- Name : "ulc.servers" ,
179- Usage : "List of trusted ultra-light servers" ,
180- Value : strings .Join (eth .DefaultConfig .UltraLightServers , "," ),
181- }
182- UltraLightFractionFlag = cli.IntFlag {
183- Name : "ulc.fraction" ,
184- Usage : "Minimum % of trusted ultra-light servers required to announce a new head" ,
185- Value : eth .DefaultConfig .UltraLightFraction ,
186- }
187- UltraLightOnlyAnnounceFlag = cli.BoolFlag {
188- Name : "ulc.onlyannounce" ,
189- Usage : "Ultra light server sends announcements only" ,
190- }
191177 IterativeOutputFlag = cli.BoolFlag {
192178 Name : "iterative" ,
193179 Usage : "Print streaming JSON iteratively, delimited by newlines" ,
@@ -215,6 +201,15 @@ var (
215201 Usage : `Blockchain garbage collection mode ("full", "archive")` ,
216202 Value : "full" ,
217203 }
204+ LightKDFFlag = cli.BoolFlag {
205+ Name : "lightkdf" ,
206+ Usage : "Reduce key-derivation RAM & CPU usage at some expense of KDF strength" ,
207+ }
208+ WhitelistFlag = cli.StringFlag {
209+ Name : "whitelist" ,
210+ Usage : "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)" ,
211+ }
212+ // LES settings
218213 LightServFlag = cli.IntFlag {
219214 Name : "lightserv" ,
220215 Usage : "Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100)" ,
@@ -235,13 +230,19 @@ var (
235230 Usage : "Maximum number of LES client peers" ,
236231 Value : eth .DefaultConfig .LightPeers ,
237232 }
238- LightKDFFlag = cli.BoolFlag {
239- Name : "lightkdf" ,
240- Usage : "Reduce key-derivation RAM & CPU usage at some expense of KDF strength" ,
233+ UltraLightServersFlag = cli.StringFlag {
234+ Name : "ulc.servers" ,
235+ Usage : "List of trusted ultra-light servers" ,
236+ Value : strings .Join (eth .DefaultConfig .UltraLightServers , "," ),
241237 }
242- WhitelistFlag = cli.StringFlag {
243- Name : "whitelist" ,
244- Usage : "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)" ,
238+ UltraLightFractionFlag = cli.IntFlag {
239+ Name : "ulc.fraction" ,
240+ Usage : "Minimum % of trusted ultra-light servers required to announce a new head" ,
241+ Value : eth .DefaultConfig .UltraLightFraction ,
242+ }
243+ UltraLightOnlyAnnounceFlag = cli.BoolFlag {
244+ Name : "ulc.onlyannounce" ,
245+ Usage : "Ultra light server sends announcements only" ,
245246 }
246247 // Dashboard settings
247248 DashboardEnabledFlag = cli.BoolFlag {
@@ -949,8 +950,20 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
949950 }
950951}
951952
952- // setUltraLight configures the ultra light client settings from the command line flags.
953- func setUltraLight (ctx * cli.Context , cfg * eth.Config ) {
953+ // setLes configures the les server and ultra light client settings from the command line flags.
954+ func setLes (ctx * cli.Context , cfg * eth.Config ) {
955+ if ctx .GlobalIsSet (LightServFlag .Name ) {
956+ cfg .LightServ = ctx .GlobalInt (LightServFlag .Name )
957+ }
958+ if ctx .GlobalIsSet (LightBandwidthInFlag .Name ) {
959+ cfg .LightBandwidthIn = ctx .GlobalInt (LightBandwidthInFlag .Name )
960+ }
961+ if ctx .GlobalIsSet (LightBandwidthOutFlag .Name ) {
962+ cfg .LightBandwidthOut = ctx .GlobalInt (LightBandwidthOutFlag .Name )
963+ }
964+ if ctx .GlobalIsSet (LightPeersFlag .Name ) {
965+ cfg .LightPeers = ctx .GlobalInt (LightPeersFlag .Name )
966+ }
954967 if ctx .GlobalIsSet (UltraLightServersFlag .Name ) {
955968 cfg .UltraLightServers = strings .Split (ctx .GlobalString (UltraLightServersFlag .Name ), "," )
956969 }
@@ -1379,19 +1392,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
13791392 setEthash (ctx , cfg )
13801393 setMiner (ctx , & cfg .Miner )
13811394 setWhitelist (ctx , cfg )
1382- setUltraLight (ctx , cfg )
1395+ setLes (ctx , cfg )
13831396
13841397 if ctx .GlobalIsSet (SyncModeFlag .Name ) {
13851398 cfg .SyncMode = * GlobalTextMarshaler (ctx , SyncModeFlag .Name ).(* downloader.SyncMode )
13861399 }
1387- if ctx .GlobalIsSet (LightServFlag .Name ) {
1388- cfg .LightServ = ctx .GlobalInt (LightServFlag .Name )
1389- }
1390- cfg .LightBandwidthIn = ctx .GlobalInt (LightBandwidthInFlag .Name )
1391- cfg .LightBandwidthOut = ctx .GlobalInt (LightBandwidthOutFlag .Name )
1392- if ctx .GlobalIsSet (LightPeersFlag .Name ) {
1393- cfg .LightPeers = ctx .GlobalInt (LightPeersFlag .Name )
1394- }
13951400 if ctx .GlobalIsSet (NetworkIdFlag .Name ) {
13961401 cfg .NetworkId = ctx .GlobalUint64 (NetworkIdFlag .Name )
13971402 }
0 commit comments