mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-03 15:55:47 +00:00
rm --terminal-total-difficulty command-line option (#2221)
This commit is contained in:
parent
e6d5a791f5
commit
75ff54fef3
@ -61,7 +61,7 @@ let
|
|||||||
version.NimVersion
|
version.NimVersion
|
||||||
]
|
]
|
||||||
|
|
||||||
proc defaultDataDir*(): string =
|
func defaultDataDir*(): string =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
getHomeDir() / "AppData" / "Roaming" / "Nimbus"
|
getHomeDir() / "AppData" / "Roaming" / "Nimbus"
|
||||||
elif defined(macosx):
|
elif defined(macosx):
|
||||||
@ -69,10 +69,10 @@ proc defaultDataDir*(): string =
|
|||||||
else:
|
else:
|
||||||
getHomeDir() / ".cache" / "nimbus"
|
getHomeDir() / ".cache" / "nimbus"
|
||||||
|
|
||||||
proc defaultKeystoreDir*(): string =
|
func defaultKeystoreDir*(): string =
|
||||||
defaultDataDir() / "keystore"
|
defaultDataDir() / "keystore"
|
||||||
|
|
||||||
proc getLogLevels(): string =
|
func getLogLevels(): string =
|
||||||
var logLevels: seq[string]
|
var logLevels: seq[string]
|
||||||
for level in LogLevel:
|
for level in LogLevel:
|
||||||
if level < enabledLogLevel:
|
if level < enabledLogLevel:
|
||||||
@ -437,11 +437,6 @@ type
|
|||||||
defaultValue: false
|
defaultValue: false
|
||||||
name: "engine-api-ws" .}: bool
|
name: "engine-api-ws" .}: bool
|
||||||
|
|
||||||
terminalTotalDifficulty* {.
|
|
||||||
desc: "The terminal total difficulty of the eth2 merge transition block." &
|
|
||||||
" It takes precedence over terminalTotalDifficulty in config file."
|
|
||||||
name: "terminal-total-difficulty" .}: Option[UInt256]
|
|
||||||
|
|
||||||
allowedOrigins* {.
|
allowedOrigins* {.
|
||||||
desc: "Comma separated list of domains from which to accept cross origin requests"
|
desc: "Comma separated list of domains from which to accept cross origin requests"
|
||||||
defaultValue: @[]
|
defaultValue: @[]
|
||||||
@ -488,38 +483,38 @@ type
|
|||||||
defaultValue: ""
|
defaultValue: ""
|
||||||
name: "blocks-file" }: InputFile
|
name: "blocks-file" }: InputFile
|
||||||
|
|
||||||
proc parseCmdArg(T: type NetworkId, p: string): T
|
func parseCmdArg(T: type NetworkId, p: string): T
|
||||||
{.gcsafe, raises: [ValueError].} =
|
{.gcsafe, raises: [ValueError].} =
|
||||||
parseInt(p).T
|
parseInt(p).T
|
||||||
|
|
||||||
proc completeCmdArg(T: type NetworkId, val: string): seq[string] =
|
func completeCmdArg(T: type NetworkId, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc parseCmdArg(T: type UInt256, p: string): T
|
func parseCmdArg(T: type UInt256, p: string): T
|
||||||
{.gcsafe, raises: [ValueError].} =
|
{.gcsafe, raises: [ValueError].} =
|
||||||
parse(p, T)
|
parse(p, T)
|
||||||
|
|
||||||
proc completeCmdArg(T: type UInt256, val: string): seq[string] =
|
func completeCmdArg(T: type UInt256, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc parseCmdArg(T: type EthAddress, p: string): T
|
func parseCmdArg(T: type EthAddress, p: string): T
|
||||||
{.gcsafe, raises: [ValueError].}=
|
{.gcsafe, raises: [ValueError].}=
|
||||||
try:
|
try:
|
||||||
result = hexToByteArray(p, 20)
|
result = hexToByteArray(p, 20)
|
||||||
except CatchableError:
|
except CatchableError:
|
||||||
raise newException(ValueError, "failed to parse EthAddress")
|
raise newException(ValueError, "failed to parse EthAddress")
|
||||||
|
|
||||||
proc completeCmdArg(T: type EthAddress, val: string): seq[string] =
|
func completeCmdArg(T: type EthAddress, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc parseCmdArg*(T: type enr.Record, p: string): T {.raises: [ValueError].} =
|
func parseCmdArg*(T: type enr.Record, p: string): T {.raises: [ValueError].} =
|
||||||
if not fromURI(result, p):
|
if not fromURI(result, p):
|
||||||
raise newException(ValueError, "Invalid ENR")
|
raise newException(ValueError, "Invalid ENR")
|
||||||
|
|
||||||
proc completeCmdArg*(T: type enr.Record, val: string): seq[string] =
|
func completeCmdArg*(T: type enr.Record, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc processList(v: string, o: var seq[string])
|
func processList(v: string, o: var seq[string])
|
||||||
=
|
=
|
||||||
## Process comma-separated list of strings.
|
## Process comma-separated list of strings.
|
||||||
if len(v) > 0:
|
if len(v) > 0:
|
||||||
@ -535,10 +530,10 @@ proc parseCmdArg(T: type NetworkParams, p: string): T
|
|||||||
except CatchableError:
|
except CatchableError:
|
||||||
raise newException(ValueError, "failed to load customNetwork")
|
raise newException(ValueError, "failed to load customNetwork")
|
||||||
|
|
||||||
proc completeCmdArg(T: type NetworkParams, val: string): seq[string] =
|
func completeCmdArg(T: type NetworkParams, val: string): seq[string] =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
proc setBootnodes(output: var seq[ENode], nodeUris: openArray[string]) =
|
func setBootnodes(output: var seq[ENode], nodeUris: openArray[string]) =
|
||||||
output = newSeqOfCap[ENode](nodeUris.len)
|
output = newSeqOfCap[ENode](nodeUris.len)
|
||||||
for item in nodeUris:
|
for item in nodeUris:
|
||||||
output.add(ENode.fromString(item).expect("valid hardcoded ENode"))
|
output.add(ENode.fromString(item).expect("valid hardcoded ENode"))
|
||||||
@ -653,7 +648,7 @@ proc getRpcFlags*(conf: NimbusConf): set[RpcFlag] =
|
|||||||
proc getWsFlags*(conf: NimbusConf): set[RpcFlag] =
|
proc getWsFlags*(conf: NimbusConf): set[RpcFlag] =
|
||||||
getRpcFlags(conf.wsApi)
|
getRpcFlags(conf.wsApi)
|
||||||
|
|
||||||
proc fromEnr*(T: type ENode, r: enr.Record): ENodeResult[ENode] =
|
func fromEnr*(T: type ENode, r: enr.Record): ENodeResult[ENode] =
|
||||||
let
|
let
|
||||||
# TODO: there must always be a public key, else no signature verification
|
# TODO: there must always be a public key, else no signature verification
|
||||||
# could have been done and no Record would exist here.
|
# could have been done and no Record would exist here.
|
||||||
@ -725,7 +720,7 @@ proc getStaticPeers*(conf: NimbusConf): seq[ENode] =
|
|||||||
|
|
||||||
staticPeers
|
staticPeers
|
||||||
|
|
||||||
proc getAllowedOrigins*(conf: NimbusConf): seq[Uri] =
|
func getAllowedOrigins*(conf: NimbusConf): seq[Uri] =
|
||||||
for item in repeatingList(conf.allowedOrigins):
|
for item in repeatingList(conf.allowedOrigins):
|
||||||
result.add parseUri(item)
|
result.add parseUri(item)
|
||||||
|
|
||||||
@ -784,11 +779,6 @@ proc makeConfig*(cmdLine = commandLineParams()): NimbusConf
|
|||||||
result.networkParams = networkParams(result.networkId)
|
result.networkParams = networkParams(result.networkId)
|
||||||
|
|
||||||
if result.cmd == noCommand:
|
if result.cmd == noCommand:
|
||||||
# ttd from cli takes precedence over ttd from config-file
|
|
||||||
if result.terminalTotalDifficulty.isSome:
|
|
||||||
result.networkParams.config.terminalTotalDifficulty =
|
|
||||||
result.terminalTotalDifficulty
|
|
||||||
|
|
||||||
if result.udpPort == Port(0):
|
if result.udpPort == Port(0):
|
||||||
# if udpPort not set in cli, then
|
# if udpPort not set in cli, then
|
||||||
result.udpPort = result.tcpPort
|
result.udpPort = result.tcpPort
|
||||||
|
Loading…
x
Reference in New Issue
Block a user