Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
c6a9616c
Unverified
Commit
c6a9616c
authored
Jul 10, 2019
by
rjl493456442
Committed by
Péter Szilágyi
Jul 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: encapsulate les relative cli options
parent
8c4bc4f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
33 deletions
+43
-33
usage.go
cmd/geth/usage.go
+7
-2
flags.go
cmd/utils/flags.go
+36
-31
No files found.
cmd/geth/usage.go
View file @
c6a9616c
...
...
@@ -82,6 +82,13 @@ var AppHelpFlagGroups = []flagGroup{
utils
.
GCModeFlag
,
utils
.
EthStatsURLFlag
,
utils
.
IdentityFlag
,
utils
.
LightKDFFlag
,
utils
.
WhitelistFlag
,
},
},
{
Name
:
"LES"
,
Flags
:
[]
cli
.
Flag
{
utils
.
LightServFlag
,
utils
.
LightBandwidthInFlag
,
utils
.
LightBandwidthOutFlag
,
...
...
@@ -89,8 +96,6 @@ var AppHelpFlagGroups = []flagGroup{
utils
.
UltraLightServersFlag
,
utils
.
UltraLightFractionFlag
,
utils
.
UltraLightOnlyAnnounceFlag
,
utils
.
LightKDFFlag
,
utils
.
WhitelistFlag
,
},
},
{
...
...
cmd/utils/flags.go
View file @
c6a9616c
...
...
@@ -174,20 +174,6 @@ var (
Name
:
"exitwhensynced"
,
Usage
:
"Exits after block synchronisation completes"
,
}
UltraLightServersFlag
=
cli
.
StringFlag
{
Name
:
"ulc.servers"
,
Usage
:
"List of trusted ultra-light servers"
,
Value
:
strings
.
Join
(
eth
.
DefaultConfig
.
UltraLightServers
,
","
),
}
UltraLightFractionFlag
=
cli
.
IntFlag
{
Name
:
"ulc.fraction"
,
Usage
:
"Minimum % of trusted ultra-light servers required to announce a new head"
,
Value
:
eth
.
DefaultConfig
.
UltraLightFraction
,
}
UltraLightOnlyAnnounceFlag
=
cli
.
BoolFlag
{
Name
:
"ulc.onlyannounce"
,
Usage
:
"Ultra light server sends announcements only"
,
}
IterativeOutputFlag
=
cli
.
BoolFlag
{
Name
:
"iterative"
,
Usage
:
"Print streaming JSON iteratively, delimited by newlines"
,
...
...
@@ -215,6 +201,15 @@ var (
Usage
:
`Blockchain garbage collection mode ("full", "archive")`
,
Value
:
"full"
,
}
LightKDFFlag
=
cli
.
BoolFlag
{
Name
:
"lightkdf"
,
Usage
:
"Reduce key-derivation RAM & CPU usage at some expense of KDF strength"
,
}
WhitelistFlag
=
cli
.
StringFlag
{
Name
:
"whitelist"
,
Usage
:
"Comma separated block number-to-hash mappings to enforce (<number>=<hash>)"
,
}
// LES settings
LightServFlag
=
cli
.
IntFlag
{
Name
:
"lightserv"
,
Usage
:
"Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100)"
,
...
...
@@ -235,13 +230,19 @@ var (
Usage
:
"Maximum number of LES client peers"
,
Value
:
eth
.
DefaultConfig
.
LightPeers
,
}
LightKDFFlag
=
cli
.
BoolFlag
{
Name
:
"lightkdf"
,
Usage
:
"Reduce key-derivation RAM & CPU usage at some expense of KDF strength"
,
UltraLightServersFlag
=
cli
.
StringFlag
{
Name
:
"ulc.servers"
,
Usage
:
"List of trusted ultra-light servers"
,
Value
:
strings
.
Join
(
eth
.
DefaultConfig
.
UltraLightServers
,
","
),
}
WhitelistFlag
=
cli
.
StringFlag
{
Name
:
"whitelist"
,
Usage
:
"Comma separated block number-to-hash mappings to enforce (<number>=<hash>)"
,
UltraLightFractionFlag
=
cli
.
IntFlag
{
Name
:
"ulc.fraction"
,
Usage
:
"Minimum % of trusted ultra-light servers required to announce a new head"
,
Value
:
eth
.
DefaultConfig
.
UltraLightFraction
,
}
UltraLightOnlyAnnounceFlag
=
cli
.
BoolFlag
{
Name
:
"ulc.onlyannounce"
,
Usage
:
"Ultra light server sends announcements only"
,
}
// Dashboard settings
DashboardEnabledFlag
=
cli
.
BoolFlag
{
...
...
@@ -949,8 +950,20 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
}
}
// setUltraLight configures the ultra light client settings from the command line flags.
func
setUltraLight
(
ctx
*
cli
.
Context
,
cfg
*
eth
.
Config
)
{
// setLes configures the les server and ultra light client settings from the command line flags.
func
setLes
(
ctx
*
cli
.
Context
,
cfg
*
eth
.
Config
)
{
if
ctx
.
GlobalIsSet
(
LightServFlag
.
Name
)
{
cfg
.
LightServ
=
ctx
.
GlobalInt
(
LightServFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
LightBandwidthInFlag
.
Name
)
{
cfg
.
LightBandwidthIn
=
ctx
.
GlobalInt
(
LightBandwidthInFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
LightBandwidthOutFlag
.
Name
)
{
cfg
.
LightBandwidthOut
=
ctx
.
GlobalInt
(
LightBandwidthOutFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
LightPeersFlag
.
Name
)
{
cfg
.
LightPeers
=
ctx
.
GlobalInt
(
LightPeersFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
UltraLightServersFlag
.
Name
)
{
cfg
.
UltraLightServers
=
strings
.
Split
(
ctx
.
GlobalString
(
UltraLightServersFlag
.
Name
),
","
)
}
...
...
@@ -1379,19 +1392,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
setEthash
(
ctx
,
cfg
)
setMiner
(
ctx
,
&
cfg
.
Miner
)
setWhitelist
(
ctx
,
cfg
)
set
UltraLight
(
ctx
,
cfg
)
set
Les
(
ctx
,
cfg
)
if
ctx
.
GlobalIsSet
(
SyncModeFlag
.
Name
)
{
cfg
.
SyncMode
=
*
GlobalTextMarshaler
(
ctx
,
SyncModeFlag
.
Name
)
.
(
*
downloader
.
SyncMode
)
}
if
ctx
.
GlobalIsSet
(
LightServFlag
.
Name
)
{
cfg
.
LightServ
=
ctx
.
GlobalInt
(
LightServFlag
.
Name
)
}
cfg
.
LightBandwidthIn
=
ctx
.
GlobalInt
(
LightBandwidthInFlag
.
Name
)
cfg
.
LightBandwidthOut
=
ctx
.
GlobalInt
(
LightBandwidthOutFlag
.
Name
)
if
ctx
.
GlobalIsSet
(
LightPeersFlag
.
Name
)
{
cfg
.
LightPeers
=
ctx
.
GlobalInt
(
LightPeersFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
NetworkIdFlag
.
Name
)
{
cfg
.
NetworkId
=
ctx
.
GlobalUint64
(
NetworkIdFlag
.
Name
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment